Skip to content

Instantly share code, notes, and snippets.

@budu
Created April 20, 2011 22:50
Show Gist options
  • Save budu/933268 to your computer and use it in GitHub Desktop.
Save budu/933268 to your computer and use it in GitHub Desktop.
A macro which define a function and a macro that call that function passing the inner macro arguments and the form used to call it as the function arguments, or something like that.
(defmacro crazy [name & args]
(let [name* (symbol (str name \*))]
`(do
(defn ~name* [self# & params#]
(prn self#))
(defmacro ~name [~'& args#]
`(~~name* (quote ~~'&form) ~@args#)))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment