[iterate-devel] Bug in "the type" expansion?

rif rif at MIT.EDU
Sun Oct 31 00:50:10 UTC 2004


> On 2004-10-30, <rif at mit.edu> wrote:
> > According to page 20 of the September 2004 version of the manual, I
> > would expect
> >
> > (iter (for (the fixnum n) in '(3 5 7 8 9)) (counting (oddp n)))
> >
> > to expand into a form in which n was declared/guaranteed fixnum.  It
> > does not.  It binds n to nil initially, and (therefore?) omits the
> > declaration.
> 
> Wow. You just sent me hunting for a bug that isn't. The behavior is
> explained on page 21 of the same iterate manual - I turned the page
> after lots of head scratching. Oh well, at least I know how iterate
> treats variables now (-:
> 
> The first paragraph on page 21 says you should use
>     (declare (iterate:declare-variables))
> somewhere in the top level of the iterate form to make it declare
> variables used in THE forms. If you want all your iterate forms to
> behave in this way, frob the variable
> iterate::*always-declare-variables* at compile time.
> 
> It might make sense to give the variable a useful binding, though.
> Sufficiently Smart Compilers might be grateful for that. I think I'll
> try and cook up a fix for this.
> 
> Cheers,
> -- 
> Andreas Fuchs, <asf at boinkor.net>, asf at jabber.at, antifuchs

Ah, my mistake.  Fair enough.

rif




More information about the iterate-devel mailing list