From: Todd Benson Date: 2009-03-07T01:05:57+09:00 Subject: Re: Any solutions to Ruby's inconsistencies? On Fri, Mar 6, 2009 at 5:10 AM, Michal Suchanek wrote: > You are iterating the array visiting the elements one by one, > transforming each by the block, and stuffing the results into another > array. If that is not collecting the results of the transformation I > don't know what would be collecting things then. I knew that someone would pipe in that we are collecting objects and not transforming them, but you still have a left-hand assignment dependency unless you use "!"; either way, you are collecting _all_ of them (well, that is if you don't do some block-internal trickery). To me, "collect", "grab", "gather", "prune", are all lexically equivalent to "select". In the current case, it's like saying I want to collect a flock of sheep, when that action -- though makes sense when physically grabbing them -- has nothing to do with the use in the programming language. Anyways, like Eleanor mentioned, Ruby gives you the power to say, for example... flock_1.sheer... if you are going to sheer flock_1, and renders the actual map vs. collect argument a little bit moot. I suppose it really depends on your use of the language and what team language standards you have set down. I like #map because I see in my mind a->b, even though the a into b doesn't have to be one to one. Like I said earlier; I think this is an artifact of CS thinking. #map is easier to type too. To each his or her own :-) Todd