POV-Ray : Newsgroups : povray.beta-test : bug with #declare order : Re: bug with #declare order Server Time
2 Nov 2024 15:25:41 EDT (-0400)
  Re: bug with #declare order  
From: Thorsten Froehlich
Date: 26 Oct 2001 06:20:39
Message: <3bd938f7@news.povray.org>

Skiba <abx### [at] babilonorg>  wrote:

> I hope it is not a limitation like #if inside #if
>
> two-line script
>   #declare A#declare A=0;=1;
>   #warning str(A,0,0)
> prints 1 and I expected it
> but script
>   #declare A=#declare A=0;1;
>   #warning str(A,0,0)
> prints 0 but I expected 1
> but what is most strange when I joined both
>   #declare A#declare A=0;=1;
>   #warning str(A,0,0)
>   #declare A=#declare A=0;1;
>   #warning str(A,0,0)
> it twice prints 1
> but when I changed it to (replaced second A with B)
>   #declare A#declare A=0;=1;
>   #warning str(A,0,0)
>   #declare B=#declare B=0;1;
>   #warning str(B,0,0)
> it prints 0 and 1

While I agree that the behavior is confusing, for versions up to and
including 3.5 and any 3.x version or bug fix release that may follow, assume
the behavior of nesting directives inside other directives is not specified.

So the answer is: Don't use it (also the parser allows it) because the
behavior is unlikely to be made consistent before a rewrite of POV-Ray.

    Thorsten

____________________________________________________
Thorsten Froehlich, Duisburg, Germany
e-mail: tho### [at] trfde

Visit POV-Ray on the web: http://mac.povray.org


Post a reply to this message

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