|
|
JS <no### [at] spammersallowed> wrote:
> BTW. I got a very nasty surprise, trying to use my planet generator macro
> to produce the ball. The macro defines a function, which takes parameter
> called "x1", but this causes Povray to complain, since the context in
> which the macro is included has a local variable x1. Is there any way
> around this (no, renaming the parameter or variable is not an option,
> since there would be a new conflict sooner or later) and should this be
> reported as a bug ?
>
> The bug comes out in situations like this:
>
> #macro planet(rseed, atmo, clouds, lights, dayvector)
> #local vangle = function(x1,y1,z1,x2,y2,z2) { <-- Povray exits with error}
> #end
>
> #declare temple = union {
> #local x1 = 0;
> #include planet(4,0,1,1,<0,10,0>)
> }
I don't see it so much as a bug as one of POV-Ray's parsing quirks. The way
i deal with it is to prefix all my function arguments with P0_, P1_, P2_,
etc, with the understanding that names of this format shall be reserved to
function arguments. Thus, your function declaration would be something
like:
#local vangle = function (P0_x1, P1_y1, P2_z1, P3_x2, P4_y2, P5_z2) { ... }
Names of this format would not be used in any other contexts.
Should you report it as a bug? I myself have grudgingly filed this one
under http://www.povray.org/documentation/view/3.6.1/713/, "I don't like
the way this works so it must be a bug." You might want to consider it as a
feature request.
Post a reply to this message
|
|