Re: Suggestions for Set

2012-10-03 Thread Andreas Rossberg
On 3 October 2012 05:38, Brendan Eich bren...@mozilla.com wrote: Which is more important, iterating over holes (preserved if possible), or skipping them and therefore spreading array-likes but not iterables? I, for one, couldn't care less about holes. We shouldn't compromise any useful feature

[[Call]] vs. [[Construct]] using symbols

2012-10-03 Thread Herby Vojčík
Hello, now that we have symbols (and use some of them language-wise, like @iterator or proposed @toStringTag), I'd say we can probably dissect [[Call]] and [[Construct]] semantics fairly easily. Assuming there are global constant symbols @construct and @call, for min-max classes the issue is

Re: Suggestions for Set

2012-10-03 Thread Dean Landolt
On Wed, Oct 3, 2012 at 3:47 AM, Jussi Kalliokoski jussi.kallioko...@gmail.com wrote: On Wed, Oct 3, 2012 at 10:24 AM, Andreas Rossberg rossb...@google.comwrote: On 3 October 2012 05:38, Brendan Eich bren...@mozilla.com wrote: Which is more important, iterating over holes (preserved if

Re: Suggestions for Set

2012-10-03 Thread Herby Vojčík
Dean Landolt wrote: On Wed, Oct 3, 2012 at 3:47 AM, Jussi Kalliokoski jussi.kallioko...@gmail.com mailto:jussi.kallioko...@gmail.com wrote: On Wed, Oct 3, 2012 at 10:24 AM, Andreas Rossberg rossb...@google.com mailto:rossb...@google.com wrote: On 3 October 2012 05:38,

Re: Suggestions for Set

2012-10-03 Thread Erik Arvidsson
On Wed, Oct 3, 2012 at 3:24 AM, Andreas Rossberg rossb...@google.com wrote: On 3 October 2012 05:38, Brendan Eich bren...@mozilla.com wrote: Which is more important, iterating over holes (preserved if possible), or skipping them and therefore spreading array-likes but not iterables? I, for

Re: Suggestions for Set

2012-10-03 Thread Rick Waldron
On Wed, Oct 3, 2012 at 10:47 AM, Erik Arvidsson erik.arvids...@gmail.comwrote: On Wed, Oct 3, 2012 at 3:24 AM, Andreas Rossberg rossb...@google.com wrote: On 3 October 2012 05:38, Brendan Eich bren...@mozilla.com wrote: Which is more important, iterating over holes (preserved if possible),

Re: Suggestions for Set

2012-10-03 Thread Brendan Eich
Rick Waldron wrote: On Wed, Oct 3, 2012 at 10:47 AM, Erik Arvidsson erik.arvids...@gmail.com mailto:erik.arvids...@gmail.com wrote: On Wed, Oct 3, 2012 at 3:24 AM, Andreas Rossberg rossb...@google.com mailto:rossb...@google.com wrote: On 3 October 2012 05:38, Brendan Eich

Re: Suggestions for Set

2012-10-03 Thread Brendan Eich
Dean Landolt wrote: On Wed, Oct 3, 2012 at 3:47 AM, Jussi Kalliokoski jussi.kallioko...@gmail.com mailto:jussi.kallioko...@gmail.com wrote: On Wed, Oct 3, 2012 at 10:24 AM, Andreas Rossberg rossb...@google.com mailto:rossb...@google.com wrote: On 3 October 2012 05:38, Brendan

Re: Suggestions for Set

2012-10-03 Thread Jason Orendorff
On Wed, Oct 3, 2012 at 9:47 AM, Erik Arvidsson erik.arvids...@gmail.com wrote: On Wed, Oct 3, 2012 at 3:24 AM, Andreas Rossberg rossb...@google.com wrote: On 3 October 2012 05:38, Brendan Eich bren...@mozilla.com wrote: Which is more important, iterating over holes (preserved if possible), or

Re: Suggestions for Set

2012-10-03 Thread Allen Wirfs-Brock
A couple observations: 1) this whole issue is only relevant if you actually have array objects containing holes. Special treat for sparse arrays doesn't hurt anybody (other than implementors) who doesn't use them. 2) If we (and the broader developer community) don't like sparse behavior

Re: Suggestions for Set

2012-10-03 Thread Allen Wirfs-Brock
On Oct 3, 2012, at 7:47 AM, Erik Arvidsson wrote: On Wed, Oct 3, 2012 at 3:24 AM, Andreas Rossberg rossb...@google.com wrote: On 3 October 2012 05:38, Brendan Eich bren...@mozilla.com wrote: Which is more important, iterating over holes (preserved if possible), or skipping them and therefore

Re: Suggestions for Set

2012-10-03 Thread Brendan Eich
Allen Wirfs-Brock wrote: On Oct 3, 2012, at 7:47 AM, Erik Arvidsson wrote: On Wed, Oct 3, 2012 at 3:24 AM, Andreas Rossbergrossb...@google.com wrote: On 3 October 2012 05:38, Brendan Eichbren...@mozilla.com wrote: Which is more important, iterating over holes (preserved if possible), or

Re: Suggestions for Set

2012-10-03 Thread Brendan Eich
Jason Orendorff wrote: On Wed, Oct 3, 2012 at 9:47 AM, Erik Arvidssonerik.arvids...@gmail.com wrote: On Wed, Oct 3, 2012 at 3:24 AM, Andreas Rossbergrossb...@google.com wrote: On 3 October 2012 05:38, Brendan Eichbren...@mozilla.com wrote: Which is more important, iterating over holes

Sets plus JSON

2012-10-03 Thread Nicholas C. Zakas
After a little more experimenting with sets (still a really big fan!!), I've come across an interesting problem. Basically, I found myself using a set and then wanting to convert that into JSON for storage. JSON.stringify() run on a set returns {}, because it's an object without any enumerable

Is ES5 Strict a fully statically scoped language?

2012-10-03 Thread Šime Vidas
In the talk Changes to JavaScript, Part 1: EcmaScript 5, Mark Miller states that ES5 Default contains four static scope violations (direct link: http://www.youtube.com/watch?v=Kq4FpMe6cRst=42m53s). He also states that ES5 Strict corrects these violations, making ES5 Strict is a statically scoped

Re: Sets plus JSON

2012-10-03 Thread Rick Waldron
On Wed, Oct 3, 2012 at 12:37 PM, Nicholas C. Zakas standa...@nczconsulting.com wrote: After a little more experimenting with sets (still a really big fan!!), I've come across an interesting problem. Basically, I found myself using a set and then wanting to convert that into JSON for storage.

Re: Sets plus JSON

2012-10-03 Thread Herby Vojčík
Nicholas C. Zakas wrote: After a little more experimenting with sets (still a really big fan!!), I've come across an interesting problem. Basically, I found myself using a set and then wanting to convert that into JSON for storage. JSON.stringify() run on a set returns {}, because it's an

Re: Sets plus JSON

2012-10-03 Thread Tab Atkins Jr.
On Wed, Oct 3, 2012 at 9:37 AM, Nicholas C. Zakas standa...@nczconsulting.com wrote: After a little more experimenting with sets (still a really big fan!!), I've come across an interesting problem. Basically, I found myself using a set and then wanting to convert that into JSON for storage.

Re: Is ES5 Strict a fully statically scoped language?

2012-10-03 Thread François REMY
I think that what he meant is that we know for sure in which scope we can find the property/variable. That the propery exists or not in the that scope is another issue. So, in the code “function getOoops(t) { t(); return function() { return ooops; } }” we know statically that the scope where

Re: Sets plus JSON

2012-10-03 Thread Rick Waldron
On Wed, Oct 3, 2012 at 12:56 PM, Herby Vojčík he...@mailbox.sk wrote: Nicholas C. Zakas wrote: After a little more experimenting with sets (still a really big fan!!), I've come across an interesting problem. Basically, I found myself using a set and then wanting to convert that into JSON

Re: Sets plus JSON

2012-10-03 Thread Axel Rauschmayer
This also made me wonder about Maps, if the same use case were applied - toJSON simply wouldn't work when you have an object as a key. The default should probably be to convert to an object who’s keys are the results of applying String() to the map’s keys. Additionally, one could introduce

Symbols, Protocols, Frames, and Versioning

2012-10-03 Thread Kevin Smith
One of the main use cases for symbols is for defining object protocols that don't suffer from property name conflicts. The recently discussed `iterator` and `toStringTag` method names fall into this category. The idea is that we can implement the protocol by defining methods using symbols, and

Re: Sets plus JSON

2012-10-03 Thread Brandon Benvie
Another options for Maps is to represent them as an array of [key, value]. ___ es-discuss mailing list es-discuss@mozilla.org https://mail.mozilla.org/listinfo/es-discuss

Re: Sets plus JSON

2012-10-03 Thread Herby Vojčík
Rick Waldron wrote: On Wed, Oct 3, 2012 at 12:56 PM, Herby Vojčík he...@mailbox.sk mailto:he...@mailbox.sk wrote: Nicholas C. Zakas wrote: After a little more experimenting with sets (still a really big fan!!), I've come across an interesting problem.

Re: Sets plus JSON

2012-10-03 Thread Rick Waldron
On Wed, Oct 3, 2012 at 1:35 PM, Axel Rauschmayer a...@rauschma.de wrote: This also made me wonder about Maps, if the same use case were applied - toJSON simply wouldn't work when you have an object as a key. The default should probably be to convert to an object who’s keys are the results

Re: Sets plus JSON

2012-10-03 Thread Rick Waldron
On Wed, Oct 3, 2012 at 1:57 PM, Herby Vojčík he...@mailbox.sk wrote: Rick Waldron wrote: On Wed, Oct 3, 2012 at 12:56 PM, Herby Vojčík he...@mailbox.sk mailto:he...@mailbox.sk wrote: Nicholas C. Zakas wrote: After a little more experimenting with sets (still a really big

Re: Early error vs. error on first call to function vs. runtime error

2012-10-03 Thread François REMY
one might consider a script provide with parse-on-use semantics Sounds like yet another use strict to me. Experience tells that this is not working very well. Either an optimization is worth and is enforced by default, or it isn't used in most cases. Asking the developer to mark his code

Re: Sets plus JSON

2012-10-03 Thread Herby Vojčík
Rick Waldron wrote: On Wed, Oct 3, 2012 at 1:57 PM, Herby Vojčík he...@mailbox.sk mailto:he...@mailbox.sk wrote: Rick Waldron wrote: On Wed, Oct 3, 2012 at 12:56 PM, Herby Vojčík he...@mailbox.sk mailto:he...@mailbox.sk mailto:he...@mailbox.sk

Re: Sets plus JSON

2012-10-03 Thread Rick Waldron
On Wed, Oct 3, 2012 at 1:43 PM, Brandon Benvie bran...@brandonbenvie.comwrote: Another options for Maps is to represent them as an array of [key, value]. Which is a rough approximation of what a Map looks like internally. Again, I was more concerned with how to revive a Map and restore the

Re: Sets plus JSON

2012-10-03 Thread Axel Rauschmayer
I always find it next to impossible to guess use cases for non-trivial features. So having those would help. Often YAGNI applies. Two possibilities: - Subtype Map and override toJSON - Use JSON.stringify() with a replacer As Brandon Benvie mention, we could standardize on an array of pairs, but

Re: Sets plus JSON

2012-10-03 Thread Rick Waldron
On Wed, Oct 3, 2012 at 2:07 PM, Herby Vojčík he...@mailbox.sk wrote: Rick Waldron wrote: On Wed, Oct 3, 2012 at 1:57 PM, Herby Vojčík he...@mailbox.sk mailto:he...@mailbox.sk wrote: Rick Waldron wrote: On Wed, Oct 3, 2012 at 12:56 PM, Herby Vojčík he...@mailbox.sk

Re: Sets plus JSON

2012-10-03 Thread Rick Waldron
On Wed, Oct 3, 2012 at 2:04 PM, Rick Waldron waldron.r...@gmail.com wrote: On Wed, Oct 3, 2012 at 1:43 PM, Brandon Benvie bran...@brandonbenvie.comwrote: Another options for Maps is to represent them as an array of [key, value]. Which is a rough approximation of what a Map looks like

Re: Sets plus JSON

2012-10-03 Thread Axel Rauschmayer
Ah, now I get it. But isn’t that a much more general problem (dates, etc.)? You can either come up with a general encoding or do some schema-aware post-processing (including a JSON.parse reviver). On Oct 3, 2012, at 20:04 , Rick Waldron waldron.r...@gmail.com wrote: On Wed, Oct 3, 2012 at

Re: Sets plus JSON

2012-10-03 Thread Herby Vojčík
Rick Waldron wrote: On Wed, Oct 3, 2012 at 2:07 PM, Herby Vojčík he...@mailbox.sk mailto:he...@mailbox.sk wrote: Rick Waldron wrote: On Wed, Oct 3, 2012 at 1:57 PM, Herby Vojčík he...@mailbox.sk mailto:he...@mailbox.sk mailto:he...@mailbox.sk

Re: Sets plus JSON

2012-10-03 Thread David Bruant
Le 03/10/2012 18:37, Nicholas C. Zakas a écrit : (...) Set.prototype.toJSON = function() { return Array.from(this); }; That way, JSON.stringify() would do something rational by default when used with sets. Thoughts? Useful defaults. I love it! David

Re: Sets plus JSON

2012-10-03 Thread Rick Waldron
On Wed, Oct 3, 2012 at 2:21 PM, Herby Vojčík he...@mailbox.sk wrote: Of course, but again, I'm not sure how either of those would help identify which: '{ foo: [1,2,3,4,5], bar: [1,2,3,4,5] }' ...Is the Array and which is the Set Maybe I'm still misunderstanding? If I am, I apologize

Re: Suggestions for Set

2012-10-03 Thread Jason Orendorff
On Wed, Oct 3, 2012 at 11:34 AM, Brendan Eich bren...@mozilla.com wrote: * the spread syntax just uses the iteration protocol; This differs from Array.from -- any reason not to fall back on the array-like protocol (which for missing 'length' iterates no values)? I think ES6 should have a

Re: Sets plus JSON

2012-10-03 Thread Dean Landolt
On Wed, Oct 3, 2012 at 2:19 PM, Rick Waldron waldron.r...@gmail.com wrote: On Wed, Oct 3, 2012 at 2:04 PM, Rick Waldron waldron.r...@gmail.comwrote: On Wed, Oct 3, 2012 at 1:43 PM, Brandon Benvie bran...@brandonbenvie.com wrote: Another options for Maps is to represent them as an array

Re: Sets plus JSON

2012-10-03 Thread Nicholas C. Zakas
So here's a crazy idea (how's that for a lead-in?): What if it were possible to specify that you want all non-array JSON objects to be revived as maps instead of objects? Perhaps as an option passed to JSON.parse()? JSON objects really have no use for prototypes and could just as easily be

Re: Sets plus JSON

2012-10-03 Thread Brandon Benvie
Taking a cue from plist, which is easily transformed to and from JSON, you would end up with something like [{ key: {...key..}, value: {...value...} }] which is less space efficient but pretty easy to automatically convert back to a map (aside from correctly handling duplicate values).

Re: Is ES5 Strict a fully statically scoped language?

2012-10-03 Thread Gavin Barraclough
On Oct 3, 2012, at 10:05 AM, François REMY wrote: In non-strict ES, the “t” function may be eval, and eval could add a “oops” variable in the parent function getOoops. I don't believe this is true. This does not constitute a direct call to eval (15.1.2.1.1), and as such the eval will take

Re: Suggestions for Set

2012-10-03 Thread Brendan Eich
Jason Orendorff wrote: On Wed, Oct 3, 2012 at 11:34 AM, Brendan Eichbren...@mozilla.com wrote: * the spread syntax just uses the iteration protocol; This differs from Array.from -- any reason not to fall back on the array-like protocol (which for missing 'length' iterates no values)? I

Re: Symbols, Protocols, Frames, and Versioning

2012-10-03 Thread Brendan Eich
Thanks for pointing this out. Python's dunder-prefixing or anything like it in JS has that advantage: you can spell the magic property name with a string that works in any frame or global object. Of course strings can collide. Symbols are useful in spite of this, but it is telling that we

Re: Symbols, Protocols, Frames, and Versioning

2012-10-03 Thread David Bruant
Le 03/10/2012 21:01, Brendan Eich a écrit : Thanks for pointing this out. Python's dunder-prefixing or anything like it in JS has that advantage: you can spell the magic property name with a string that works in any frame or global object. Of course strings can collide. Symbols are useful in

Re: Sets plus JSON

2012-10-03 Thread Axel Rauschmayer
Another reviver-friendly possibility: type tags for objects (arrays remain as they are). [ { __type__: Date, time: 1349291353269 }, { __type__: Object, first: Jane, last: Doe }, { __type__: Map, entries: [ [first, Jane], [last, Doe] ] } ] This assumes that the keys of objects are

Re: Symbols, Protocols, Frames, and Versioning

2012-10-03 Thread Domenic Denicola
Would it suffice to allow cross-frame sharing of symbols via postMessage and its structured clone algorithm? They're immutable, right? On Oct 3, 2012, at 15:01, Brendan Eich bren...@mozilla.org wrote: Thanks for pointing this out. Python's dunder-prefixing or anything like it in JS has that

Re: Is ES5 Strict a fully statically scoped language?

2012-10-03 Thread François REMY
Indirect eval is something introduced for ES5 Strict only, I believe. Try the following code in your browser’s console, and you may be surprised: ((function(t) { t(var body=true); return function() { return body; }; })(eval))()) ___ es-discuss

Re: Symbols, Protocols, Frames, and Versioning

2012-10-03 Thread Axel Rauschmayer
A generic solution for cross-frame sharing would most elegant (instanceof...). But how? On Oct 3, 2012, at 21:01 , Brendan Eich bren...@mozilla.org wrote: Thanks for pointing this out. Python's dunder-prefixing or anything like it in JS has that advantage: you can spell the magic property

Re: Symbols, Protocols, Frames, and Versioning

2012-10-03 Thread Axel Rauschmayer
Not necessarily: you could have an environment that is global to all frames. But that seems like a security risk. On Oct 3, 2012, at 21:40 , Kevin Smith khs4...@gmail.com wrote: So should there be a way in the language to create singleton symbols? If so, how? new

Re: Suggestions for Set

2012-10-03 Thread Jason Orendorff
On Wed, Oct 3, 2012 at 1:57 PM, Brendan Eich bren...@mozilla.com wrote: On that point, does NodeList have an iterator in Firefox now? That's an obvious Array.from argument type. Yep! document.body.querySelectorAll(p).iterator() [object Iterator]

Re: Suggestions for Set

2012-10-03 Thread Rick Waldron
On Wed, Oct 3, 2012 at 2:57 PM, Brendan Eich bren...@mozilla.com wrote: Jason Orendorff wrote: On Wed, Oct 3, 2012 at 11:34 AM, Brendan Eichbren...@mozilla.com wrote: * the spread syntax just uses the iteration protocol; This differs from Array.from -- any reason not to fall back on the

Re: Suggestions for Set

2012-10-03 Thread Rick Waldron
On Wed, Oct 3, 2012 at 3:47 PM, Jason Orendorff jason.orendo...@gmail.comwrote: On Wed, Oct 3, 2012 at 1:57 PM, Brendan Eich bren...@mozilla.com wrote: On that point, does NodeList have an iterator in Firefox now? That's an obvious Array.from argument type. Yep!

Re: Is ES5 Strict a fully statically scoped language?

2012-10-03 Thread Gavin Barraclough
On Oct 3, 2012, at 12:40 PM, François REMY wrote: Indirect eval is something introduced for ES5 Strict only, I believe. Nope. See 15.1.2.1.1, no reference to strict. Here's a better example: (function(t){ var x = 'foo'; t(x = 'bar'); alert(x); })(eval) The indirect eval does not

Re: Is ES5 Strict a fully statically scoped language?

2012-10-03 Thread François REMY
| That just puts 'body' on the window. Indee, I'm false on that one. But if you use a direct eval, you can get the same behavior in ES5, which is want I wanted to demonstrate: window.a = true; (function x(t) { eval(t); return a==window.a; })(var a=false) So in plain ES5, the scope of

Re: Sets plus JSON

2012-10-03 Thread Rick Waldron
On Wed, Oct 3, 2012 at 2:44 PM, Dean Landolt d...@deanlandolt.com wrote: On Wed, Oct 3, 2012 at 2:19 PM, Rick Waldron waldron.r...@gmail.comwrote: On Wed, Oct 3, 2012 at 2:04 PM, Rick Waldron waldron.r...@gmail.comwrote: On Wed, Oct 3, 2012 at 1:43 PM, Brandon Benvie

Re: Sets plus JSON

2012-10-03 Thread Rick Waldron
On Wed, Oct 3, 2012 at 3:36 PM, Brendan Eich bren...@mozilla.org wrote: Rick Waldron wrote: On Wed, Oct 3, 2012 at 2:04 PM, Rick Waldron waldron.r...@gmail.commailto: waldron.r...@gmail.com** wrote: On Wed, Oct 3, 2012 at 1:43 PM, Brandon Benvie bran...@brandonbenvie.com

Re: Suggestions for Set

2012-10-03 Thread Erik Arvidsson
On Wed, Oct 3, 2012 at 3:53 PM, Rick Waldron waldron.r...@gmail.com wrote: var d = document.createElement(div); d.className = foo bar baz; [...d.classList] [foo, bar, baz] targetElement.classList.add(...sourceElement.classList); :D But then again that would work even if we didn't use the

Re: Suggestions for Set

2012-10-03 Thread Mark S. Miller
I can't imagine actually getting consensus on making the current default change from sparse to dense. We've rejected many breaking changes that were less breaking than this would be. The subclass notion is interesting though. Reads dominate writes, and frozen arrays can only be read anyway.

Re: Must built-in prototypes also be valid instances? (Was: Why DataView.prototype object's [[Class]] is Object?)

2012-10-03 Thread Mark S. Miller
On Tue, Oct 2, 2012 at 9:05 PM, Norbert Lindenberg ecmascr...@norbertlindenberg.com wrote: TC 39, I need decisions so that I can finish the Internationalization spec and send it to the Ecma GA: 1) Instances of Intl.Collator, Intl.NumberFormat, and Intl.DateTimeFormat currently have

Re: Suggestions for Set

2012-10-03 Thread Rick Waldron
On Wed, Oct 3, 2012 at 4:07 PM, Mark S. Miller erig...@google.com wrote: I can't imagine actually getting consensus on making the current default change from sparse to dense. We've rejected many breaking changes that were less breaking than this would be. The subclass notion is interesting

Re: Must built-in prototypes also be valid instances? (Was: Why DataView.prototype object's [[Class]] is Object?)

2012-10-03 Thread Mark S. Miller
On Tue, Oct 2, 2012 at 10:13 AM, Brendan Eich bren...@mozilla.com wrote: Allen Wirfs-Brock wrote: On Oct 1, 2012, at 9:56 PM, Brendan Eich wrote: Allen Wirfs-Brock wrote: We can try to tell ES implementors that they must do certain things in order to be in conformance but that really

Re: Symbols, Protocols, Frames, and Versioning

2012-10-03 Thread John J Barton
On Oct 3, 2012 12:39 PM, Domenic Denicola dome...@domenicdenicola.com wrote: Would it suffice to allow cross-frame sharing of symbols via postMessage and its structured clone algorithm? They're immutable, right? I'm trying to follow this thread, but I'm having trouble understanding the

Re: Symbols, Protocols, Frames, and Versioning

2012-10-03 Thread Brendan Eich
Domenic Denicola wrote: Would it suffice to allow cross-frame sharing of symbols via postMessage and its structured clone algorithm? They're immutable, right? They are immutable but you'd still have to pass your @iterator to another same-origin frame, and then have to use it carefully when

Re: Is ES5 Strict a fully statically scoped language?

2012-10-03 Thread Mark S. Miller
On Wed, Oct 3, 2012 at 10:05 AM, François REMY fremycompany_...@yahoo.frwrote: I think that what he meant is that we know for sure in which scope we can find the property/variable. That the propery exists or not in the that scope is another issue. So, in the code “function getOoops(t) {

Re: Is ES5 Strict a fully statically scoped language?

2012-10-03 Thread Šime Vidas
On Wed, Oct 3, 2012 at 7:05 PM, François REMY fremycompany_...@yahoo.frwrote: I think that what he meant is that we know for sure in which scope we can find the property/variable. That the propery exists or not in the that scope is another issue. So, it doesn't matter that the global

Re: Is ES5 Strict a fully statically scoped language?

2012-10-03 Thread Mark S. Miller
On Wed, Oct 3, 2012 at 3:16 PM, Šime Vidas sime.vi...@gmail.com wrote: On Wed, Oct 3, 2012 at 7:05 PM, François REMY fremycompany_...@yahoo.frwrote: I think that what he meant is that we know for sure in which scope we can find the property/variable. That the propery exists or not in the

Re: Symbols, Protocols, Frames, and Versioning

2012-10-03 Thread David Bruant
Le 03/10/2012 23:09, Brendan Eich a écrit : Domenic Denicola wrote: Would it suffice to allow cross-frame sharing of symbols via postMessage and its structured clone algorithm? They're immutable, right? They are immutable but you'd still have to pass your @iterator to another same-origin

RE: Sets plus JSON

2012-10-03 Thread Allen Wirfs-Brock
(oops, forgot to reply-all) Begin forwarded message: From: Allen Wirfs-Brock al...@wirfs-brock.com Date: October 3, 2012 10:15:57 AM PDT To: Herby Vojčík he...@mailbox.sk Subject: Re: Sets plus JSON On Oct 3, 2012, at 9:56 AM, Herby Vojčík wrote: Nicholas C. Zakas wrote: After a

Re: Is ES5 Strict a fully statically scoped language?

2012-10-03 Thread Šime Vidas
On Thu, Oct 4, 2012 at 12:31 AM, Mark S. Miller erig...@google.com wrote: On Wed, Oct 3, 2012 at 3:16 PM, Šime Vidas sime.vi...@gmail.com wrote: On Wed, Oct 3, 2012 at 7:05 PM, François REMY fremycompany_...@yahoo.frwrote: I think that what he meant is that we know for sure in which

Re: Symbols, Protocols, Frames, and Versioning

2012-10-03 Thread Brendan Eich
David Bruant wrote: Unforgeability can be given up, but you end up with global namespaces. new Symbol(21fef4ae-1439-4b6a-b412-3585906b35f1); or org.ecmascript.system.iterator This is no better than dunder-iterator (I mean '__iterator__', I just like typing dunder- ;-), or just 'iterator'

Re: Is ES5 Strict a fully statically scoped language?

2012-10-03 Thread Brendan Eich
You should eval an initialized var declaration of foo inside the with, and check foo's value after the with body, for real head-exploding. ;-) /be Šime Vidas wrote: Well, thank you for your excellent video. The dynamic scopes in the default language are a disaster... I've just written a short

Re: Symbols, Protocols, Frames, and Versioning

2012-10-03 Thread Dean Landolt
On Wed, Oct 3, 2012 at 5:09 PM, Brendan Eich bren...@mozilla.org wrote: Domenic Denicola wrote: Would it suffice to allow cross-frame sharing of symbols via postMessage and its structured clone algorithm? They're immutable, right? They are immutable but you'd still have to pass your

Re: Ecma 402 (i18n API) v2.0 features list

2012-10-03 Thread Gillam, Richard
Pardon my ignorance, but some sort of analogue to Java's ResourceBundle never makes it onto these lists. Is this out of scope, and if so, is there some sort of standard, recommended way to get that effect in ECMAScript? If not, I'd say that's more important than most of the things on this

Re: Ecma 402 (i18n API) v2.0 features list

2012-10-03 Thread Nebojša Ćirić
Please add all the features you are interested in to the document - https://docs.google.com/spreadsheet/ccc?key=0AhsGcaqNtRMpdC1FVEZOZ2tqdWRHdWdtRkMyaFM3VGc#gid=0 2012/10/3 Gillam, Richard gil...@lab126.com Pardon my ignorance, but some sort of analogue to Java's ResourceBundle never makes it

Re: Symbols, Protocols, Frames, and Versioning

2012-10-03 Thread Allen Wirfs-Brock
On Oct 3, 2012, at 2:09 PM, Brendan Eich wrote: Domenic Denicola wrote: Would it suffice to allow cross-frame sharing of symbols via postMessage and its structured clone algorithm? They're immutable, right? They are immutable but you'd still have to pass your @iterator to another

Re: Symbols, Protocols, Frames, and Versioning

2012-10-03 Thread Brendan Eich
Dean Landolt wrote: On Wed, Oct 3, 2012 at 5:09 PM, Brendan Eich bren...@mozilla.org mailto:bren...@mozilla.org wrote: Domenic Denicola wrote: Would it suffice to allow cross-frame sharing of symbols via postMessage and its structured clone algorithm? They're

Re: Symbols, Protocols, Frames, and Versioning

2012-10-03 Thread Brendan Eich
Allen Wirfs-Brock wrote: Presumably a similar technique could be used for user defined symbols that need to be shared across frame but the needs to be a way to communicate the actual shared symbol values to the module instance associated with each realm. In the above referenced message I

1js, local fundecls, and not-quite-conforming pre-es6 implementations

2012-10-03 Thread Claus Reinke
What was the story wrt subject? The Note in ES5.1, 12, Semantics (FunctionDeclarations as Statements) used to be unproblematic as this non-portable feature could simply be avoided. It also was unproblematic when ES.next still required opt-in, as old implementations would then balk before

Re: 1js, local fundecls, and not-quite-conforming pre-es6 implementations

2012-10-03 Thread Brendan Eich
Claus Reinke wrote: But with 1JS, I'm no longer sure what happens when new code that relies on local FunDecls (and no other ES6 features) encounters an old implementation. It looks as if there will be no warning or error, just irreconcilable differences in behaviour? That's the case already,

Re: Early error vs. error on first call to function vs. runtime error

2012-10-03 Thread Brendan Eich
Oliver Hunt wrote: I still don't understand this desire to delay semantic analysis, where are the examples of sema being a performance bottleneck? Just basic parsing already requires us to do a reasonable amount of analysis anyway, and while parsing shows up as being a problem, the bulk of

New ECMAScript Internationalization API Specification draft

2012-10-03 Thread Norbert Lindenberg
The 3 October 2012 draft of the ECMAScript Internationalization API Specification is available at http://wiki.ecmascript.org/doku.php?id=globalization:specification_drafts This draft has the content that TC 39 approved on 18 September for submission to the Ecma CC and GA. Best regards, Norbert

Re: Must built-in prototypes also be valid instances? (Was: Why DataView.prototype object's [[Class]] is Object?)

2012-10-03 Thread Brendan Eich
Mark S. Miller wrote: Allen and I also discussed the plan I intend to try in SpiderMonkey: making Date.prototype, Number.prototype, etc. test as Object according to the O_p_toString_call tag test. We think this should not affect SES or any real code (as Oliver postulated). I