On 28.05.2009, at 03:11, CuppoJava wrote:
> I'm using macroexpand-1 right now, but it's not terribly useful as
> backquotes expand to something nasty.
>
> Given:
> (defmacro mymacro []
> `(level1 `(level2)))
>
> I would like to see it expanded to:
> (user/level1 `(level2))
That's not possible, because the replacement happens *before* macro
expansion. The backquote is expanded by the reader.
To see what happens, just type
`(level1 `(level2))
into the REPL. The result is
(user/level1 (clojure.core/seq (clojure.core/concat (clojure.core/
list (quote user/level2)))))
Konrad.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---