Asp Forum
Home
|
Login
|
Register
|
Search
Forums
>
comp.lang.ruby
Re: Newbie question: Small blocks
Jeremy Woertink
9/10/2007 7:52:00 PM
You can type any block with the { } or the do..end way. You don't have
to have the pipes, but without them you don't have a way to pass items
of your collection into the block. So for example
array.each { puts "HELLO" } <--- no pipes, but no data
The only thing I can think of where you would have seen the & would be
something like
irb(main):001:0> (0..5).each { 0 & 5 }
=> 0..5
irb(main):002:0>
~Jeremy
--
Posted via
http://www.ruby-...
.
Servizio di avviso nuovi messaggi
Ricevi direttamente nella tua mail i nuovi messaggi per
Re: Newbie question: Small blocks
Inserendo la tua e-mail nella casella sotto, riceverai un avviso tramite posta elettronica ogni volta che il motore di ricerca troverà un nuovo messaggio per te
Il servizio è completamente GRATUITO!
x
Login to ForumsZone
Login with Google
Login with E-Mail & Password