Created
July 1, 2013 13:26
-
-
Save belucid/5900746 to your computer and use it in GitHub Desktop.
Define a macro with defmacro, and see what expands to with macroexpand.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
=> (defmacro test-it [& body] `(do (def foo "bar") ~@body)) | |
#'fcms.app/test-it | |
fcms.app=> (test-it (println foo)) | |
bar | |
nil | |
> (macroexpand '(test-it (println foo))) | |
(do (def fcms.app/foo "bar") (println foo)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment