Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
macrolet example
(defmacro defmap [name & body]
(let [g (gensym)]
`(macrolet [(~'add [k# v#] `(swap! ~'~g assoc ~k# ~v#))]
(let [~g (atom {})]
~@body
(def ~name (deref ~g))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.