From: Michel Demazure Date: 2010-05-01T23:17:06+09:00 Subject: Re: Return values of modifiers 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 -- Posted via http://www.ruby-forum.com/.