|
 |
Le 2020-06-23 à 04:42, jr a écrit :
> hi,
>
> Cousin Ricky <ric### [at] yahoo com> wrote:
>> Warning: non-newbies will face palm. Three times.
>
> :-)
>
>> ... One just has to keep in mind POV-Ray's scope leakage
>> problems[2] when choosing names:
>> ...
>> - Once *any* identifier is declared, it cannot be reused as a macro
>> name.
>
> maybe I misunderstand. the following works on alpha.10064268.unofficial
>
> -----<snip>-----
> #version 3.8;
>
> global_settings {assumed_gamma 1}
>
> #declare A = 0;
>
> #undef A
>
> #macro A(b_)
> b_
> #end
>
> #declare B = A(1);
>
> #debug concat("B = ",str(B,0,0),"\n")
> -----<snip>-----
>
> (if you remove the '#undef', ie try to create macro with same name while the
> identifier still _is_in_use_, error "expected undeclared identifier" occurs.
> which is as it should be, aiui)
>
> regards, jr.
>
>
Well, that's precisely the purpose of #undef.
After the #undef statement, you are in a state similar to that of that
identifier never having even existed.
Post a reply to this message
|
 |