scott <sco### [at] scott com> wrote:
> While we're at it this also causes an error (even if the definition for
> A is in a different file):
>
> #macro A()
> #end
> #macro B()
> #local A=1;
> #end
> B()
>
> This one is a bit more serious as it means if any macro in your scene
> uses a local variable with the same name as another macro you'll get an
> error.
This is a known problem, although I do not know that the POV Team perceives it
as a problem. When I brought it up 5 years ago, I was quoted documentation of
macro names being global in scope, which was just a red herring. This behavior
breaks the very concept of local variables and makes "black box" modularization
impossible.
You also get an error if you declare a function with an argument that has the
same name as a previously declared variable.
I hope that these (and ALL other cases of scope leakage in POV-Ray) will be
eliminated by version 4.0.
Post a reply to this message
|