Set iterators

Andreas Rossberg rossberg at google.com
Tue Feb 14 03:45:36 PST 2012


On 14 February 2012 12:02, David Bruant <bruant.d at gmail.com> wrote:
> Le 14/02/2012 11:23, Andreas Rossberg a écrit :
>> To be sure, this is assuming that iteration order is fixed for a given
>> implementation. If order is not specified, then I don't see why that
>> should be required either.
>
> It is not required, but it's what experience tells us from the for-in loop.

Doesn't experience rather tell us that people expect a specific
enumeration order, not just some fixed one?


>> And I see potential reasons why order might differ for separate
>> iterations over the same collection.
>
> I'm interested in hearing more :-)

Dynamic changes of representation, for example. V8 does things like
that all the time. And it currently goes to some length to make for-in
deterministic.

(But just to be clear, I'm still in favour of fully specified behaviour.)

/Andreas


More information about the es-discuss mailing list