Created
October 25, 2012 16:56
-
-
Save rasmusto/3954024 to your computer and use it in GitHub Desktop.
multimethods in a macro
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 defprop [multiname func kvs] | |
(eval | |
`(do | |
(defmulti ~multiname ~func) | |
~@(for [[k v] (seq kvs)] | |
`(defmethod ~multiname ~k [m#] ~v))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment