Created
January 25, 2015 19:03
-
-
Save kineticz/dbc4c1482db38919d56f to your computer and use it in GitHub Desktop.
Why doesn't this macro work? It's supposed to print 1 to 5.
This file contains hidden or 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
| (require '(clojure [string :as str] | |
| [walk :as walk])) | |
| (defmacro reverse-it | |
| [form] | |
| (walk/postwalk #(if (symbol? %) | |
| (symbol (str/reverse (name %)))) | |
| form)) | |
| (reverse-it | |
| (qesod [gra (egnar 5)] | |
| (nltnirp (cni gra)))) | |
| (macroexpand-1 (reverse-it | |
| (qesod [gra (egnar 5)] | |
| (nltnirp (cni gra))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment