Skip to content

Instantly share code, notes, and snippets.

@amalloy
Created September 29, 2010 07:22
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/602399 to your computer and use it in GitHub Desktop.
Save amalloy/602399 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]
`(map make-getter names types))
#'user/make-gets
user> (macroexpand '(make-gets [a b] ["str" "int"]))
(clojure.core/map user/make-getter user/names user/types)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment