jastrachan | 1 Feb 15:13 2005
Picon

Re: [groovy-dev] Diff of Java and Groovy grammars

On 1 Feb 2005, at 10:52, Russel Winder wrote:
> On Tue, 2005-02-01 at 09:59 +0000, jastrachan@... wrote:
>
>>>> value = [1, 2, 3].collect { it * 2 }
>>>> assert value == [2, 4, 6]
>
>> We started off using 'map' but then folks thought it'd make a map, so 
>> I
>> changed it to 'collect' which matches the Smalltalk and Ruby naming
>> convention.
>
> OK, that makes sense.

FWIW it might be nice to have a map() method which works like collect 
but makes a map of the key = the list item and the value is the result 
of the closure...

>  Ruby copied Smalltalk as well I guess.

Yes - it also used the same closure syntax - its always nice to give 
credit where its due

James
-------
http://radio.weblogs.com/0112098/


Gmane