Set iterators

Allen Wirfs-Brock allen at wirfs-brock.com
Mon Feb 13 17:32:55 PST 2012


On Feb 12, 2012, at 4:52 PM, Peter Michaux wrote:

> In the proposal, iterators for Set are listed as todo. If engine
> implementers have decided to start moving forward implementing Sets,
> then it would be great if they could get iteration going sooner than
> later.
> 
> http://wiki.ecmascript.org/doku.php?id=harmony:simple_maps_and_sets

Before getting too deep into iteration protocol for Sets (and Maps) there is a more fundamental issues:  Will Set define a standard, implementation independent ordering of elements? If so, what is the basis for the ordering?

Is it iteration order?  Is so this will add likely add space overhead to the internal  representation  of Set and Map and/or time overhead to insert/delete operations.   Also, for specializations of Set such as Integer Sets insertion order may not be the most desirable iteration ordering.

Allen




More information about the es-discuss mailing list