POV-Ray : Newsgroups : povray.general : Scope of identifiers in nested Macros : Scope of identifiers in nested Macros Server Time
2 Nov 2024 17:20:14 EDT (-0400)
  Scope of identifiers in nested Macros  
From: Florian Brucker
Date: 1 Jan 2004 15:08:46
Message: <3ff47e4e@news.povray.org>
When rendering the following code:

<POV>
#macro M1(Param)
     #local Param = Param - 1;
     #debug concat("Param = ",str(Param,0,0),"\n")
#end

#macro M2(Param)
     #local a = 0;
     #while (a<10)
          M1(Param)
         #local a = a + 1;
     #end
#end

M2(100)
</POV>

I would expect the line "Param = 99" being printed 10 times. Instead, 
the output is

<Output>
Param = 99
Param = 98
Param = 97
Param = 96
Param = 95
Param = 94
Param = 93
Param = 92
Param = 91
Param = 90
</Output>

I think this does not match the behaviour described in the documentation 
in section "6.2.2.3 Identifier Name Collisions".


Any Comments?

Happy new year everybody
Florian


Post a reply to this message

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