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 for

RE: Strict mode recap

2008-04-11 Thread Lars Hansen
> -Original Message- > From: Brendan Eich [mailto:[EMAIL PROTECTED] > > > I think you're trying to say something else too but I can't figure > > out what it is, something about the ns in ns::id being a literal in > > a stronger sense than what I just outlined? > > Let me try to be clea

Re: Strict mode recap

2008-04-11 Thread Brendan Eich
On Apr 11, 2008, at 12:51 PM, Lars Hansen wrote: > There might be a slight misunderstanding here. In my example, the > name C.ns is constant, not a general expression; C needs to be a > class, and ns needs to be a static namespace definition inside that > class (suitably available). Oh, ok.

Re: ES4 draft: assert expression

2008-04-11 Thread T. Michael Keesey
On Fri, Apr 11, 2008 at 12:48 PM, Lars Hansen <[EMAIL PROTECTED]> wrote: > Ah! Of course. > > The natural thing to spec would be that the text of the expression > would be part of (all of?) the "message" of the exception object > in the 1-arg case. Or would it be better for AssertionError to h

RE: Strict mode recap

2008-04-11 Thread Lars Hansen
There might be a slight misunderstanding here. In my example, the name C.ns is constant, not a general expression; C needs to be a class, and ns needs to be a static namespace definition inside that class (suitably available). In my (repentant) opinion the ns in _any_ ns::id expression must refe

RE: ES4 draft: assert expression

2008-04-11 Thread Lars Hansen
Ah! Of course. The natural thing to spec would be that the text of the expression would be part of (all of?) the "message" of the exception object in the 1-arg case. --lars > -Original Message- > From: P T Withington [mailto:[EMAIL PROTECTED] On Behalf Of > P T Withington > Sent: 11. a

Re: ES4 draft: assert expression

2008-04-11 Thread P T Withington
Is there any way the value thrown in the 1-arg case could be the 'text' of arg1? It's so painful to get an assertion and not know what it is... On 2008-04-11, at 13:16 EDT, Lars Hansen wrote: > We talked about debugging information and an assertion form on > es4-discuss a while ago, in a thre

Re: Strict mode recap

2008-04-11 Thread Brendan Eich
On Apr 11, 2008, at 10:22 AM, Lars Hansen wrote: (It _is_ an indication that the syntax used in the object initializers is not fully general, though, since it only allows simple identifiers in the namespace position. Sigh.) I've argued that JS's literal property identifiers in object initia

RE: Strict mode recap

2008-04-11 Thread Lars Hansen
> -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On > Behalf Of Jon Zeppieri > Sent: 11. april 2008 11:10 > To: Lars Hansen > Cc: es4-discuss@mozilla.org; liorean > Subject: Re: Strict mode recap > > On Fri, Apr 11, 2008 at 1:05 PM, Jon Zeppieri <[EMAIL PROTECTED]>

ES4 draft: assert expression

2008-04-11 Thread Lars Hansen
We talked about debugging information and an assertion form on es4-discuss a while ago, in a thread about the Error object. As a result of that discussion, I'm sending out a draft for an "assert" expression form. In addition, the Error object draft will be updated to accomodate a new subclass Ass

Re: Strict mode recap

2008-04-11 Thread Jon Zeppieri
On Fri, Apr 11, 2008 at 1:05 PM, Jon Zeppieri <[EMAIL PROTECTED]> wrote: > > Yep, I agree with this, too. I certainly wouldn't want to mandate > > var public::x > > in classes and wouldn't really want to write it myself. But there's > some value in having a single, canonical syntactic form

Re: Strict mode recap

2008-04-11 Thread Jon Zeppieri
On Fri, Apr 11, 2008 at 12:17 PM, Lars Hansen <[EMAIL PROTECTED]> wrote: > > > One motivation is that programmers are likely to prefer the Java-like > syntax where the namespace (in its role as access control) shows > up early: > > public var count = > private var key = > > I really think t

RE: Strict mode recap

2008-04-11 Thread Lars Hansen
> -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On > Behalf Of Jon Zeppieri > Sent: 11. april 2008 09:50 > > ... > The question is: why not apply it to classes, too? > > By the way, I was wrong about the grammar allowing > > var public::count = ... > > in

Re: Strict mode recap

2008-04-11 Thread Jon Zeppieri
On Fri, Apr 11, 2008 at 11:42 AM, Lars Hansen <[EMAIL PROTECTED]> wrote: > > -Original Message- > > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On > > Behalf Of Jon Zeppieri > > > Sent: 11. april 2008 09:26 > > To: Lars Hansen > > > Cc: es4-discuss@mozilla.org; liorean > > Subject

RE: Strict mode recap

2008-04-11 Thread Lars Hansen
> -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On > Behalf Of Jon Zeppieri > Sent: 11. april 2008 09:26 > To: Lars Hansen > Cc: es4-discuss@mozilla.org; liorean > Subject: Re: Strict mode recap > > On Fri, Apr 11, 2008 at 11:04 AM, Lars Hansen > <[EMAIL PROTECTE

Re: Strict mode recap

2008-04-11 Thread Jon Zeppieri
On Fri, Apr 11, 2008 at 11:04 AM, Lars Hansen <[EMAIL PROTECTED]> wrote: > > > Right, I get that, and Brendan's point was a good one. I was > > just thrown by the fact that I hadn't seen an example of > > > > class A { > > var public::count = 10; > > } > > > > rather than > > > > class

RE: Strict mode recap

2008-04-11 Thread Lars Hansen
> -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On > Behalf Of Jon Zeppieri > Sent: 11. april 2008 05:20 > To: Lars Hansen > Cc: liorean; es4-discuss@mozilla.org > Subject: Re: Strict mode recap > > > Apart from that there's no problem. "var" is used to indicate

Re: Strict mode recap

2008-04-11 Thread Jon Zeppieri
On 4/11/08, Lars Hansen <[EMAIL PROTECTED]> wrote: > > > On 4/10/08, Jon Zeppieri <[EMAIL PROTECTED]> wrote: > > > > > > var o = { null var count = 100, ... }; > > > > Sorry: two syntactic mistakes, here, one of which is interesting. > > The boring one is my use of '=' rather than ':'. >