Created
April 20, 2011 22:50
-
-
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.
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 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