From: Yukihiro Matsumoto Date: 2010-05-02T08:56:47+09:00 Subject: [ruby-core:29921] Re: [Feature #3232] Loops (while/until) should return last statement value if any, like if/unless Hi, In message "Re: [ruby-core:29920] [Feature #3232] Loops (while/until) should return last statement value if any, like if/unless" on Sun, 2 May 2010 04:14:10 +0900, Benoit Daloze writes: |In conditions: |if true | 2 |end #=> 2 | |In loops: |i = 0 |while i < 3 | i += 1 | "return value" |end #=> nil | |I suggest the return value of loops to be the return value of |the last "block" evaluated between "while/until" and "end". The last evaluated expression in this case is "i < 3", so the loop statement would have the return value of false value, even if it would return the *last* value. matz.