From: James Gray Date: 2008-03-06T04:30:02+09:00 Subject: Re: collect with index? On Mar 5, 2008, at 12:58 PM, Mark Bush wrote: > 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. I like weird people. ;) Weird is just another way to say "free thinker," anyway. James Edward Gray II