[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: |
Kon Lovett |
Subject: |
Re: [Chicken-hackers] expand seems not to keep the promise made in the manual |
Date: |
Thu, 23 May 2013 08:22:48 -0700 |
On May 23, 2013, at 3:32 AM, Peter Bex <address@hidden> wrote:
> 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.
>
I wrote expand-full for debugging my macros. That is why it installs a csi
command. I never thought of it as useful in macro writing.
I need to change the documentation to note the limitations so people do not
waste their time.
> 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
>
> _______________________________________________
> Chicken-hackers mailing list
> address@hidden
> https://lists.nongnu.org/mailman/listinfo/chicken-hackers