guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Macro uexpansion


From: Mikael Djurfeldt
Subject: Re: Macro uexpansion
Date: 20 Dec 2000 07:07:46 +0100
User-agent: Gnus/5.0807 (Gnus v5.8.7) Emacs/20.7

Jim Blandy <address@hidden> writes:

> I have to say:
> 
> a) macros which are powerful enough to run arbitrary code to determine
>    the expansion, and
> 
> b) an evaluation framework which doesn't tell you whether, when, or how often
>    an expansion will happen
> 
> seem fundamentally irreconcileable to me.
> 
> If I cannot control when expansion will happen, then the flexibility
> a) offers is useless, because I can't reliably use it.
> 
> If I can write macros that run arbitrary code at expansion time, then
> it must be apparent when that expansion will happen.

My previous reply to this letter was perhaps not enough to the point.

Apart from syntactic closures, syntax-case is perhaps *the* hygienic
macro system which comes closest to being able to run arbitrary code
in transformers.  Still, the two irreconcileable properties above are
reconciled in this system---and people seem happy about it.

The reason I'm (reasonably) happy about it is that the restrictions
("when" in your b) are naturally introduced.  While you have full
freedom in the language of the transformer, that language doesn't
contain a way to mutate the top-level environment.  And there is no
provision for using external code in macro transformers.

The kinds of things you can do is pretty much narrowed down to
manipulating the syntax you get in.

Another reason I'm happy is that the restrictions remove the problem
of having different semantics during compilation.  I can write my set
of syntactic transformations and I know that they will work equally
well during interpretation, compilation and separate compilation.

I can tell you that I *miss* at least one thing: the ability to share
code between transformers.

> This is exactly the kind of unfortunate coincidence of 'flexibilities'
> that Craig is warning us about; he's telling us that the CL community
> found this to be a serious problem.

It seems like Craig is of the opinion that much of his concerns are
removed by the restrictions of not being able to rely on the "when"
and "where" of transformers.

> Mikael, it sounds like this doesn't bother you, which I consider a
> serious gap between us.  If we don't share some common understanding
> on something so fundamental, I'm not sure we're ready to discuss
> details yet.

Please tell me again (after reading the two responses to your message
+ my two messages titled "Unmemoizing macros") if you understand my
point of view.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]