Skip to content

Instantly share code, notes, and snippets.

Created October 15, 2010 10:01
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 anonymous/627945 to your computer and use it in GitHub Desktop.
Save anonymous/627945 to your computer and use it in GitHub Desktop.
(def person-fields [{:name 'name :type String}])
(defmacro do-stuff [class-name]
`(do ~@(->> (deref (find-var (symbol "cara.webtl.db.upgrade" (str class-name "-fields"))))
(map :name)
(map (fn [printed-value]
`(println ~printed-value))))))
(def person-fields [{:name 'name :type String}])
cara.webtl.db.upgrade> (macroexpand-1 '(do-stuff person))
(do (clojure.core/println name)) ;; ohwell name is not quoted !
cara.webtl.db.upgrade>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment