scott <sco### [at] scottcom> wrote:
> > #macro Next()
> > #declare I=I+1;
> > #end
> >
> > #declare I=0;
> > #while (I < Limit)
> > Next()
> > #end
> >
> > No mention of I anywhere in the loop, yet perfectly finite.
> >
> > You *must* dig into *every* macro to catch this.
> The parser re-parses the macro every time it is called though, doesn't it?
> So the parser simply needs to look out for any "#declare I" any time it is
> parsing commands within the loop, no matter if it is in a macro or not.
It doesn't necessarily parse it every time. You could have something like:
#declare I=0;
#while (I < Limit)
#if(rand(someSeed) < 0.5)
Next()
#end
#end
--
- Warp
Post a reply to this message
|