POV-Ray : Newsgroups : povray.beta-test : bug with #declare order : Re: bug with #declare order Server Time
30 Jul 2024 20:24:23 EDT (-0400)
  Re: bug with #declare order  
From: Anders K 
Date: 26 Oct 2001 11:27:40
Message: <3bd980ec@news.povray.org>
> > > #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

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.