[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Re: RCR Opinion Poll

Yukihiro Matsumoto

1/12/2007 2:06:00 PM

Hi,

In message "Re: RCR Opinion Poll"
on Fri, 12 Jan 2007 18:56:08 +0900, "Robert Dober" <robert.dober@gmail.com> writes:

|The following is a very common pattern.
|
| an_enum.map{ |ele| ele.a_method }
|
|I believe that it is sufficiently common to be generalized.
|
|There are two idioms I would like to see
|
| an_enum.apply_to_all :a_method
|and
| an_enum.apply_to_all.a_method

an_enum.map(&:a_method) works for 1.9.

matz.