Re: Standard @iter module unfriendly to collection builders

2011-11-15 Thread Jason Orendorff
On Sun, Nov 13, 2011 at 12:17 PM, Erik Arvidsson erik.arvids...@gmail.com wrote: Another thing to consider is whether these functions belong in an iter module or in a reflect module? I'm leaning towards the letter. I completely agree. for-of should be the tool for iterating over collections.

Re: Standard @iter module unfriendly to collection builders

2011-11-15 Thread Jason Orendorff
To address Allen's original question: I think the Map and Set classes in Harmony mean that not all structured data is stored as object properties. I think that's a good thing. However it does mean that we must have a separation of concerns between - iterating over a collection - object

Re: Standard @iter module unfriendly to collection builders

2011-11-15 Thread Brendan Eich
On Nov 15, 2011, at 1:42 PM, Jason Orendorff wrote: On Sun, Nov 13, 2011 at 12:17 PM, Erik Arvidsson erik.arvids...@gmail.com wrote: Another thing to consider is whether these functions belong in an iter module or in a reflect module? I'm leaning towards the letter. I completely agree.

Re: Standard @iter module unfriendly to collection builders

2011-11-14 Thread Allen Wirfs-Brock
On Nov 12, 2011, at 12:05 PM, Brendan Eich wrote: On Nov 12, 2011, at 11:26 AM, Allen Wirfs-Brock wrote: The Iterators proposal includes the definition (http://wiki.ecmascript.org/doku.php?id=harmony:iterators#standard_api ) of functions that are intended to support various common

Re: Standard @iter module unfriendly to collection builders

2011-11-14 Thread Brendan Eich
On Nov 14, 2011, at 9:07 AM, Allen Wirfs-Brock wrote: On Nov 12, 2011, at 12:05 PM, Brendan Eich wrote: On Nov 12, 2011, at 11:26 AM, Allen Wirfs-Brock wrote: The Iterators proposal includes the definition (http://wiki.ecmascript.org/doku.php?id=harmony:iterators#standard_api ) of

Re: Standard @iter module unfriendly to collection builders

2011-11-14 Thread Erik Arvidsson
On Mon, Nov 14, 2011 at 09:07, Allen Wirfs-Brock al...@wirfs-brock.com wrote: Another possibility would be to build in default @iterator methods on Object.prototype and Array.prototype.  I'd probably make the object implementation be an items for enumerable properties and the array

Re: Standard @iter module unfriendly to collection builders

2011-11-14 Thread Brendan Eich
On Nov 14, 2011, at 11:59 AM, Erik Arvidsson wrote: On Mon, Nov 14, 2011 at 09:07, Allen Wirfs-Brock al...@wirfs-brock.com wrote: Another possibility would be to build in default @iterator methods on Object.prototype and Array.prototype. I'd probably make the object implementation be an

Re: Standard @iter module unfriendly to collection builders

2011-11-13 Thread Erik Arvidsson
Another thing to consider is whether these functions belong in an iter module or in a reflect module? I'm leaning towards the letter. On Nov 12, 2011 12:05 PM, Brendan Eich bren...@mozilla.com wrote: On Nov 12, 2011, at 11:26 AM, Allen Wirfs-Brock wrote: The Iterators proposal includes the

Re: Standard @iter module unfriendly to collection builders

2011-11-13 Thread Brendan Eich
On Nov 13, 2011, at 10:17 AM, Erik Arvidsson wrote: Another thing to consider is whether these functions belong in an iter module or in a reflect module? I'm leaning towards the letter. Does it matter, apart from the name? I'd rather have more and more precisely defined modules than one

Standard @iter module unfriendly to collection builders

2011-11-12 Thread Allen Wirfs-Brock
The Iterators proposal includes the definition (http://wiki.ecmascript.org/doku.php?id=harmony:iterators#standard_api ) of functions that are intended to support various common iteration patterns. For example, for ((k of keys(x)) { ...} for (v of values(x)) { ...} for ([k,v] of

Re: Standard @iter module unfriendly to collection builders

2011-11-12 Thread Brendan Eich
On Nov 12, 2011, at 11:26 AM, Allen Wirfs-Brock wrote: The Iterators proposal includes the definition (http://wiki.ecmascript.org/doku.php?id=harmony:iterators#standard_api ) of functions that are intended to support various common iteration patterns. For example, for ((k of