From: Daniel DeLorme Date: 2009-05-14T12:03:27+09:00 Subject: Re: [bikeshed] Syntactic sugar idea Jan wrote: > * Daniel DeLorme [2009-05-14 11:42:31 +0900]: > >> It seems that often an object will be passed into a block only to invoke >> a method of that object: >> arr.map{ |obj| obj.some_method } >> >> So I had the (weird? stupid?) thought that it would be nice to have some >> syntactic sugar like this: >> arr.map{ .some_method } > > You can do arr.map(&:some_method) in ruby 1.9 Yes, I know, and that was kind of my point. The to_proc conversion became popular because people want a shortcut notation for this common case, but IMHO map(&:foo) is way uglier than map{.foo}, and as a bonus you could even do map{.foo.bar} :-) -Daniel