From: Kevin Date: 2012-02-07T14:56:30+09:00 Subject: Re: Using _ like in Scala? On Mon, Feb 6, 2012 at 9:07 PM, Tony Arcieri wrote: > On Mon, Feb 6, 2012 at 5:56 PM, Eric Christopherson < > echristopherson@gmail.com> wrote: > >> > IMHO, Ruby's block argument semantics are already crazy enough. >> >> How so? > > > The status quo is: > > - Yielding arguments to a block without arguments discards the arguments > - Yielding a higher arity than what the block accepts truncates the > arguments bound (the above can be considered the degenerate case of this) > - Yielding a lower arity binds arguments to nil > > So okay, given that, maybe a default argument could jive. I've seen the > same thing in Groovy, except they call it "it" > > _ has precedence in irb already as the result of the last expression > evaluated... but _ might still work for this purpose. I've been using in in > the Erlang sense sometimes to discard a variable in cases where I don't > care (although thanks to what Ruby syntax allows even that is superfluous) > > -- > Tony Arcieri 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.