In some constructions, I have the choice of using the keyword with a comma or doto delimit the end of the statement, as in the example untilbelow.
until x == 100 do puts x; x+=1 end
until x == 100; puts x; x+=1 end
But this is not possible with Kernel.loop.
x=0
loop do puts x; x+=1; break if x == 100 end
x=0
loop; puts x; x+=1; break if x == 100 end
Is there a reason why this is so?
Tim
source
share