Allen Wirfs-Brock (2013-12-06T17:08:09.000Z)
domenic at domenicdenicola.com (2013-12-10T01:36:25.588Z)
Note that from is different from map in two important ways 1. For the map method, the source and destination collection are the same object so the collection argument to the closure parameter identifiers both the source and destination object and the sole index parameter identifies both the source and destination index. With the from method, the source and destination objects may have distinct identity and (because of the use of iterators) the actual source index (if there even is one) may be different from the destination index. You might equally argue that the signature of the closure should be (value, destCollection, destIndex, srcCollection, srcIndex(, 2. For the from method, the source collection is usually accessed using an Iterator. That itself may be problematic from a parallel perspective that you need to consider. Finally, I can imagine that the security conscience might view the implicit passing of the target collection to the closure as a capability leak. Imagine a closure provided by an untrusted source. Passing the target collection allows them to capture a reference to the collection that they might later misuse. I know that the existing Array methods already have this characteristic, but perhaps we should think about whether it is a good idea to add more such capability leaks. I'm actually not unsympathetic to this request, but I think we should examine some of these design issues before committing to any changes. Do you have any real use cases where knowledge of the destination collection and index is actually needed.