On 8/25/05, Klaas-Jan Stol <[EMAIL PROTECTED]> wrote: > woops, I used tabs to indent, that gives ugly layout. Here's a NEW > version with spaces. > [snip] > > --- syntax.pod 2005-08-25 16:13:16.000000000 +0200 > +++ syntax_patched.pod 2005-08-25 16:13:59.000000000 +0200 > @@ -176,6 +176,29 @@ > > Define a named constant of style I<type> and value I<const>. > > +=item .namespace <identifier> > + > +Open a new scope block. This "namespace" is not the same as the > +.namespace [ <identifier> ] syntax, which is used for storing subroutines > +in a particular namespace in the global symboltable. > +This directive is useful in cases such as (pseudocode): > + > + local x = 1; > + print(x); # prints 1 > + do # open a new namespace/scope block > + local x = 2; # this x hides the previous x > + print(x); # prints 2 > + end # close the current namespace > + print(x); # prints 1 again > + > +All types of common language constructs such as if, for, while, repeat and > such > +that have nested scopes, can use this directive. > + > +=item .endnamespace <identifier> > + > +Closes the scope block that was opened with .namespace <identifier>. > + > + > =item .namespace [ <identifier> ] > > =item .namespace [ <identifier> ; <identifier> ] > > >
thanks, applied. in the future, please provide diffs relative to the parrot base directory, it makes it easier to find the files to patch. also, this patch brings up an interesting point. .namespace <identifier> means something totally different than .namespace [ <identifier> ] or .namespace [ <identifier>, <identifier> ] this is a Bad Thing. i propose we rename .namespace <identifier> to something more appropriate like .scope <identifier> and change the matching .endnamespace <identifier> to .endscope <identifier> to better describe their function, and to prevent developer confusion. thoughts? ~jerry