From: Dominik Bathon Date: 2006-07-08T19:40:32+09:00 Subject: Re: [BUG] next in ensure body (Ruby 1.8.x) On Sat, 08 Jul 2006 11:23:20 +0200, ts wrote: >>>>>> "D" == Dominik Bathon writes: > > D> It seems to work correctly in 1.9. > > Not really, > > > moulon% cat ~/b.rb > def foo; yield; end > p foo { begin; next 5; ensure; 12; end } > moulon% > > moulon% ./ruby -v ~/b.rb > ruby 1.9.0 (2006-07-08) [i686-linux] > nil > moulon% That's interesting, it did work in May (I didn't install a current version to test, because it worked with the one I had): $ cat next_in_ensure.rb def foo; yield; end p foo { next 5 } p foo { begin; next 5; rescue; end } p foo { begin; ensure; next 5; end } p foo { begin; next 5; ensure; end } $ ruby19 -v next_in_ensure.rb ruby 1.9.0 (2006-05-18) [i686-linux] next_in_ensure.rb:4: warning: statement not reached 5 5 5 5 > the problem is here > > moulon% ./ruby-yarv -v ~/b.rb > ruby 2.0.0 (Base: Ruby 1.9.0 2006-04-08) [i686-linux] > YARVCore 0.4.0 Rev: 509 (2006-07-05) [opts: ] > 5 > moulon% > > what to do ? which is really official ? I think it should be 5, because why should there be a difference between "foo { next 5 }" and "foo { begin; next 5; ensure; end }". > It seems to have more differences between ruby and ruby-yarv :-( > > > Guy Decoux