Skip to content

Instantly share code, notes, and snippets.

@cemerick
Created July 14, 2011 00:03
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 cemerick/562cc9580b0579de8179 to your computer and use it in GitHub Desktop.
Save cemerick/562cc9580b0579de8179 to your computer and use it in GitHub Desktop.
=> (defmacro dummy-defn
[name args & body]
(println "emitted defn with name meta of:" (meta name))
`(defn ~name
~args
~@body))
#'user/dummy-defn
=> (dummy-defn ^:private ^:blahblah foo
[a b]
(+ a b))
emitted defn with name meta of: {:private true, :blahblah true}
#'user/foo
=> (meta #'foo)
{:arglists ([a b]), :ns #<Namespace user>, :name foo, :blahblah true, :private true, :line 1, :file "NO_SOURCE_PATH"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment