Forum: Ruby Re: Symbol#to_proc is just so beautiful

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Berger, Daniel (Guest)
on 2006-04-19 22:50
(Received via mailing list)
> > There must be a way to ditch that '&' somehow.  I'd prefer this:
>    arr.each(&:upcase!)
>    arr.collect(&:downcase)

I don't like it. It bugs me. That ampersand is an eye sore in otherwise
elegant syntax. I also worry about the inevitable, "Does that mean it's
a reference?" questions this syntax will generate from newbies.

Maybe, instead of changing Ruby to simplify Enumerable/Array/Hash
methods (and let's face it, that's about 95% of the reason most people
want this change) we should just, you know, change the
Enumerable/Array/Hash API to accept symbolic methods for simple

Just my .02.


This topic is locked and can not be replied to.