|
![](/i/fill.gif) |
Say I have a macro that returns values:
#macro someMacroReturningAValue(params)
#local _RESULT = foo;
// do stuff here...
_RESULT
#end
I can use this macro in a computation, thusly:
object { bar translate someMacroReturningAValue(params)*x }
but I cannot set the macro as the rValue of a declaration, like so:
#declare blah = someMacroReturningAValue(params);
because povray doesn't see the semicolon at the end of the declaration. I can
add the semicolon inside the macro, and the declaration works, but the first
usage breaks.
in order to make the declaration work without breaking the first usage, I have
to encapsulate the macro call in parentheses:
#declare blah = (someMacroReturningAValue(params));
Which, obviously, forces the macro to be evaluated first, but I have no idea why
it makes a difference, and it makes for a very confusing error.
Any explanations?
Regards,
A.D.B.
Post a reply to this message
|
![](/i/fill.gif) |