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".
Post a reply to this message