What Clojure, programming, or life skill did you learn this week?
Combining reader conditional macro
#?(:clj) and splicing. Example
#?@(:clj [1 2 3]). It’s documented officially here but I stumbled upon this in rum’s source to group clj deps and cljs deps in the
ns macro. Clever and more readable !
While reading some Clojure code yesterday I learned that Clojure allows you to be quite creative with var names …
transit-enabled‽. I shouldn’t but I like this
Don’t we all love a good interrobang‽ Note though that as far as I know using random unicode in var names is not officially supported, and it does not work in ClojureScript. It does happen to work fine in Clojure.
It’s a surprisingly hard question of what is or isn’t a valid symbol in Clojure or EDN. The EDN spec says one thing, but implementations are all a little different.