Re: Namespaces on definitions

2008-04-16 Thread Yuh-Ruey Chen
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

Re: Namespaces on definitions

2008-04-16 Thread Brendan Eich
On Apr 16, 2008, at 2:50 AM, Yuh-Ruey Chen wrote: 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

Re: Namespaces on definitions

2008-04-16 Thread Jeff Dyer
Here are some other interesting cases involving destructuring patterns. Qualified syntax: var {x = ns::x, y = ns::y, z = ns::z}: {x:A, y:B, z:C } = ... var [ns::x, ns::y, ns::z}: [A, B, C ] = ... Attribute syntax: ns var {x, y, z}: {x:A, y:B, z:C} = ... ns var [x, y, z]: [A, B, C]

Re: Namespaces on definitions

2008-04-16 Thread Waldemar Horwat
There is an old downside to the attribute syntax: You can't put line breaks between the attributes and the definition, even though it's tempting to do so on long lines. Otherwise you silently change the meaning of existing ES3 code like: foo var bar = 3 Waldemar Jeff Dyer wrote: Here

Namespaces on definitions

2008-04-11 Thread Waldemar Horwat
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