Hello. Why does case
behave this way?
(case :foo
:foo "foo") => "foo"
(let [foo :foo]
(case :foo
foo "foo")) => nil
I would expect both to yield "foo"
. What am I missing here?The test constants in case
must be compile-time literals.
https://clojuredocs.org/clojure.core/case "The test-constants are not evaluated."
Thank you. So what is the idiomatic way to do a "case" like conditional when having the values as constants?
(let [foo :foo]
(condp = :foo
foo "foo"))
Provided that I understand your question correctly.Well, that's probably not exactly what you're after, but (condp = ...)
is pretty common.
I can live with that. đ Thank you!
hi I am planning to make a simple flat-file blog which are the options for server side cljs development
to be more clear I am looking simple framework with basic routing
I would happily nominate Reitit + Ring-Jetty.
You may already know this, but âframeworksâ are not much of a thing in Clojure. At least when compared to what is available in JS land.
Hello There,
I am working with react-map-gl and trying to disable the + - for map zoom in and out but cannot get the button selected (let [zoom-in-button (first (-> js/document (.getElementsByClassName "mapboxgl-ctrl-zoom-in")))])
when shadow-cljs page load and this return HTMLCollection [] and I get this error Uncaught TypeError: Cannot read property âsetAttributeâ of null. I am not sure why I canât get the button selected.
thank you I am going to check it now
this is exactly what I was looking for đ
Can I force the Clojurescript compiler to output Javascript that uses export
for each function that should be exported instead of module.export
?
You can do this using Shadow-CLJS, check out this thread: https://clojureverse.org/t/generating-es-modules-browser-deno/6116
OK. Thanks