2 ms·
ClojureScript has compile-time only macros, but they are handy for repetitive (set!) calls as in your example. You might want to look at the (attr) macro in the
by lynaghk 15y ago
ClojureScript has compile-time only macros, but they are handy for repetitive (set!) calls as in your example.
You might want to look at the (attr) macro in the cljs-d3 source:
https://github.com/lynaghk/cljs-d3/blob/master/src/clj/cljs_d3/macros.clj https://github.com/lynaghk/cljs-d3/blob/master/src/clj/cljs_...
which solves a very similar problem to the one you mentioned in the article.
In this case it expands attr(hash-map) into multiple attr(key, value) calls at compile time.