Robert Klemme wrote:
> 2010/4/30 Michel Demazure <michel / demazure.com>:
>>
>> irb(main):010:0> x += 1 while x < 15
>> => nil
>>
>> It would be nice to get the return value of the last instruction
>> *before* the test fails.
> 
> Why?  What use case is there that would require this or what code
> would become (much) more elegant?
> 
I was just cleaning a library and found two methods ending with 
something like

  ind += 1 while <some_test>
  ind
end

and tried to get rid of the last line, quite ugly and looking 
unnecessary. You're right : not *much* more elegant. But once you get 
used to syntactic sugar, you'll ask for some more ... Remember Dijsktra 
: "abuse of syntactic sugar gives cancer of the semi-colon".
_md
-- 
Posted via http://www.ruby-forum.com/.