POV-Ray : Newsgroups : povray.general : POV-Ray Includes - Standards : Re: POV-Ray Includes - Standards Server Time
1 Aug 2024 02:19:23 EDT (-0400)
  Re: POV-Ray Includes - Standards  
From: Chris Cason
Date: 3 Dec 2006 13:16:32
Message: <45731480$1@news.povray.org>
John VanSickle wrote:
> * #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.
> 
> * All #declare and #local statements affect the variable in the current 
> namespace.  Other variables of the same name in other namespaces are not 
> affected.

my personal opinion is that namespaces should have block scope (so are
delimited by a specific start and end, either with braces or a # declaration
of some sort). preferably with braces.

also namespaces must be properly nested within a source file; if you open a
namespace in a file, it must be closed before EOF in that file. otherwise you
run the risk of loading a include file and finding the current namespace has
changed afterwards.

finally, if we're going to change the way macros work with respect to scope,
we're better off changing them entirely (otherwise we run into compatibility
issues) and coming up with a new name for them (i.e. not #macro).

-- Chris


Post a reply to this message

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