From: Benoit Daloze Date: 2010-05-01T23:23:00+09:00 Subject: Re: Return values of modifiers 2010/5/1 Michel Demazure : > Benoit Daloze wrote: >> What I meant is: >> >>> i = 0 >> => 0 >>> while i < 10 >>>   i += 1 >>>   33 >>>   end >> => nil # should be 33 >> >> This is already the case for class Foo..end, and if/unless >> >> It should be for the loops too (without explicit break). >> >> And when the condition is wrong and then the "block" is never used, >> then nil should be returned. >> >> What do you think? > > Benoit, if you have only >  i = 0 >  while i < 10 >   i += 1 >  end > which is the same as >  i = 0 >  while i < 10 >   i += 1 >   i >  end > then it should return 10, as I wanted ? > _md Sure, that's my point. (But I think the 'if/unless' behavior is correct and "foo if false" should return nil as it is)