Re: New private names proposal

2010-12-16 Thread Kris Zyp
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 This sounds great, but doesn't this kind of violate referential transparency? The following function has always worked as expected: function foo(){ var obj = {bar:hello}; // assuming quoting names are strings alert(obj.bar); } foo(); until is

Re: New private names proposal

2010-12-16 Thread David Herman
This sounds great, but doesn't this kind of violate referential transparency? That's a loaded criticism. JS doesn't have referential transparency in any meaningful sense. But it does generalize the meaning of the dot-operator to be sensitive to scoping operators, that's true. Couldn't the

Re: New private names proposal

2010-12-16 Thread Kris Kowal
On Thu, Dec 16, 2010 at 1:53 PM, David Herman dher...@mozilla.com wrote:    function Point(x, y) {        private x, y;        this.x = x;        this.y = y;        ...    } than    function Point(x, y) {        var _x = gensym(), _y = gensym();        this[_x] = x;        this[_y] =

Re: New private names proposal

2010-12-16 Thread Mark S. Miller
On Thu, Dec 16, 2010 at 1:58 PM, Kris Kowal kris.ko...@cixar.com wrote: On Thu, Dec 16, 2010 at 1:53 PM, David Herman dher...@mozilla.com wrote: function Point(x, y) { private x, y; this.x = x; this.y = y; ... } than function Point(x, y)

RE: New private names proposal

2010-12-16 Thread Chuck Jazdzewski
Ø Currently is JS, x['foo'] and x.foo are precisely identical in all contexts. This is true when the string contains a is a legal identifier and false otherwise. The [] syntax is a superset of the '.' syntax. The proposal preserves this through the use of # expression, e.g.,

Re: New private names proposal

2010-12-16 Thread Brendan Eich
On Dec 16, 2010, at 2:19 PM, Mark S. Miller wrote: Currently is JS, x['foo'] and x.foo are precisely identical in all contexts. This regularity helps understandability. The terseness difference above is not an adequate reason to sacrifice it. Aren't you proposing the same syntax x[i] where

Re: New private names proposal

2010-12-16 Thread Mark S. Miller
On Thu, Dec 16, 2010 at 3:23 PM, Brendan Eich bren...@mozilla.com wrote: On Dec 16, 2010, at 2:19 PM, Mark S. Miller wrote: Currently is JS, x['foo'] and x.foo are precisely identical in all contexts. This regularity helps understandability. The terseness difference above is not an adequate

Re: New private names proposal

2010-12-16 Thread David Herman
Without new syntax, isn't soft fields just a library on top of weak maps? Dave On Dec 16, 2010, at 3:47 PM, Mark S. Miller wrote: On Thu, Dec 16, 2010 at 3:23 PM, Brendan Eich bren...@mozilla.com wrote: On Dec 16, 2010, at 2:19 PM, Mark S. Miller wrote: Currently is JS, x['foo'] and

Re: New private names proposal

2010-12-16 Thread Mark S. Miller
On Thu, Dec 16, 2010 at 3:51 PM, David Herman dher...@mozilla.com wrote: Without new syntax, isn't soft fields just a library on top of weak maps? Semantically, yes. However, as a library, they cannot benefit from the extraordinary efforts of all JavaScript engines to optimize inherited

Soft Fields are now ready for discussion

2010-12-16 Thread Mark S. Miller
http://wiki.ecmascript.org/doku.php?id=strawman:inherited_explicit_soft_fields http://wiki.ecmascript.org/doku.php?id=strawman:names_vs_soft_fields -- Cheers, --MarkM ___ es-discuss mailing list es-discuss@mozilla.org

Re: New private names proposal

2010-12-16 Thread Mark S. Miller
On Thu, Dec 16, 2010 at 3:23 PM, Brendan Eich bren...@mozilla.com wrote: On Dec 16, 2010, at 2:19 PM, Mark S. Miller wrote: Currently is JS, x['foo'] and x.foo are precisely identical in all contexts. This regularity helps understandability. The terseness difference above is not an adequate

Re: New private names proposal

2010-12-16 Thread Brendan Eich
On Dec 16, 2010, at 3:57 PM, Mark S. Miller wrote: On Thu, Dec 16, 2010 at 3:51 PM, David Herman dher...@mozilla.com wrote: Without new syntax, isn't soft fields just a library on top of weak maps? Semantically, yes. However, as a library, they cannot benefit from the extraordinary efforts

Re: New private names proposal

2010-12-16 Thread Mark S. Miller
On Thu, Dec 16, 2010 at 4:27 PM, Brendan Eich bren...@mozilla.com wrote: On Dec 16, 2010, at 3:57 PM, Mark S. Miller wrote: On Thu, Dec 16, 2010 at 3:51 PM, David Herman dher...@mozilla.com wrote: Without new syntax, isn't soft fields just a library on top of weak maps? Semantically, yes.

Re: New private names proposal

2010-12-16 Thread Brendan Eich
On Dec 16, 2010, at 4:44 PM, Mark S. Miller wrote: This does *not* mean soft fields and private names are mutually exclusive and locked in some there can be only one! Highlander contest. I'll address this last point first, since this seems to be the core issue. The question I am raising

Re: New private names proposal

2010-12-16 Thread Mark S. Miller
At this point, I'll just mention that this response seems overly emotional, filled with name calling, and seemingly disconnected from the case I'm actually making. (For example, I never said that soft fields would be more or as efficient as names. Merely that, if primitive, they could benefit from

Re: New private names proposal

2010-12-16 Thread David Herman
I'll address this last point first, since this seems to be the core issue. The question I am raising is: given soft fields, why do we need private names? I didn't see that asked as a question; I saw it asserted, but not opened for discussion. And I disagree. Now, I happen to think it's not

Re: New private names proposal

2010-12-16 Thread Brendan Eich
On Dec 16, 2010, at 5:01 PM, Mark S. Miller wrote: At this point, I'll just mention that this response seems overly emotional, On the contrary. filled with name calling, No. Calling a specification obscure and tortured is not name-calling in any personal sense. However, if you think I've

Re: New private names proposal

2010-12-16 Thread Mark S. Miller
On Thu, Dec 16, 2010 at 5:03 PM, David Herman dher...@mozilla.com wrote: I'll address this last point first, since this seems to be the core issue. The question I am raising is: given soft fields, why do we need private names? I didn't see that asked as a question; I saw it asserted, but

Re: Re: New private names proposal

2010-12-16 Thread Douglas Crockford
On 11:59 AM, Brendan Eich wrote: Really, it's starting to feel like Survivor or American Idol around here. The apples to oranges death-matching has to stop. I don't mind a good deathmatch as long as it ends in death. We will soon be at the point where we need to start culling the strawmen so

Re: New private names proposal

2010-12-16 Thread Mark S. Miller
On Thu, Dec 16, 2010 at 5:24 PM, David Herman dher...@mozilla.com wrote: Ok, I open it for discussion. Given soft fields, why do we need private names? I believe that the syntax is a big part of the private names proposal. It's key to the usability: in my view, the proposal adds 1) a new

Re: New private names proposal

2010-12-16 Thread David-Sarah Hopwood
On 2010-12-17 01:24, David Herman wrote: Mark Miller wrote: Ok, I open it for discussion. Given soft fields, why do we need private names? I believe that the syntax is a big part of the private names proposal. It's key to the usability: in my view, the proposal adds 1) a new abstraction to

Re: New private names proposal

2010-12-16 Thread Brendan Eich
On Dec 16, 2010, at 9:11 PM, David-Sarah Hopwood wrote: On 2010-12-17 01:24, David Herman wrote: Mark Miller wrote: Ok, I open it for discussion. Given soft fields, why do we need private names? I believe that the syntax is a big part of the private names proposal. It's key to the

Re: Re: New private names proposal

2010-12-16 Thread Erik Corry
On Dec 17, 2010 2:14 AM, Douglas Crockford doug...@crockford.com wrote: On 11:59 AM, Brendan Eich wrote: Really, it's starting to feel like Survivor or American Idol around here. The apples to oranges death-matching has to stop. I don't mind a good deathmatch as long as it ends in death.