loop {|| block }
Repeatedly executes the block.
loop do print "Input: " line = gets break if !line or line =~ /^qQ/
…
end
Source Code
/* * call-seq: * loop {|| block } * * Repeatedly executes the block. * * loop do * print "Input: " * line = gets * break if !line or line =~ /^qQ/ * # ... * end */ static VALUE rb_f_loop() { for (;;) { rb_yield_0(Qundef, 0, 0, 0, Qfalse); CHECK_INTS; } return Qnil; /* dummy */ }
<code/>and<pre/>for code samples.