Skip to content

Instantly share code, notes, and snippets.

@ynniv
Created October 10, 2012 02:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ynniv/3862734 to your computer and use it in GitHub Desktop.
Save ynniv/3862734 to your computer and use it in GitHub Desktop.
passing fields as a variable to defrecord
(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