Allen Wirfs-Brock (2013-12-06T21:07:19.000Z)
domenic at domenicdenicola.com (2013-12-10T01:38:22.610Z)
On Dec 6, 2013, at 12:18 PM, Hudson, Rick wrote: > Not sure I'm following you here. The collection passed to the closure parameter (aka callback function) in map is the source and not the destination. As far as I can tell the destination isn't available until map returns it. Right, sorry first post of the morning. Coffee wasn't active yet. There is still a difference. With map, the source collection is the this value of the map method and has implementation level visibility of the source collection. The map method is specified to do explicit index iteration over the indices of the source collection. With the from method, the source may simply be an Iterable Iterator (an Iterator with a @@iterator method). The ultimate source of the data isn't necessarily known to the from method and since index-based iteration isn't used to access the iterator, any index passed to the closure would be a destination index. But, as you point out, the destination object isn't available to the closure.