Skip to content

Instantly share code, notes, and snippets.

@belucid
Created July 1, 2013 13:26
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 belucid/5900746 to your computer and use it in GitHub Desktop.
Save belucid/5900746 to your computer and use it in GitHub Desktop.
Define a macro with defmacro, and see what expands to with macroexpand.
=> (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