From: Daniel Schierbeck Date: 2005-12-05T23:32:33+09:00 Subject: Re: Oppinions on map vs collect Matt Mower wrote: > On 05/12/05, Daniel Schierbeck wrote: >> I usually use #map if I want to collect the return values generated from >> calling a method with each item in the enumerable as an argument: >> >> results = arr.map { |item| process(item) } >> >> I use #collect when I want to collect attributes from each item in the >> enumerable: >> >> names = contacts.collect { |contact| contact.name } >> > > I like that convention. Assuming that it's too late for Matz to > re-purpose either function name, I'll start using that myself. > > Thanks, > > Matt > > -- > Matt Mower :: http://matt.blogs.it/ Muahahaha, my evil plan to take over the world has begun! Soon, all will bow to my will and... wait, is this on? Crap!