POV-Ray : Newsgroups : povray.newusers : Ignorance rules! : Re: Ignorance rules! Server Time
23 Jun 2021 05:29:14 EDT (-0400)
  Re: Ignorance rules!  
From: jr
Date: 23 Jun 2020 04:45:00
Message: <web.5ef1c085ea0d75ea4d00143e0@news.povray.org>
hi,

Cousin Ricky <ric### [at] yahoocom> 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.


Post a reply to this message

Copyright 2003-2021 Persistence of Vision Raytracer Pty. Ltd.