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 arity of existing
std functions. Though reserving by throwing does change the game somewhat.
Does it change the game enough?





On Tue, Feb 24, 2015 at 8:07 AM, Rick Waldron <waldron.r...@gmail.com>
wrote:

>
>
> 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'])
>> > ```
>> >
>> > Would it make sense to throw if either of the constructors `Set` and
>> `Map` receives more than one argument?
>>
>> or perhaps we should have  Set.of(...args) and Set.from(iterable) methods.
>>
>
> +1
>
> Also, it occurs to me that specifying Set and Map to throw when there is
> greater than 1 argument would provide insurance for the comparator function
> argument. Sometime in the future, the operation could be relaxed to allow
> accepting that second argument.
>
> Rick
>
>
> _______________________________________________
> es-discuss mailing list
> es-discuss@mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>
>


-- 
    Cheers,
    --MarkM
_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to