On Jul 14, 2012, at 03:07 , Jan E. wrote:

> You seem to be coming from a language like Java or so. Note that Ruby 
> does *not* have a "do-until" or a "do-while" loop. You have to use an 
> endless loop with a conditional "break" at the end.
> 
> This "begin-end-until" actually looks like a "do-until" loop, but it's 
> not. It's just the same as "until ... do ... end". I'd actually avoid 
> this notion completely, because it's very ambiguous and hard to read. 
> Use the appended "until", "while", "if" etc. only for single line 
> statements.

No, begin/end/(while|until) is NOT the same as (while|until)/end:

% ruby -e 'begin puts "bad"; end while false'
bad
% ruby -e 'while false do puts "bad"; end '
%