On Dec 8, 2008, at 18:24, Nobuyoshi Nakada wrote:

> Hi,
>
> At Mon, 8 Dec 2008 22:21:16 +0900,
> Florian Gilcher wrote in [ruby-core:20421]:
>> This might make sense for an Array of Symbols. But i've also seen use
>> of this
>> in other interpretations, like for chaining Arrays of procs. Other
>> uses could be
>> imagined.
>
> What about Symbol#call()?
>
>  (1..3).collect(&:*.(2))  #=3D> [2, 4, 6]
>


I think Jay Philips's Methodphitamine[1] does an good job at that, is =20=

more flexible (you can do (x * 2).to_s with it, for instance), and IMO =20=

has a cleaner syntax (albeit that might be a moot point in this =20
context ;)).

Your example would be, with Methodphitamine:

  (1..3).collect &it * 2

[1]: http://jicksta.com/posts/the-methodphitamine

--=20
Name =3D "Mikael H=F8ilund"; Email =3D Name.gsub %r/\s/,%#=3D?,#
*a=3De=3D?=3D,!????,:??,?,,Email.downcase![eval(%["\\%o\\%o"]%
[?**2+?o,?\\*2])]=3D"o";Email.gsub! %%\%c%*3%a, %?%c? % ?@
def The(s)%%\%s.%%s+%.org\n.end; :Go and print The Email