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

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
F3b7b8756d0c7f71cc7460cc33aefaee?d=identicon&s=25 Berger, Daniel (Guest)
on 2006-04-19 20: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
comparisons.

Just my .02.

Regards,

Dan
This topic is locked and can not be replied to.