From: Chad Perrin Date: 2012-02-08T13:38:30+09:00 Subject: Re: Using _ like in Scala? On Wed, Feb 08, 2012 at 09:30:42AM +0900, Kevin wrote: > On Tue, Feb 7, 2012 at 1:49 PM, Chad Perrin wrote: > > On Tue, Feb 07, 2012 at 02:56:30PM +0900, Kevin wrote: > >> > >> It would make more sense to just eliminate the need to type even a > >> place holder while keeping the current form. �I.E. fruits.each{puts} > >> Or come up with semantics that allow the interpreter to accept an > >> input like "puts fruits" and have Ruby unwind the collection. > > > > What -- like this? > > > > � �$ irb > > � �>> fruits = ['apple', 'orange'] > > � �=> ["apple", "orange"] > > � �>> puts fruits > > � �apple > > � �orange > > � �=> nil > > Yes. Does this only work in the REPL? I've never tried that kind of > order in real code. As mentioned elsewhere, this works in Ruby, period. -- Chad Perrin [ original content licensed OWL: http://owl.apotheon.org ]