From: Matt Mower Date: 2005-12-05T23:05:28+09:00 Subject: Re: Oppinions on map vs collect 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/