From: Kevin Date: 2012-02-09T05:55:42+09:00 Subject: Re: Using _ like in Scala? On Wed, Feb 8, 2012 at 12:26 PM, Steve Klabnik wrote: > Ruby has Perl's $_, but only in certain contexts: > > $ echo "foo" |  ruby -pe 'next unless $_ =~ /(foo|bar|baz)/' > foo > $ > > For example. I'm not sure when it's valid, as this perl-ism isn't: > > 1.9.2p290 :001 > fruits = %w( apple banana orange ) >  => ["apple", "banana", "orange"] > 1.9.2p290 :002 > fruits.each { puts $_ } > > > >  => ["apple", "banana", "orange"] > Wouldn't the general use case at issue here be addressed by adding standalone versions of various functions traditionally associated with collections so that one could call say reduce like "reduce myarray, :+"? Granted if we started doing that we might get tempted to parenthesize everything and at that point we may as well go write Lisp.