From: dblack@... Date: 2002-11-19T21:04:20+09:00 Subject: Re: ruby-dev summary 18711-18810 Hi -- On Tue, 19 Nov 2002, Massimiliano Mirra wrote: > On Tue, Nov 19, 2002 at 09:06:05AM +0900, dblack@candle.superlink.net wrote: > > And if map_with_index existed, you could define #zip in terms of it > > :-) > > > > def zip(*others) > > map_with_index {|e,i| [e,others.map{|n| n[i]}]} > > end > > > > (or something) > > That would only work for objects with #[](integer). But then you > already said it's ok to you... ;-) Yes, although I'd be interested in hearing people's ideas about cases where that wasn't sufficient. I guess maybe objects which generate a random sequence of some kind? David -- David Alan Black home: dblack@candle.superlink.net work: blackdav@shu.edu Web: http://pirate.shu.edu/~blackdav