Created
April 25, 2011 15:14
-
-
Save anonymous/940651 to your computer and use it in GitHub Desktop.
define function with its source as metadata
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 defn+ | |
[& params] | |
`(do | |
(defn ~@params) | |
(def ~(first params) | |
(with-meta | |
~(first params) | |
{:source (str | |
"(defn " | |
~@(interleave (map str params) (repeat " ")) | |
")" | |
)})))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment