From: Claus Spitzer Date: 2004-08-04T00:28:12+09:00 Subject: Re: Request for two methods in Array class On Tue, 3 Aug 2004 21:59:57 +0900, David A. Black wrote: > Hi -- > > On Tue, 3 Aug 2004, Yukihiro Matsumoto wrote: > > > Hi, > > > > In message "Request for two methods in Array class" > > on 04/08/03, Mike Hall writes: > > > > |1. A new method, Array.combine (needs a better name for general use). > > | It takes entries from two (or many) arrays and combines them. > > | (like a combination of Array.zip, fetch, and map) > > > > Sounds nice. But I'm not sure "combine" is a proper name for the > > method. We need more discussion, for example: > > I know I'm being the voice of possibly excessive conservatism > here... but I'm just wondering what this method would give us, since > we can already do zip+map. As Ara said, it would create one less > object. But chaining methods always creates intermediate objects. If > zip+map deserves to be combined into a new, single method, what about > flatten+map, or compact+map? And then (flatten+map)+compact.... > > I realize that zip+map is more likely to be actually used, and people > have often said they wish zip's block mapped the elements. But I > still wonder whether it's worth a new method and method name. > > David > > -- > David A. Black > dblack@wobblini.net > > That's a strong point. Elaborating a bit more on that, perhaps what is needed is not a new method (or a collection of them), but a way of piping objects instead of creating intermediate ones. Then methods could be still chained, but with better spatial efficiency. -CWS