POV-Ray : Newsgroups : povray.general : POV-Ray Includes - Standards : Re: POV-Ray Includes - Standards Server Time
1 Aug 2024 00:23:30 EDT (-0400)
  Re: POV-Ray Includes - Standards  
From: Ben Chambers
Date: 1 Dec 2006 15:13:23
Message: <45708ce3@news.povray.org>
John VanSickle wrote:
> Namespaces are probably the best way.  Ideas:
> 
> * #namespace LABEL creates the namespace LABEL if it doesn't already 
> exist.  Whether new or not, namespace LABEL becomes the active namespace 
> (the former namespace is saved on a stack).
> 
> * #namespace undef pops the current namespace off of the stack, and the 
> former namespace becomes active.

Rather than that, why not just utilize
#namespace
with no arguments, to return to the global namespace?

> * All #declare and #local statements affect the variable in the current 
> namespace.  Other variables of the same name in other namespaces are not 
> affected.
> 
> * #declared variables live from one invocation of the namespace to the 
> next, but #labeled variables die when the namespace passes out of scope 
> (end of macro, end of file, popped by #namepsace undef statement).

You mean #local items, right?

I think namespaces are the perfect way to go, especially as the 
community using POV-Ray matures in their code-writing efforts.

...Chambers


Post a reply to this message

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