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 A { public var

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 this is the

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 that

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

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: Strict mode recap

2008-04-10 Thread Jon Zeppieri
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 ':'. But after reading the object initializer draft, I see that, if the intent of the

RE: Strict mode recap

2008-04-10 Thread Lars Hansen
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jon Zeppieri Sent: 10. april 2008 21:31 To: Lars Hansen Cc: liorean; es4-discuss@mozilla.org Subject: Re: Strict mode recap On 4/10/08, Jon Zeppieri [EMAIL PROTECTED] wrote: var o = { null

Re: Strict mode recap

2008-04-04 Thread Mark Miller
On Thu, Apr 3, 2008 at 8:34 PM, Jon Zeppieri [EMAIL PROTECTED] wrote: ... treats the environment as if it were a datum. I know that in the ES3 spec all bindings are referred to as properties of objects, but activation objects are only notional entities. The current ES4 proposal seems to

RE: Strict mode recap

2008-04-04 Thread Lars Hansen
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jon Zeppieri Sent: 3. april 2008 21:35 To: Lars Hansen Cc: es4-discuss@mozilla.org Subject: Re: Strict mode recap Let me turn it around. The syntax ns::v is in the language, for constant

Re: Strict mode recap

2008-04-04 Thread liorean
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jon Zeppieri Let me turn it around. From my perspective, it isn't an E4X vs. ES4 distinction; it's a looking up a property of a first-class object vs. using a local variable (or, if you prefer, looking up a

RE: Strict mode recap

2008-04-04 Thread Lars Hansen
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of liorean Sent: 4. april 2008 10:47 To: es4-discuss@mozilla.org Subject: Re: Strict mode recap On 04/04/2008, Lars Hansen [EMAIL PROTECTED] wrote: Your comment about inhibiting static analysis

Re: Strict mode recap

2008-04-04 Thread Jon Zeppieri
On Fri, Apr 4, 2008 at 11:30 AM, Lars Hansen [EMAIL PROTECTED] wrote: I don't get it. Your comment about inhibiting static analysis isn't right; if ns::x is a name then either ns is known to be constant at compile time or not, and if it is, then nothing prevents early binding. ES3

RE: Strict mode recap

2008-04-04 Thread Lars Hansen
-Original Message- From: Jon Zeppieri [mailto:[EMAIL PROTECTED] Sent: 4. april 2008 11:02 To: Lars Hansen Cc: liorean; es4-discuss@mozilla.org Subject: Re: Strict mode recap On Fri, Apr 4, 2008 at 12:57 PM, Lars Hansen [EMAIL PROTECTED] wrote: (BTW I believe that locally

Re: Strict mode recap

2008-04-04 Thread Jon Zeppieri
On Fri, Apr 4, 2008 at 1:25 PM, Lars Hansen [EMAIL PROTECTED] wrote: I hope the forthcoming spec on names will clarify this, so I suggest we hold off arguing about this particular point for the moment. Happily. You can argue, and I think you are arguing, that there is no utility in

RE: Strict mode recap

2008-04-04 Thread Lars Hansen
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jon Zeppieri Sent: 4. april 2008 11:38 To: Lars Hansen Cc: liorean; es4-discuss@mozilla.org Subject: Re: Strict mode recap I disagree, based on my experience analyzing uses of eval in scripts

Re: Strict mode recap

2008-04-04 Thread Jon Zeppieri
On Fri, Apr 4, 2008 at 1:45 PM, Lars Hansen [EMAIL PROTECTED] wrote: That could be true. But it could also be the case that people find that it is easier to say var x = ... var y = ... var n = x // but could be y ... // n may change here by assigning another string to it

Re: Strict mode recap

2008-04-04 Thread Mark Miller
On Fri, Apr 4, 2008 at 11:24 AM, Jon Zeppieri [EMAIL PROTECTED] wrote: (and the latter does not handle shadowing, for better or worse). Heh. Someone should revive Mark Miller. [startles] What? I'm awake. Can someone summarize the issue in a self-contained manner? -- Text by me above is

Re: Strict mode recap

2008-04-04 Thread Jon Zeppieri
On Fri, Apr 4, 2008 at 2:42 PM, Mark Miller [EMAIL PROTECTED] wrote: On Fri, Apr 4, 2008 at 11:24 AM, Jon Zeppieri [EMAIL PROTECTED] wrote: (and the latter does not handle shadowing, for better or worse). Heh. Someone should revive Mark Miller. [startles] What? I'm awake. Can

Re: Strict mode recap

2008-04-03 Thread Jon Zeppieri
On Wed, Apr 2, 2008 at 11:15 PM, Lars Hansen [EMAIL PROTECTED] wrote: Is this already in AS3? If so, is it often used? The syntax comes from E4X, which is incorporated into AS3 and Spidermonkey. Try this in Firefox: script type=text/javascript;e4x=1 var x = ns:p

RE: Strict mode recap

2008-04-03 Thread Lars Hansen
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jon Zeppieri Sent: 3. april 2008 10:10 To: Lars Hansen Cc: es4-discuss@mozilla.org Subject: Re: Strict mode recap On Wed, Apr 2, 2008 at 11:15 PM, Lars Hansen [EMAIL PROTECTED] wrote

Re: Strict mode recap

2008-04-03 Thread Jon Zeppieri
On 4/3/08, Lars Hansen [EMAIL PROTECTED] wrote: package X { namespace myns; class C { myns var v = 37; } var x = myns; var y = v; print((new C).x::[y]); } This does print '37' if compiled with ASC and run through the Tamarin VM. This is like

Re: Strict mode recap

2008-04-03 Thread liorean
On 04/04/2008, Jon Zeppieri [EMAIL PROTECTED] wrote: This is like the E4X example in one crucial respect: in both cases, you're accessing a property of a first-class object. I'm not arguing against this use of computed names. I don't see any significant difference between the above and:

Re: Strict mode recap

2008-04-03 Thread Jon Zeppieri
On 4/3/08, liorean [EMAIL PROTECTED] wrote: On 04/04/2008, Jon Zeppieri [EMAIL PROTECTED] wrote: function foo(name) { ... return null::[name]; } ... treats the environment as if it were a datum. I know that in the ES3 spec all bindings are referred to as

Re: Strict mode recap

2008-04-03 Thread Jon Zeppieri
On 4/4/08, Jon Zeppieri [EMAIL PROTECTED] wrote: eval has a real use: runtime code generation. (This does not require dynamically scoped eval, but that's beside the point here.) Uh, I meant lexically scoped eval, of course... ___ Es4-discuss

RE: Strict mode recap

2008-04-02 Thread Lars Hansen
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Lars Hansen Sent: 31. mars 2008 20:09 To: Waldemar Horwat; es4-discuss@mozilla.org Subject: RE: Strict mode recap -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED

Re: Strict mode recap

2008-04-02 Thread Jon Zeppieri
On 3/31/08, Lars Hansen [EMAIL PROTECTED] wrote: Having thought more about this, we may get away with less draconian measures for lexically scoped eval -- it's enough to simply decree that eval may not add bindings to the caller's binding object in strict mode (a simple run-time check,

RE: Strict mode recap

2008-04-02 Thread Lars Hansen
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jon Zeppieri Sent: 2. april 2008 17:51 To: Lars Hansen Cc: Waldemar Horwat; es4-discuss@mozilla.org Subject: Re: Strict mode recap On 3/31/08, Lars Hansen [EMAIL PROTECTED] wrote: Having

Re: Strict mode recap

2008-04-02 Thread Jon Zeppieri
On 4/2/08, Lars Hansen [EMAIL PROTECTED] wrote: Lars, does this mean that expr::[expr] can't introduce lexical bindings? Or: in strict mode, it can't, but in standard it can? It can't introduce bindings; it's just a name. I meant something like: var foo::[bar] = baz; My

RE: Strict mode recap

2008-04-02 Thread Lars Hansen
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jon Zeppieri Sent: 2. april 2008 19:06 To: Lars Hansen Cc: es4-discuss@mozilla.org Subject: Re: Strict mode recap On 4/2/08, Lars Hansen [EMAIL PROTECTED] wrote: Lars, does this mean

Re: Strict mode recap

2008-04-02 Thread Jon Zeppieri
On 4/2/08, Lars Hansen [EMAIL PROTECTED] wrote: I meant something like: var foo::[bar] = baz; My objection to expr::[expr] in earlier messages was based on the assumption that these computed names could be used on the left-hand side of an assignment expression -- which, I'm

Re: Strict mode recap

2008-04-01 Thread Waldemar Horwat
Mark Miller wrote: - Disable FunctionObject.arguments (not actually in ES3 but woefully used in practice) This is an interesting one, since disallowing it would mean that the ES3.1 and ES4 specs would have to re-allow it so that they could explicitly disallow it :) Yes. It's also

RE: Strict mode recap

2008-04-01 Thread Lars Hansen
-Original Message- From: Mark Miller [mailto:[EMAIL PROTECTED] Sent: 31. mars 2008 21:36 To: Lars Hansen Cc: Waldemar Horwat; es4-discuss@mozilla.org Subject: Re: Strict mode recap - Disable FunctionObject.arguments (not actually in ES3 but woefully used in practice

Re: Strict mode recap

2008-04-01 Thread Brendan Eich
On Apr 1, 2008, at 12:22 PM, Lars Hansen wrote: Strangely, built-in functions were exempt from the mechanism (ch 15 intro); I don't know if that's a pragmatic issue (implementation reasons) or a security issue. I don't recall, but it doesn't matter for natives, AFAICT. The mechanism is not

Re: Strict mode recap

2008-03-31 Thread Erik Arvidsson
- Disable FunctionObject.arguments (not actually in ES3 but woefully used in practice) This is an interesting one, since disallowing it would mean that the ES3.1 and ES4 specs would have to re-allow it so that they could explicitly disallow it :) Yes. It's also an interesting