Inherited from the similar distinction that the JVM makes between those two types, in this case.
ClojureScript does not have this distinction, I would guess because JavaScript does not have a character type, only strings.
ohhh that makes sense
Yeah itβs a little weird because Iβm learning Clojure on the JVM even though Iβm coming from JS
[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")
Wow ok
Programming is fun
Just gonna leave this here. It's too great of an opportunity to pass up π: https://www.youtube.com/watch?v=aSEQfqNYNAc
What are the best online free resources to start learning web development with Clojure?
@sunchaesk There's probably some Practicalli stuff about that...?
Yeah, here you go: https://practicalli.github.io/clojure-webapps/
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.
oh alright thanks for the clarification
Thanks π
It says that the content is being updated and would it be fine to just follow?
@jr0cket would be the one to provide more detail... He's in the UK so it's early morning Saturday for him right now.
alright... I think they are changing it from lein to something and because I use lein, I think I should be fine
but maybe I misunderstood some stuff so I'll try to get things clear
I suspect John is updating it all to use the official Clojure CLI stuff
(but if it still uses lein
in the examples you'll be fine)
alright thank you so much
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/
thank you
@sunchaesk I can also recommend https://pragprog.com/titles/dswdcloj3/web-development-with-clojure-third-edition/
Sorry, not free
Anybody fancy to help a beginner with Spec? I am having some troubles on why something is passing the validation
Why is this true? The ::children
β is supposed to be a ::node
and it's missing the required property ::value
:thinking_face:
When I try evaluating that in a REPL, the call to s/valid? returns false.
What do you see?
:thinking_face: false
, as it should be.
I guess I just messed up something while testing stuff π€¦
Curiously enough, it returns false if I'm passing a non numeric ::value
(s/valid? ::children [{::value 10 ::children [{::value "osso"}]}]) => false
Oh ok interesting, opt
does not seem to do what I was expecting
@heefoo Here you go: https://www.learn-clojurescript.com
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?
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.
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
Well it's the nature of the beast, 2 files, or 1 file and reader conditionals...
If clj and cljc exists, clojure will take the clj and ignore the cljc file afaik.
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!
That guide shows a pretty clean way to have requires split without having to splice everywhere.
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?
If you have an SPA, any JS solution should work just fine.
@az You could try looking at https://www.clojure-toolbox.com/ and see if you find anything there.