loop()
public
Repeatedly executes the block.
loop do
print "Input: "
line = gets
break if !line or line =~ /^qQ/
end
StopIteration raised in the block breaks
the loop.
Show source
/*
* call-seq:
* loop {|| block }
*
* Repeatedly executes the block.
*
* loop do
* print "Input: "
* line = gets
* break if !line or line =~ /^qQ/
*
* end
*
* StopIteration raised in the block breaks the loop.
*/
static VALUE
rb_f_loop()
{
rb_rescue2(loop_i, (VALUE)0, 0, 0, rb_eStopIteration, (VALUE)0);
return Qnil; /* dummy */
}