On Mon, Apr 1, 2013 at 1:32 PM, Alan Malloy <a...@malloys.org> wrote:

> This is how every macro and special form works. I know you like to
> complain, but the alternative is simply not possible: macros have complete
> control of expanding their bodies, and any macros therein are expanded
> later, not before. Try writing a macro system that goes the other way, and
> see how disastrous the result is.


Precisely because "macros have complete control" of their bodies, it is not
true that "any macros therein are expanded later, not before". A macro can,
at its discretion, choose to macroexpand its arguments if it wants to. It's
not always unreasonable to do this: I wrote a parallel let macro that
expands the binding expressions in its binding vector to find out what
names are occur free in them. That's much easier to do after fully
macroexpanding the forms, since you only have to deal with the five or so
primitive binding forms. (In that case the macroexpansion was only done for
ease of investigating the forms, and the un-expanded versions were what
were interpolated into the return value of the macro, but that's beside the
point; a macro *can* expand its arguments.)

-- 
Ben Wolfson
"Human kind has used its intelligence to vary the flavour of drinks, which
may be sweet, aromatic, fermented or spirit-based. ... Family and social
life also offer numerous other occasions to consume drinks for pleasure."
[Larousse, "Drink" entry]

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