Created
February 17, 2011 12:30
-
-
Save rik0/831622 to your computer and use it in GitHub Desktop.
mdef.clj
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 mdef [keys values] | |
`(do | |
~@(loop [keys keys, values values, forms ()] | |
(if (seq keys) | |
(recur (rest keys) (rest values) | |
(cons `(def ~(first keys) ~(first values)) | |
forms)) | |
forms)))) | |
(mdef [a b c] [1 2 3]) | |
(println a b) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment