Set constructor arguments

Dean Landolt dean at deanlandolt.com
Tue Feb 14 12:20:51 PST 2012


On Tue, Feb 14, 2012 at 3:07 PM, Andrea Giammarchi <
andrea.giammarchi at gmail.com> wrote:

> if you accept a single argument, of course, but what if you Set(..[1, 2,
> 1]) then ?


`Set(1, 2, 1)` then? Are you suggesting this should throw? So you'd need to
dedupe your arguments before you construct a set with them? Isn't that a
primary use case of sets?


>
> magic add through Set constructor does not sound good to me
>
>
> On Tue, Feb 14, 2012 at 8:27 PM, Peter Michaux <petermichaux at gmail.com>wrote:
>
>> On Tue, Feb 14, 2012 at 12:09 AM, Andrea Giammarchi
>> <andrea.giammarchi at gmail.com> wrote:
>> > thinking about the add behavior, where no duplicated values will be
>> added,
>> > this argument may cause some logic headache anyway
>> >
>> > Set([1, 2, 1]) what should happen ?
>>
>> I think that should be a set with one element. The element is an array
>> of length three.
>>
>> Peter
>>
>
>
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20120214/89213095/attachment.html>


More information about the es-discuss mailing list