Created
October 10, 2012 02:06
-
-
Save ynniv/3862734 to your computer and use it in GitHub Desktop.
passing fields as a variable to defrecord
This file contains hidden or 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 defrecord+fields | |
"Supply the fields of a record using a variable." | |
[name fields & specs] | |
(let [fields (eval fields)] | |
`(defrecord ~name ~fields ~@specs))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment