[r6rs-discuss] macroexpand
On Sat, 2006-09-23 at 00:51 +0300, Dan Muresan wrote:
> > Eventually, more will be standardized, maybe even including
> > local-expand. Why is that so problematic?
>
> I'm using Scheme today to write web applications. R7RS is a few years away.
If you are writing web applications today in Scheme, you are surely
using facilities not provided by R5RS, and ones that will probably not
be provided by R6RS. Do you think all of those procedures should be in
R6RS? If not, why can't `local-expand' be left alone for a little
while?
> I use macroexpand where it's present and fragile hacks where it's not
> present. I wish I could count on macroexpand being there. It's easy to
> implement.
It's not easy to implement correctly, in a language with hygenic
macros.
> Couldn't we just call macroexpand "local-expand" and specify that for now
> it works only on certain macros, with the option of extending it in the
> future?
How would that even work? If define-macro were implemented in terms of
syntax-case, as described in the draft, there wouldn't even be a
difference between the two kinds of macros. Similarly, if you wrote a
macro that expanded its arguments with your defmacro-only local-expand,
and I used syntax-rules to define a macro that I used in the argument to
your macro, what would happen?
> > It would introduce a fundamentally broken macro system where previously
> > we had only working macro systems.
>
> Broken? It depends where you come from. Let's proceed chronologically.
John Cowan has already reviewed the relevant history here, but past
existence is not a defense against brokenness.
sam th
Received on Fri Sep 22 2006 - 19:26:21 UTC
This archive was generated by hypermail 2.3.0
: Wed Oct 23 2024 - 09:15:01 UTC