|
![](/i/fill.gif) |
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
|
![](/i/fill.gif) |