Add intersections and unions to Set

aleth at instantbird.org aleth at instantbird.org
Mon Mar 4 10:08:14 PST 2013


It would be useful to be able to form the intersection and the union of
two Sets. These are natural operations that are currently not part of
the API
(http://wiki.ecmascript.org/doku.php?id=harmony:simple_maps_and_sets). 

Similar methods would make sense for Map, but one would have to think
about what to do in the case where the key but not the value matches.

An intersection is equivalent to a particular filter, so an alternative
might be to add a method like Array.filter to Sets instead.

(I filed bug 847355 for this and was told this mailing list was the
right place for this suggestion.)

-- 
http://www.fastmail.fm - Send your email first class



More information about the es-discuss mailing list