Set iterators

Peter Michaux petermichaux at gmail.com
Mon Feb 13 20:14:01 PST 2012


I expected a set would have an undefined iteration order to give
implementations the opportunity to make optimizations that maintaining
order would not allow.


On Mon, Feb 13, 2012 at 8:06 PM, Adam Shannon <adam at ashannon.us> wrote:
> I thought that Set wasn't going to even have insertion order as a
> "possible". The idea behind any Set (outside of ES even) is that it is
> just a collection of elements, unordered.
>
> On Mon, Feb 13, 2012 at 19:32, Allen Wirfs-Brock <allen at wirfs-brock.com> wrote:
>>
>> 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
>>
>>
>> _______________________________________________
>> es-discuss mailing list
>> es-discuss at mozilla.org
>> https://mail.mozilla.org/listinfo/es-discuss
>
>
>
> --
> Adam Shannon
> Developer
> University of Northern Iowa
> Sophomore -- Computer Science B.S. & Mathematics
> http://ashannon.us


More information about the es-discuss mailing list