Skip to content

Instantly share code, notes, and snippets.

@amalloy
Created September 29, 2010 07:27
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 amalloy/602404 to your computer and use it in GitHub Desktop.
Save amalloy/602404 to your computer and use it in GitHub Desktop.
user> (defn make-getter [name type]
(list 'def name type))
#'user/make-getter
user> (defmacro make-gets [names types]
`(do
~@(map make-getter names types)))
#'user/make-gets
user> (macroexpand '(make-gets [a] ['str]))
(do (def a (quote str)))
user> (make-gets [a] ['str])
#'user/a
user> a
str
user>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment