It returns the argument of break:

x =3D while true; break 123; end  #=3D> 123

If you don't break out of the loop it makes sense that the result is nil.

Tomas

-----Original Message-----
From: Kornelius Kalnbach [mailto:murphy / rubychan.de]=20
Sent: Saturday, May 01, 2010 9:40 PM
To: ruby-core / ruby-lang.org
Subject: [ruby-core:29924] Re: [Feature #3232] Loops (while/until) should r=
eturn last statement value if any, like if/unless

On 02.05.10 01:56, Yukihiro Matsumoto wrote:
> The last evaluated expression in this case is "i < 3", so the loop=20
> statement would have the return value of false value, even if it would=20
> return the *last* value.
So, shouldn't it return false then?

[murphy]