Set constructor arguments
dean at deanlandolt.com
Wed Feb 15 07:46:17 PST 2012
On Wed, Feb 15, 2012 at 3:56 AM, Andrea Giammarchi <
andrea.giammarchi at gmail.com> wrote:
> As long as we don't end up with ambiguous constructor as Array could be (
> Array(1) VS Array() ) ... so what if the iterable *is* the value I would
> like to add() automatically ?
Don't use spread on it.
> If it's about auto magic population with auto magic filtering and ordering
> of potential duplicated values ( and already too much magic, imo ) I would
> keep Set.length 0 accepting 0 to N arguments rather than a single one so
> yes, spread through iterable would be ideal.
> On the other hand, Map and WeakMap have different relation, based on
> pairs, and different kind of pairs ( object only or anything )
> What if we leave these constructors in peace and let outer wrappers
> eventually decide what kind of sorcery should be applied during
> initialization ? :-)
I think that's the intent of allowing spread to exhaust an iterator.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the es-discuss