POV-Ray : Newsgroups : povray.binaries.images : Sky simulation : Re: Sky simulation: what is wrong with this particular code? Server Time
30 Jul 2024 08:25:22 EDT (-0400)
  Re: Sky simulation: what is wrong with this particular code?  
From: scott
Date: 10 Jul 2013 12:13:34
Message: <51dd882e$1@news.povray.org>
> This is a known problem, although I do not know that the POV Team perceives it
> as a problem.  When I brought it up 5 years ago, I was quoted documentation of
> macro names being global in scope, which was just a red herring.

The documentation also states that "[#local] temporarily override any 
identifiers with the same name." IMO a bit more clarification should be 
added there, something along the lines of "...unless the identifier name 
is already in use as a macro name, or the #local statement is in a macro 
definition and the identifier name matches one of the macro parameter 
names.".

> This behavior
> breaks the very concept of local variables and makes "black box" modularization
> impossible.

Exactly, in my relatively simple macro which I doubt very many people 
have tried out yet, two people got different namespace clash related 
errors with #local's I'd used inside the macro. In future I'll make sure 
to make all variable names and parameter names unique (by prefixing with 
my name and/or the macro name etc), at which point I might just as well 
use #declare!

I can't believe more people haven't come across this "feature" in the 
last 5 years.


Post a reply to this message

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