beginners

Getting started with Clojure/ClojureScript? Welcome! Also try: https://ask.clojure.org. Check out resources at https://gist.github.com/yogthos/be323be0361c589570a6da4ccc85f58f.
2020-09-12T01:08:18.140900Z

Inherited from the similar distinction that the JVM makes between those two types, in this case.

2020-09-12T01:08:57.141100Z

ClojureScript does not have this distinction, I would guess because JavaScript does not have a character type, only strings.

2020-09-12T01:09:11.141300Z

ohhh that makes sense

2020-09-12T01:09:32.141500Z

Yeah it’s a little weird because I’m learning Clojure on the JVM even though I’m coming from JS

2020-09-12T01:10:00.141700Z

[18:08:59] $ clj
Clojure 1.10.1
user=> (map identity "abcdef")
(\a \b \c \d \e \f)
user=> ^D

$ clj -Sdeps "{:deps {org.clojure/clojurescript {:mvn/version \"1.10.597\"}}}" -m cljs.main --repl-env node
ClojureScript 1.10.597
cljs.user=> (map identity "abcdef")
("a" "b" "c" "d" "e" "f")

2020-09-12T01:10:30.141900Z

Wow ok

2020-09-12T01:10:36.142100Z

Programming is fun

jaihindhreddy 2020-09-12T05:38:14.146100Z

Just gonna leave this here. It's too great of an opportunity to pass up πŸ˜›: https://www.youtube.com/watch?v=aSEQfqNYNAc

Chris K 2020-09-12T05:51:54.146900Z

What are the best online free resources to start learning web development with Clojure?

seancorfield 2020-09-12T06:06:42.147300Z

@sunchaesk There's probably some Practicalli stuff about that...?

seancorfield 2020-09-12T06:07:11.147500Z

Yeah, here you go: https://practicalli.github.io/clojure-webapps/

practicalli-john 2020-09-12T07:31:16.149800Z

Hi Chris, the ToDo app is an example of a webapp using Leiningen build tool. All new content is predominately Clojure CLI tools based, however, this makes no difference to the actual code. The main difference is using the tooling, Clojure CLI and community tools vs leiningen and plugins. There is a #practicalli channel if you want to discuss any content or have questions, or you can send me a direct message through slack.

Chris K 2020-09-12T08:01:57.151200Z

oh alright thanks for the clarification

Chris K 2020-09-12T06:10:20.147600Z

Thanks πŸ˜„

Chris K 2020-09-12T06:12:50.147800Z

It says that the content is being updated and would it be fine to just follow?

seancorfield 2020-09-12T06:20:46.148Z

@jr0cket would be the one to provide more detail... He's in the UK so it's early morning Saturday for him right now.

Chris K 2020-09-12T06:21:56.148200Z

alright... I think they are changing it from lein to something and because I use lein, I think I should be fine

Chris K 2020-09-12T06:22:10.148400Z

but maybe I misunderstood some stuff so I'll try to get things clear

seancorfield 2020-09-12T06:23:42.148600Z

I suspect John is updating it all to use the official Clojure CLI stuff

seancorfield 2020-09-12T06:24:05.148800Z

(but if it still uses lein in the examples you'll be fine)

Chris K 2020-09-12T06:24:19.149Z

alright thank you so much

seancorfield 2020-09-12T06:25:45.149200Z

Ah, yes, he says as much on that home page and links to https://practicalli.github.io/blog/posts/clojure-web-server-cli-tools-deps-edn/

Chris K 2020-09-12T06:26:23.149400Z

thank you

practicalli-john 2020-09-12T07:31:16.149800Z

Hi Chris, the ToDo app is an example of a webapp using Leiningen build tool. All new content is predominately Clojure CLI tools based, however, this makes no difference to the actual code. The main difference is using the tooling, Clojure CLI and community tools vs leiningen and plugins. There is a #practicalli channel if you want to discuss any content or have questions, or you can send me a direct message through slack.

2020-09-12T08:00:48.150700Z

@sunchaesk I can also recommend https://pragprog.com/titles/dswdcloj3/web-development-with-clojure-third-edition/

1☝️
2020-09-12T08:01:07.151100Z

Sorry, not free

Chris K 2020-09-12T08:01:57.151200Z

oh alright thanks for the clarification

vncz 2020-09-12T13:55:58.152200Z

Anybody fancy to help a beginner with Spec? I am having some troubles on why something is passing the validation

vncz 2020-09-12T13:57:25.152300Z

Why is this true? The ::children β€” is supposed to be a ::node and it's missing the required property ::value :thinking_face:

2020-09-15T15:46:06.233800Z

When I try evaluating that in a REPL, the call to s/valid? returns false.

2020-09-15T15:46:09.234Z

What do you see?

vncz 2020-09-15T15:50:35.234200Z

:thinking_face: false , as it should be.

vncz 2020-09-15T15:50:59.234400Z

I guess I just messed up something while testing stuff 🀦

vncz 2020-09-12T13:57:57.153Z

Curiously enough, it returns false if I'm passing a non numeric ::value

vncz 2020-09-12T13:58:11.153300Z

(s/valid? ::children [{::value 10 ::children [{::value "osso"}]}]) => false

vncz 2020-09-12T14:35:10.153800Z

Oh ok interesting, opt does not seem to do what I was expecting

Mark Gerard 2020-09-12T14:55:19.154100Z

@heefoo Here you go: https://www.learn-clojurescript.com

nivekuil 2020-09-12T18:03:34.154600Z

I have a foo.cljc requiring some symbol defined in bar.cljc, for which the same namespace also has a bar.clj. If I eval bar.cljc first then foo.cljc will eval just fine, but if I integrant.repl/reset it can't find the symbol -- it seems to only look in bar.clj. is this expected?

Michael W 2020-09-12T18:21:22.154900Z

Yes that should be expected. cljc files have the lowest precedence. Any reason you want a clj and a cljc with the same name? cljc files are for combined clj/cljs code, so typically you would have a cljs and a clj file, or 1 cljc file using reader conditionals to split out the clj from the cljs in the 1 cljc file.

Michael W 2020-09-12T18:23:56.155200Z

https://clojure.org/guides/reader_conditionals

nivekuil 2020-09-12T18:25:57.155400Z

aesthetics, really. reader conditionals are generally ok but when the imports are really different all the #?@s get noisy, and copy pasting across separate files is of course a non-starter

Michael W 2020-09-12T18:26:49.155600Z

Well it's the nature of the beast, 2 files, or 1 file and reader conditionals...

Michael W 2020-09-12T18:27:20.155800Z

If clj and cljc exists, clojure will take the clj and ignore the cljc file afaik.

nivekuil 2020-09-12T18:30:39.156Z

yeah I see we can't actually have the same (ns foo) across multiple files, so there's no way this could work the way I'm imagining it, with some kind of ns merging ability. thanks for the info!

Michael W 2020-09-12T18:31:29.156200Z

That guide shows a pretty clean way to have requires split without having to splice everywhere.

az 2020-09-12T22:38:16.158100Z

Hi all, wondering what the solutions are when it comes to authorization for a a clojurescript app. Are there any libs for dealing with this?

shivekkhurana 2020-09-29T17:20:01.321800Z

If you have an SPA, any JS solution should work just fine.

dorab 2020-09-12T22:55:05.158700Z

@az You could try looking at https://www.clojure-toolbox.com/ and see if you find anything there.