Re: Thoughts on WeakMaps

2011-06-06 Thread Mark S. Miller
On Mon, Jun 6, 2011 at 2:46 PM, David Bruant wrote: > Le 06/06/2011 17:41, Mike Samuel a écrit : > > 2011/6/6 David Bruant : > >> The consequence of this second point is wondering whether it's a good > idea > >> to standardize WeakMap (instead of Map) at all. > > Besides a lack of out-of-memory e

Re: Thoughts on WeakMaps

2011-06-06 Thread Mike Samuel
2011/6/6 David Bruant : > Le 06/06/2011 17:41, Mike Samuel a écrit : >> 2011/6/6 David Bruant : >>> The consequence of this second point is wondering whether it's a good idea >>> to standardize WeakMap (instead of Map) at all. >> Besides a lack of out-of-memory errors and performance, a program >>

Re: Thoughts on WeakMaps

2011-06-06 Thread David Bruant
Le 06/06/2011 17:41, Mike Samuel a écrit : > 2011/6/6 David Bruant : >> The consequence of this second point is wondering whether it's a good idea >> to standardize WeakMap (instead of Map) at all. > Besides a lack of out-of-memory errors and performance, a program > using an object key map that do

Re: Thoughts on WeakMaps

2011-06-06 Thread Mike Samuel
2011/6/6 David Bruant : > 2) The notion of weak reference as used in current WeakMap seems to be > assuming that the garbage collector will work on whether objects are > reachable or not. I have read (I thought it was the wikipedia page, but it > apparently wasn't) that there is another notion for

Thoughts on WeakMaps

2011-06-06 Thread David Bruant
Hi, I'm currently working on the WeakMap documentation [1] and I have thought of two points: 1) myWeakMap.set(key, value) doesn't return anything. It could return the previous value for the key (if such a thing exists). Is it intentional that the set function doesn't return anything? 2) The notio

Re: Feedback and criticism wanted: DOMCrypt API proposal

2011-06-06 Thread Brendan Eich
On Jun 6, 2011, at 9:51 AM, David Dahl wrote: > On 6/6/11 at 11:00,fra...@pwpconsult.com (Bill Frantz) wrote: >> On 6/1/11 at 16:01, dd...@mozilla.com (David Dahl) wrote: > >>> The property is namespaced in order to provide future capabilities. The >>> current design is asynchronous and looks li

Re: Default non-capturing regex flag [WAS: how to create strawman proposals?]

2011-06-06 Thread Gavin Barraclough
Actually this is fixed in ToT WebKit, have closed the stale bug. https://bugs.webkit.org/show_bug.cgi?id=56041 cheers, G. On Jun 5, 2011, at 5:04 PM, Juriy Zaytsev wrote: > > > On Sun, Jun 5, 2011 at 5:30 PM, Brendan Eich wrote: > On Jun 3, 2011, at 10:49 AM, Juriy Zaytsev wrote: > > > Chr

Re: class sugar

2011-06-06 Thread Allen Wirfs-Brock
and another... On Jun 6, 2011, at 11:44 AM, Allen Wirfs-Brock wrote: > (correction copy function below) > On Jun 6, 2011, at 10:58 AM, Allen Wirfs-Brock wrote: > >> >> On Jun 5, 2011, at 7:50 PM, Christopher M. Balz wrote: >> >>> Are there proposals for fixing, without going as far as making a

Re: class sugar

2011-06-06 Thread Allen Wirfs-Brock
(correction copy function below) On Jun 6, 2011, at 10:58 AM, Allen Wirfs-Brock wrote: > > On Jun 5, 2011, at 7:50 PM, Christopher M. Balz wrote: > >> Are there proposals for fixing, without going as far as making a 'class' >> system, the major drawback of prototype-based inheritance: Without s

Re: Harmony object literals

2011-06-06 Thread Allen Wirfs-Brock
On Jun 6, 2011, at 11:04 AM, Kam Kasravi wrote: > Yes, I did read the rational and see why you put it first, though the > cleanest IMHO is > var o = { >prototype : myProto, >a:0, >b: function () {} > } "prototype" is a valid property name that does not correspond to t

Re: class sugar: static inheritance

2011-06-06 Thread Allen Wirfs-Brock
On Jun 6, 2011, at 10:32 AM, Brendan Eich wrote: > On Jun 6, 2011, at 10:19 AM, Bob Nystrom wrote: > >> On Sun, Jun 5, 2011 at 9:35 PM, Peter Michaux wrote: >> Based on my understanding of what the desugared code would be, the >> last line above would be an error because Dragon.allMonsters is >

Re: Harmony object literals

2011-06-06 Thread Kam Kasravi
Yes, I did read the rational and see why you put it first, though the cleanest IMHO is var o = { prototype : myProto, a:0, b: function () {} } Or perhaps var o = { prototype = myProto, a:0, b: function () {} } Though I imagine the grammar impact for

Re: class sugar

2011-06-06 Thread Allen Wirfs-Brock
On Jun 5, 2011, at 7:50 PM, Christopher M. Balz wrote: > Are there proposals for fixing, without going as far as making a 'class' > system, the major drawback of prototype-based inheritance: Without something > like a JavaScript (js) class factory (a class factory as provided by most js > fram

Re: class sugar: static inheritance

2011-06-06 Thread Brendan Eich
On Jun 6, 2011, at 10:19 AM, Bob Nystrom wrote: > On Sun, Jun 5, 2011 at 9:35 PM, Peter Michaux wrote: > Based on my understanding of what the desugared code would be, the > last line above would be an error because Dragon.allMonsters is > undefined. > > That's correct. Do you have any examples

Re: Harmony object literals

2011-06-06 Thread Allen Wirfs-Brock
On Jun 6, 2011, at 9:38 AM, Kam Kasravi wrote: > I see, the object's prototype is to the left of <| and the actual object is > to the right. I guess that was made clear in the proposal though I suspect > others will invert the relationship since javascript programmers are used to > defining th

Re: class sugar: static inheritance

2011-06-06 Thread Bob Nystrom
On Sun, Jun 5, 2011 at 9:35 PM, Peter Michaux wrote: > Based on my understanding of what the desugared code would be, the > last line above would be an error because Dragon.allMonsters is > undefined. That's correct. Do you have any examples of code where inheriting the constructor objects would

Re: Default non-capturing regex flag [WAS: how to create strawman proposals?]

2011-06-06 Thread Mike Samuel
2011/6/6 Brendan Eich : > Escapes are a pain, due to the double-backslash burden. Yep. To fit into this kind of library, you could use a quasi syntax like regexp`...`.ignoreSpaces().nonCapturingByDefault().build() Not as pithy as flags, but extensible via regexp.prototype.nonCapturingBy

Re: Harmony object literals

2011-06-06 Thread Kam Kasravi
On Jun 6, 2011, at 9:48 AM, Brendan Eich wrote: > On Jun 6, 2011, at 9:38 AM, Kam Kasravi wrote: > >> I see, the object's prototype is to the left of <| and the actual object is >> to the right. I guess that was made clear in the proposal though I suspect >> others will invert the relationsh

Re: Default non-capturing regex flag [WAS: how to create strawman proposals?]

2011-06-06 Thread Brendan Eich
Escapes are a pain, due to the double-backslash burden. We really want quasis for this kind of extensibility. Quasis solve the multiline problem too (I hope... :-). /be On Jun 6, 2011, at 9:52 AM, Mike Samuel wrote: > 2011/6/3 Kyle Simpson : >> I propose a /n flag for regular expressions, whic

Re: Default non-capturing regex flag [WAS: how to create strawman proposals?]

2011-06-06 Thread Mike Samuel
2011/6/3 Kyle Simpson : > I propose a /n flag for regular expressions, which would swap the default > capturing/non-capturing behavior between ( ) and (?: ) operators (that is, ( > ) would not capture, and (?: ) would capture). > > The /n property would reflect on the RegExp object as `Noncapturing

Re: Feedback and criticism wanted: DOMCrypt API proposal

2011-06-06 Thread David Dahl
- Original Message - From: "Bill Frantz" To: "David Dahl" Cc: es-discuss@mozilla.org Sent: Monday, June 6, 2011 11:00:29 AM Subject: Re: Feedback and criticism wanted: DOMCrypt API proposal On 6/1/11 at 16:01, dd...@mozilla.com (David Dahl) wrote: >A JSON Object which labels the Key Pai

Re: Harmony object literals

2011-06-06 Thread Brendan Eich
On Jun 6, 2011, at 9:38 AM, Kam Kasravi wrote: > I see, the object's prototype is to the left of <| and the actual object is > to the right. I guess that was made clear in the proposal though I suspect > others will invert the relationship since javascript programmers are used to > defining the

Re: Harmony object literals

2011-06-06 Thread Kam Kasravi
I see, the object's prototype is to the left of <| and the actual object is to the right. I guess that was made clear in the proposal though I suspect others will invert the relationship since javascript programmers are used to defining the prototype after defining the object. The <| operator se

quasis proposal up-to-date

2011-06-06 Thread Mike Samuel
I updated http://wiki.ecmascript.org/doku.php?id=harmony:quasis based on the feedback from the last meeting. The demo testbed at http://js-quasis-libraries-and-repl.googlecode.com/svn/trunk/index.html is now up-to-date as well. Changes listed at http://wiki.ecmascript.org/doku.php?do=revisions&id

Re: Feedback and criticism wanted: DOMCrypt API proposal

2011-06-06 Thread Bill Frantz
On 6/1/11 at 16:01, dd...@mozilla.com (David Dahl) wrote: Hello JavaScript Enthusiasts, I recently posted this draft spec ( https://wiki.mozilla.org/Privacy/Features/DOMCryptAPISpec/Latest In looking at this proposal, I am confused by: cipherConfiguration A JSON Object which labels the Ke

Re: Harmony object literals

2011-06-06 Thread Allen Wirfs-Brock
On Jun 6, 2011, at 2:31 AM, Kam Kasravi wrote: > In the object literals proposal the following 2 examples are given below: > var enhancedArrayProto = Array.prototype <| { > do (func) {return this.foreach(func)}, > search (key {return this.indexOf(key) >= 0} > }; > var myArray = en

Re: class sugar: static inheritance

2011-06-06 Thread Mark S. Miller
On Sun, Jun 5, 2011 at 9:35 PM, Peter Michaux wrote: > Are static members inherited? What happens in the last line of the > following code? > >class Monster { >static allMonsters = []; > >constructor() { >Monster.allMonsters.push(this); >} >} > >clas

Harmony object literals

2011-06-06 Thread Kam Kasravi
In the object literals proposal the following 2 examples are given below: var enhancedArrayProto = Array.prototype <| { do (func) {return this.foreach(func)}, search (key {return this.indexOf(key) >= 0} }; var myArray = enhancedArrayProto <| [0,1,2,3,4,5]; 1. I believe search is mis

Re: Harmony classes

2011-06-06 Thread Brendan Eich
On Jun 5, 2011, at 10:59 PM, Kam Kasravi wrote: > From the harmony classes example copied below for reference. > The set health(value) {...} assigns a new value to this.health. But health is > a private property, so the assignment is setting a public property. Shouldn't > the assignment be priva