Namespaces on definitions

Yuh-Ruey Chen maian330 at
Tue Apr 15 23:50:49 PDT 2008

I agree. I don't see why there should be multiple syntaxes that are as 
concise as each other and both have about equal precedent (AS3 vs. E4X). 
If in some futuer spec, properties can inhabit multiple namespaces, then 
we can consider the |ns1 ns2 ... var foo| syntax again.


Waldemar Horwat wrote:
> My views on this are:
> - There should be only *one* syntax for specifying namespaces in definitions.  It shouldn't be
>   ns::foo = xyz
> in one place (object initializers) and
>   ns var foo = xyz
> someplace else (variable definitions).
> - The historical reason I chose the syntax
>   ns var foo = xyz
> for ES4 was that I allowed the same definition to simultaneously go into several namespaces:
>   ns1 ns2 ns3 var foo = xyz
> would create ns1::foo, ns2::foo, and ns3::foo, which would be aliases of the same variable (not three different variables).  ES4 doesn't support that any more, so this reason goes away and the issue can be reconsidered.
> Now that the issue has been brought up, I'm warming up to the syntax 
>   var ns::foo = xyz
> everywhere.  It's simpler to remember.  It doesn't match Java, but if that were a goal then we should first change our type annotation syntax to that of C++ and Java.
>     Waldemar

More information about the Es4-discuss mailing list