Skip to content

Instantly share code, notes, and snippets.

@kineticz
Created January 25, 2015 19:03
Show Gist options
  • Select an option

  • Save kineticz/dbc4c1482db38919d56f to your computer and use it in GitHub Desktop.

Select an option

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.
(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