On Fri, Apr 16, 2010 at 6:09 PM, John Lane <ruby-forum / jelmail.com> wrote:
>
> I found the explanation from Jesus about (&:first) very interesting but
> I'm not sure I think it improves readability. I read these:
> http://pragdave.pragprog.com/pragdave/2005/11/symbolto_proc.html
> http://www.ruby-forum.com/topic/161089
>
> Personally I think the Symbol#to_proc approach is less idomatic than the
> long hand version but I guess it's a matter of personal taste.

Actually, given the definition of idiom, I'd argue that it's MORE idiomatic.

The Symbol#to_proc idea has been around ruby for quite a while.  It
got picked up in Rails some time ago, and is popular in the rails
community despite a certain cost in performance which I believe has
been ameliorated in Ruby 1.9 which made it part of the core.


-- 
Rick DeNatale

Blog: http://talklikeaduck.denhaven2.com/
Github: http://github.com/rubyredrick
Twitter: @RickDeNatale
WWR: http://www.workingwithrails.com/person/9021-rick-denatale
LinkedIn: http://www.linkedin.com/in/rickdenatale