chicken-hackers
[Top][All Lists]
Advanced

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

Re: [Chicken-hackers] expand seems not to keep the promise made in the m


From: Peter Bex
Subject: Re: [Chicken-hackers] expand seems not to keep the promise made in the manual
Date: Thu, 23 May 2013 12:32:31 +0200
User-agent: Mutt/1.4.2.3i

On Thu, May 23, 2013 at 11:59:44AM +0200, Christian Kellermann wrote:
> Hi Joerg!
> 
> * Jörg F. Wittenberger <address@hidden> [130523 11:51]:
> > Citing the manual
> > 
> > ><procedure>(expand X)</procedure>
> > 
> > >If {{X}} is a macro-form, expand the macro (and repeat expansion
> > >until expression is a non-macro form).  Returns the resulting expression.
> 
> I think this is just wrong in the documentation. What you probably
> want is expand* from the expand-full egg.

Indeed.  However, it has to be noted that this egg is fundamentally
broken: it has no access to the syntactic environment, so it can never
do a proper job.  A trivial example of this kind of breakage follows:

(let-syntax ((foo (syntax-rules () ((_ x) x)))) (expand* '(foo 1))) =>
(foo 1)

Hairier macros which contain renamed identifiers will also break.
Actually, I've never found any use for expand-full except the most
trivial of macros (the kind where you don't tend to need expand in
the first place).

I don't think this is fixable, but I'd love to be proven wrong.

Cheers,
Peter
-- 
http://www.more-magic.net



reply via email to

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