[iterate-devel] Re: Macroexpansion, bindings and information flow (Iterate package)

Hoehle, Joerg-Cyril Joerg-Cyril.Hoehle at t-systems.com
Mon Nov 15 16:09:39 UTC 2004


Andreas Fuchs wrote:
>> I believe in its over 10 years of existence, it's never been able to
>> correctly handle this form:
>>     (macrolet ((over(x) `(collect ,x)))
>>       (iterate
>> 	(for n in '(1 2 3))
>> 	(flet ((over(x)(declare (ignore x)) (collect 2)))
>> 	  (over n)))) ; would yield (2 2 2) if correct
>Actually, the current version of iterate can handle that clause pretty
>well
Did you try it out?

> (since iterate--main--1.0--patch-6, since when we pass the *env*
>argument to macroexpand calls). 
I don't have GnuArch so I don't don't what this version refers to, but my copy of iterate-1.0.9 has *env*, &environment and two-argument calls to macroexpand.

I claim that it does not handle it because Iterate will apply the MACROLET expander to the code, because it ignores the shadowing function definition.
The problem is independent on macrolet. defmacro would yield the same behaviour.

Does your copy of Iterate really return (2 2 2) ?!?

>It seems like most implementations offer code walker support similar
>to ClTl2's. While not ANSI CL, these might be your best bet.

What are your thoughts w.r.t. a release of Iterate which is not portable, but customized to a restricted set of implementations (that we could put our hands on -- I only have CLISP and Corman Lisp here ...)?
-- supposing that all interesting implementations export their code walkers in a useable way.

Regards,
	Jörg Höhle




More information about the iterate-devel mailing list