|
|
The bug that lead to my bug report for v3.1g
22. March 2000 to povray.bugreports with the title:
"Macros and Arrays in POV-Ray v3.1":
news://news.povray.org/38d9867f%40news.povray.org
- is still alive in v3.5.
Here's 3 sample scripts that will force this bug
to surface:
By Nigel Stewart:
#macro Macro1(A)
#local B = A;
B
#end
#macro Macro2(C)
#local D = C;
D
#end
#local Z = Macro1(Macro2(1.0));
By Tor Olav Kristensen:
#macro Dummy(NN)
NN
#end
#declare M1 = array[2] { <1, 2>, <3, 4> }
#declare M3 = array[2]
#declare M3 = Dummy(M1)
By Ron Parker:
#macro Macro2(C)
#local D = C;
D
#end
#local Z =
Macro2(Macro2(Macro2(Macro2(Macro2(Macro2(Macro2(Macro2(5.0))))))));
#debug str(Z,5,5)
#debug "\n"
A workaround for the macro in Ron's sample code is
to add a pair of parentheses around the returned
local variable. (Same solution for Nigel's code.)
Like this:
#macro Macro2(C)
#local D = C;
(D)
#end
For my example there's no known "straight forward"
workaround to make the macro return a local array
variable in a "safe" way.
Tor Olav
Post a reply to this message
|
|