Attila Lendvai wrote:
>(in fact it calls macroexpand with nil env, i think).
No, it doesn't.
>this won't be quickly fixed, but corrent me if i'm wrong.
No macro should call macroexpand with the nil env.  That's completely wrong, in 
most cases.  Iterate properly uses the env parameter.  The env parameter is 
there for a purpose.

It's there so that the surrounding environment can be handled correctly, e.g. 
Iterate knows that in
(defun or defmacro foo ...)
(macrolet foo ... (flet foo ... (Iterate ...)))
foo is a function, not a macro.

What Iterate (and many others) cannot handle properly is local definitions 
within its body, e.g.
(Iterate (macrolet (flet ...)))
It serves nothing if Iterate would keep an internal list of local functions or 
macros, as it cannot communicate this list (i.e. environment) to other macros.  
That's why CLtL2 had AUGMENT-ENVIRONMENT.
Alas, why CLtL2's environment API is not good enough is really complicated.
BTW, *MACROEXPAND-HOOK* is of no help either.

Regards,
        Jörg.
_______________________________________________
iterate-devel site list
iterate-devel@common-lisp.net
http://common-lisp.net/mailman/listinfo/iterate-devel

Reply via email to