--On 3 septembre 2013 02:08:23 -0700 Zach Tellman <ztell...@gmail.com> wrote:

Hey Konrad, you can maybe speak with more authority as to what
tools.macro does and doesn't provide, but my reading of it is that it
does expression walking to prevent bound variables from being incorrectly
symbol-macroexpanded.  This seems only important in the context of
symbol macros, however; if you don't use symbol macros it's functionally
equivalent to clojure.walk/macroexpand-all.  

Not quite. It expands only terms that are evaluated, using a built-in table of special forms, and it allows local macro definitions (macrolet). But most importantly, it tracks local bindings and expands only macros that are not shadowed. So if you have

 (defmacro foo [] ...)
 (let [foo (fn [] ...)]
    (foo 'bar))

the form (foo 'bar) is not expanded because its local binding is a function. The version in clojure.walk doesn't take this into account, and can therefore produce incorrect code, which is a major pain to debug. I know because it happened to me, that's why I ended up writing my own macro expander. And that's why I wonder how riddley handled this.

Konrad.

--
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- You received this message because you are subscribed to the Google Groups "Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to