Fork me on GitHub
#clojurescript
<
2020-01-13
>
g7s16:01:35

Is there any way a to make a macro emit a (def ^~metadata ~name ~value)? I know the above makes no sense because ^ is part of the reader but can I provide the metadata at macro-expansion time?

danielneal17:01:26

you can provide the metadata to a def in a map

danielneal17:01:51

ah maybe not

danielneal17:01:54

maybe that’s clojure only

bronsa17:01:58

you're thinking of defn

thheller17:01:31

@g7s (def ~(with-meta name metadata) ~value)

g7s17:01:34

@thheller thanks a lot man I feel stupid that I didn’t try with-meta

annarcana18:01:45

Anyone have any experience working with Figwheel and canvas? I'm having the weirdest behavior when using a scaled canvas with CanvasRenderingContext2D.scale(). Every time Figwheel hot reloads, my canvas blanks, and I have to reload the whole page.