From: Mark Bush Date: 2008-03-06T03:58:56+09:00 Subject: Re: collect with index? Todd Benson wrote: > I agree, #map makes more sense, but the use of #collect doesn't bother > me that much. I think I would get irritated, however, if I saw both > in the same code. In functional languages, I'm happily a mapper, but in OO languages I'm an avid collector. I guess it's the Smalltalker in me. I wouldn't baulk at mixing and matching according to conditions. I'd probably #map a variable representing a Proc object and #collect a block: f = lambda {|x| ...} a.map &f a.collect {|x| ...} If that makes me weird then I'm happy to be weird. -- Posted via http://www.ruby-forum.com/.