From: Lars Christensen Date: 2009-05-14T18:33:22+09:00 Subject: Re: [bikeshed] Syntactic sugar idea On Thu, May 14, 2009 at 4:42 AM, Daniel DeLorme wrote: > 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 } I sometimes miss Perl's $_. Without a parser change, it could be used as the default name for block parameters: arr.sort_by { $_.size } File.open("logfile", "a") { $_.puts logtext } arr.map { foo2bar($_) } Then I remember how people abuse it and avoid using appropriately named variables, and I am again happy about the little extra code I have to write.