[iterate-devel] bug report

Larry D'Anna larry at elder-gods.org
Mon Aug 13 19:44:56 UTC 2007


* Attila Lendvai (attila.lendvai at gmail.com) [070812 15:39]:
> > (defmacro foo ()
> >   ''macro)
> >
> > (iter (for i from 1 to 1)
> >       (labels ((foo ()
> >                  'labels))
> >         (return (foo))))
> >
> > returns MACRO, not LABELS
> 
> this is a limitation of iterate, it's not updating the environment
> while walking its body (in fact it calls macroexpand with nil env, i
> think). this is mostly becase doing so would be platform dependent.

It doesn't need to be able to update the environment because it can see for
itself that foo is a function, not a macro.  This is the case that cannot be 
handled portably:

(defmacro foo ()
  ''macro)

(defmacro bar (form &environment env)
  (macroexpand form env))

(iter (for i from 1 to 1)
      (labels ((foo ()
                 'labels))
        (return (bar (foo)))))



        --larry



More information about the iterate-devel mailing list