|
![](/i/fill.gif) |
> > > #macro Go(Level)
> > > #debug "1\n"
> > > #switch (Level>0?Go(Level-1):0)
> > > #case(0) 1 #break
> > > #end
> > > #end
> >
> > The problem here is that Go(Level - 1) is *always* evaluated, whether
Level
> > 0 or not, because POV-Ray doesn't use short-circuit evaluation.
>
> yes, right, I missed this.
> but how it should looks with #if ?
> it seems not work too.
Well, there's also another problem: if the result of the #switch statement
isn't 0, the macro doesn't return anything, which causes errors. I'm not
sure what you meant to write, but this is definately not a bug in POV-Ray.
Anders
Post a reply to this message
|
![](/i/fill.gif) |