Skip to content

Instantly share code, notes, and snippets.

@rik0
Created February 17, 2011 12:30
Show Gist options
  • Save rik0/831622 to your computer and use it in GitHub Desktop.
Save rik0/831622 to your computer and use it in GitHub Desktop.
mdef.clj
(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