Skip to content

Instantly share code, notes, and snippets.

@mwmitchell
Created January 29, 2015 15:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mwmitchell/2db95d5b2f5264102f3e to your computer and use it in GitHub Desktop.
Save mwmitchell/2db95d5b2f5264102f3e to your computer and use it in GitHub Desktop.
defmacro for dynamic def name
(def names {:foo 'FOO})
(defmacro def* [dname dval]
`(def ~dname ~dval))
;; This doesn't resolve the (get names :foo) => 'FOO
(macroexpand-1 '(def* (get names :foo) 300))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment