Re: Throwing StopIteration in array extras to stop the iteration

2013-03-04 Thread Jeff Walden
On 03/03/2013 06:53 PM, Andrea Giammarchi wrote: I had to check msdn rather than MDN since latter does not mention it while mans shows an example: http://msdn.microsoft.com/en-us/library/ie/3k9c4a32(v=vs.94).aspx The RegExp statics aren't mentioned because they're a bad idea, imposing costs

Re: Throwing StopIteration in array extras to stop the iteration

2013-03-04 Thread Jeff Walden
On 03/03/2013 06:49 PM, Rick Waldron wrote: Is this +1 to findIndex? Not that I much care between the two, just making sure another reasonable name is considered, but I'm not sure why it wouldn't be named find rather than findIndex. The index seems like the only bit you'd reasonably be

Re: Throwing StopIteration in array extras to stop the iteration

2013-03-04 Thread Andrea Giammarchi
I use RegExp.$1 , RegExp.$2, etc quite a lot since I am a huge fan of the RAM and I believe creating a redundant array of matches for no reason since these are retrievable in any case through the RegExp constructor, considering exec and match points to those RegExp properties anyhow, ain't needed

Re: Throwing StopIteration in array extras to stop the iteration

2013-03-04 Thread Andrea Giammarchi
that does not find a thing, that find an index I meant that simply store once the index without needing an outer scope access and variable inside the closure On Mon, Mar 4, 2013 at 8:38 AM, Andrea Giammarchi andrea.giammar...@gmail.com wrote: I use RegExp.$1 , RegExp.$2, etc quite a lot

RE: Internationalization: Support for IANA time zones

2013-03-04 Thread Shawn Steele
My proposed fallback was the English name. Granted that isn't always very readable, however my point was that using UTC-XX isn't just potentially hard to read, but it's also wrong. I don't mind standardizing the fallback behavior, or recommending fallback behavior, I don't want misleading

RE: Internationalization: Support for IANA time zones

2013-03-04 Thread Shawn Steele
I still think the stability issue should be addressed in the IANA time zone database itself, not by adopting a IANA-derived alternate registry. Has that been tried? I agree, we should be chatting with the IANA folks. -Shawn ___ es-discuss

Add intersections and unions to Set

2013-03-04 Thread aleth
It would be useful to be able to form the intersection and the union of two Sets. These are natural operations that are currently not part of the API (http://wiki.ecmascript.org/doku.php?id=harmony:simple_maps_and_sets). Similar methods would make sense for Map, but one would have to think about

Re: Throwing StopIteration in array extras to stop the iteration

2013-03-04 Thread Bjoern Hoehrmann
* Jeff Walden wrote: On 03/03/2013 06:49 PM, Rick Waldron wrote: Is this +1 to findIndex? Not that I much care between the two, just making sure another reasonable name is considered, but I'm not sure why it wouldn't be named find rather than findIndex. The index seems like the only bit

Re: Add intersections and unions to Set

2013-03-04 Thread Tab Atkins Jr.
On Mon, Mar 4, 2013 at 10:08 AM, al...@instantbird.org wrote: It would be useful to be able to form the intersection and the union of two Sets. These are natural operations that are currently not part of the API (http://wiki.ecmascript.org/doku.php?id=harmony:simple_maps_and_sets). Similar

Re: Throwing StopIteration in array extras to stop the iteration

2013-03-04 Thread Rick Waldron
On Mon, Mar 4, 2013 at 11:29 AM, Jeff Walden jwalden...@mit.edu wrote: On 03/03/2013 06:49 PM, Rick Waldron wrote: Is this +1 to findIndex? Not that I much care between the two, just making sure another reasonable name is considered, but I'm not sure why it wouldn't be named find rather

Re: Throwing StopIteration in array extras to stop the iteration

2013-03-04 Thread Andrea Giammarchi
this is what 've wrote as prototype at the end of the post. findIndex makes sense to me and is better, in term of manipulation, than finding just an element. (function(AP){ AP.findIndex || ( AP.findIndex = function(fn, self) { var $i = -1; AP.some.call(this, function(v, i, a) { if

Re: Throwing StopIteration in array extras to stop the iteration

2013-03-04 Thread Rick Waldron
On Mon, Mar 4, 2013 at 2:37 PM, Andrea Giammarchi andrea.giammar...@gmail.com wrote: this is what 've wrote as prototype at the end of the post. findIndex makes sense to me and is better, in term of manipulation, than finding just an element. (function(AP){ AP.findIndex || (

RE: Throwing StopIteration in array extras to stop the iteration

2013-03-04 Thread Domenic Denicola
From: es-discuss-boun...@mozilla.org [es-discuss-boun...@mozilla.org] on behalf of Rick Waldron [waldron.r...@gmail.com] Thanks, I've submitted an agenda item that includes _both_ find and findIndex. Awesome! One issue with `find` is what distinguishes find([1, 2, 3], x = isNaN(x)); //

Re: Throwing StopIteration in array extras to stop the iteration

2013-03-04 Thread Brendan Eich
One idea we've discussed: allow the sentinel that is OOB with respect to the domain (element type) be an optional second parameter: const K = Symbol(not found); console.log( [1, 2, 3].find(x = isNaN(x), K) ); // K, logs as not found console.log( [1, 2, , 3].find(x = isNaN(x)) ); //

Re: Add intersections and unions to Set

2013-03-04 Thread Claude Pache
The Set constructor accepts an iterable (including an Array and a Set) as an argument to populate the newly-constructed Set with several values. There should also be the possibility to add or remove multiple elements of an already-constructed Set. That covers unions and differences, but it is

Re: Throwing StopIteration in array extras to stop the iteration

2013-03-04 Thread Andrea Giammarchi
Thanks a lot. On find(), I believe it will always be ambiguous, compared to findIndex, for the simple reason that an Array could contain undefined too [1, undefined, 2] ... probably an edge case not worth the consideration, but this looks like a legit code to me: [1, undefined, 2].find(function

Re: Add intersections and unions to Set

2013-03-04 Thread Claude Pache
Le 4 mars 2013 à 23:37, Claude Pache claude.pa...@gmail.com a écrit : The Set constructor accepts an iterable (including an Array and a Set) as an argument to populate the newly-constructed Set with several values. There should also be the possibility to add or remove multiple elements of

Re: Throwing StopIteration in array extras to stop the iteration

2013-03-04 Thread Jeff Walden
On 03/04/2013 08:38 AM, Andrea Giammarchi wrote: I believe creating a redundant array of matches for no reason since these are retrievable in any case through the RegExp constructor, considering exec and match points to those RegExp properties anyhow, ain't needed when re.test(value) is

Re: Throwing StopIteration in array extras to stop the iteration

2013-03-04 Thread Jason Orendorff
On Sun, Mar 3, 2013 at 12:45 PM, David Bruant bruan...@gmail.com wrote: [2, 8, 7].forEach(function(e){ if(e === 8) throw StopIteration; This would be taking a piece of one low-level protocol, and using it for a sorta-kinda related thing that actually, on

Re: Throwing StopIteration in array extras to stop the iteration

2013-03-04 Thread Andrea Giammarchi
I didn't forget in the post, neither is necessary here, I put in the post to deal with an integer but that's superflous for the purpose so no mistake (we all know arr[1] is gonna be handled as arr[1], as example) Anyway, RegExp.$N is just fine and standard across all engines I know and

Re: Internationalization: Support for IANA time zones

2013-03-04 Thread L. David Baron
On Saturday 2013-03-02 10:50 -0800, Norbert Lindenberg wrote: On Mar 2, 2013, at 8:46 , Mark Davis ? wrote: The TZDB has the equivalence class {Asia/Calcutta Asia/Kolkata}. They used to have the former as the canonical name (in Zone), but then changed it to the latter. Here is the current