On Feb 13, 2012, at 1:20 AM, Axel Rauschmayer wrote:

> True. Assuming that the spread operator works on any iterable,

Not as currently specified.  It does the same 0 to length generic property 
enumeration as is used within the "Array extra" functions.  Changing to using 
an iterator probably would be possible, but we need to consider all the 
implications.  For example, I would expect 

   [...firstPart, ...secondPart]

to be somewhat more expense if spread uses iterators rather than as currently 
defined.  Is this extra cost justifiable in light of the most common use cases? 
Maybe, but I'm not totally sure?  I think implementors know how to easily 
optimize the "array" accesses used in the current definition of spread.  On 
first consideration, optimizing an iterator based loop seems fundamentally 
harder. 

Allen



_______________________________________________
es-discuss mailing list
es-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to