POV-Ray : Newsgroups : povray.newusers : Ignorance rules! : Re: Ignorance rules! Server Time
24 Jun 2021 15:17:36 EDT (-0400)
  Re: Ignorance rules!  
From: jr
Date: 23 Jun 2020 13:50:01
Message: <web.5ef23f74ea0d75ea4d00143e0@news.povray.org>

Cousin Ricky <ric### [at] yahoocom> wrote:
> On 2020-06-23 4:42 AM (-4), jr wrote:
> > Cousin Ricky <ric### [at] yahoocom> wrote:
> >> ...
> > maybe I misunderstand.  ...
> Of course you can reuse any identifier after you undefine it.  But why
> should you have to go through such nonsense?
> > (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)
> No. It. Shouldn't.

hm, we all see things differently.  fwiw, the fact that POV-Ray is .. lax enough
to allow me to do:

#declare A = "foo";
#declare A = <1,2,3>;
#declare A = 0;

without complaint, makes me unhappy.  I'd much prefer "stronger" typing.

> What if the macro was defined in an include file written by someone
> else? If the user declares A, they obviously have no need for macro A,
> so why should they have to worry about whether a macro by that name
> already exists?

for the same reason one would be careful when including some library header in a
C translation unit?  given the absence of namespaces (as you note else-thread),
there's only careful design and documentation of .inc file, to alleviate the

need to think, and perhaps experiment, re "scope leakage".

regards, jr.

Post a reply to this message

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