From: dblack@... Date: 2002-11-17T03:12:15+09:00 Subject: Re: Ruby equivalent to Python's map()? Hi -- On Sun, 17 Nov 2002, Massimiliano Mirra wrote: > On Sat, Nov 16, 2002 at 11:01:19PM +0900, dblack@candle.superlink.net wrote: > > This is also a good example of why I wish we had map_with_indices. > > Hey, wait a minute, we do: > > > > module Enumerable > > def map_with_indices > > (0...size).each {|i| yield(at(i),i)} > ^^^^ > > Is that `map'? Yes. Serves me right for hacking at it before posting, rather than posting the one that had been sitting in my archive for two years :-) David -- David Alan Black home: dblack@candle.superlink.net work: blackdav@shu.edu Web: http://pirate.shu.edu/~blackdav