while
/until
detected in begin
block RB-LI1033Kernel#loop
with break
rather than begin/end/until
(or while
). 5
6begin
7 do_something
8end while some_condition 9
10b = [1, 2, 3, 4, 5]
11puts b
while
/until
should be used at the beginning of the block, and without the begin
statement.
begin
puts i
i += 1
end while i < 10
while i < 10
puts i
i += 1
end