From: Michael W Ryder Date: 2010-06-02T08:10:06+09:00 Subject: Re: documentation mismatch ? Stanislav Orlenko wrote: > Hi > I'm reading documentation on > http://rubylearning.com/satishtalim/ruby_blocks.html > I've just tried execute this code: > > x = 10 > 5.times do |x| > puts "x inside the block: #{x}" > end > > puts "x outside the block: #{x}" > > and my output: > > x inside the block: 0 > x inside the block: 1 > x inside the block: 2 > x inside the block: 3 > x inside the block: 4 > x outside the block: 4 > > BUT in documentation I see that output should be: > > x inside the block: 0 > x inside the block: 1 > x inside the block: 2 > x inside the block: 3 > x inside the block: 4 > x outside the block: 10 > > My ruby: > #ruby --version > ruby 1.8.7 (2008-08-11 patchlevel 72) [x86_64-linux] > > Can someone clarify the situation? http://rubylearning.com contains > wrong documentation? > Thanks in advance I get the results that the documentation shows. I am using ruby 1.9.1p129 (2009-05-12 revision 23412) [i386-mswin32] if that makes any difference.