From: Mike Gold Date: 2009-03-07T03:05:14+09:00 Subject: Re: Any solutions to Ruby's inconsistencies? Michal Suchanek wrote: > 2009/3/5 Todd Benson : > > 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. Again I would submit that this is the Lisp way of thinking about it, as I showed in the example I gave, which is I guess where the 'collect' term comes from. In Lisp you loop over something (or several things) and optionally collect results as a side-effect of the loop. But often you apply a function which maps one set to another, that is, Enumerable#map. The term 'map' is common in mathematics and in many programming languages. Even Lisp uses 'map' when that the explicit operation (and not a loop side-effect). It is also helpful to recognize that if you were born in India you are more likely to watch Cricket instead of Baseball. In other words, cultural preferences are not absolute. If from the beginning ruby had 'map' but not the 'collect' synonym, there is no reason to believe that you would find this situation unusual. -- Posted via http://www.ruby-forum.com/.