Re: `new Set()` or `new Map()` with more than one argument

2015-02-24 Thread Allen Wirfs-Brock
On Feb 24, 2015, at 5:52 AM, Axel Rauschmayer wrote: I’ve accidentally created the wrong set a few times: ```js let set = new Set('red', 'green', 'blue'); // WRONG: same as new Set(['r', 'e', 'd']) ``` Would it make sense to throw if either of the constructors `Set` and `Map`

`new Set()` or `new Map()` with more than one argument

2015-02-24 Thread Axel Rauschmayer
I’ve accidentally created the wrong set a few times: ```js let set = new Set('red', 'green', 'blue'); // WRONG: same as new Set(['r', 'e', 'd']) ``` Would it make sense to throw if either of the constructors `Set` and `Map` receives more than one argument? -- Dr. Axel Rauschmayer

Re: `new Set()` or `new Map()` with more than one argument

2015-02-24 Thread Rick Waldron
On Tue Feb 24 2015 at 10:48:59 AM Allen Wirfs-Brock al...@wirfs-brock.com wrote: On Feb 24, 2015, at 5:52 AM, Axel Rauschmayer wrote: I’ve accidentally created the wrong set a few times: ```js let set = new Set('red', 'green', 'blue'); // WRONG: same as new Set(['r', 'e', 'd'])

Re: `new Set()` or `new Map()` with more than one argument

2015-02-24 Thread Mark S. Miller
As always with proposals to extend arity -- even if reserved by a thrown error in a previous release -- how would you feature test for the extended functionality? I suspect the awkwardness of feature testing is one of the reasons why we have not previously added new functionality by extending

Re: `new Set()` or `new Map()` with more than one argument

2015-02-24 Thread Rick Waldron
On Tue Feb 24 2015 at 12:22:25 PM Mark S. Miller erig...@google.com wrote: As always with proposals to extend arity -- even if reserved by a thrown error in a previous release -- how would you feature test for the extended functionality? I suspect the awkwardness of feature testing is one of

Re: `new Set()` or `new Map()` with more than one argument

2015-02-24 Thread Tab Atkins Jr.
On Tue, Feb 24, 2015 at 10:06 AM, Rick Waldron waldron.r...@gmail.com wrote: On Tue Feb 24 2015 at 12:22:25 PM Mark S. Miller erig...@google.com wrote: As always with proposals to extend arity -- even if reserved by a thrown error in a previous release -- how would you feature test for the

Re: `new Set()` or `new Map()` with more than one argument

2015-02-24 Thread Leon Arnott
or perhaps we should have Set.of(...args) and Set.from(iterable) methods. I was under the impression that Array.of() was solely an apologetic patch over Array()'s broken arguments interpretation, and not really an apogee for future or present collection classes. Regarding the main topic: I

Re: short-circuiting Array.prototype.reduce

2015-02-24 Thread Lee Byron
Thanks for this additional context, Brendan. The block lambda revival was particularly interesting to read up on. I understand why we went down the arrow function path, but it’s fun to think about what ES6+ might look like had we taken that different path. I’d like to keep this proposal scoped