From: Stefano Crocco Date: 2009-02-11T17:33:44+09:00 Subject: Re: FixNum#times is correct? Alle Wednesday 11 February 2009, Iņaki Baz Castillo ha scritto: > irb> 5.times {|i| puts i} > 0 > 1 > 2 > 3 > 4 > 5 > > > Is it the expected output? I was expecting: > 0 > 1 > 2 > 3 > 4 The 5 you see is the return value of 5.times, which irb displays as it does with the value returned by each expression you evaluate. If you try the above code from a script or from command line, you'll get the expected result: ruby -e '5.times{|i| puts i}' 0 1 2 3 4 Stefano