Created
October 15, 2010 10:01
-
-
Save anonymous/627945 to your computer and use it in GitHub Desktop.
This file contains 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
(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