From: Arlen Cuss Date: 2008-02-28T22:29:07+09:00 Subject: Re: proc.new and return ------=_Part_15771_30100701.1204205353636 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi, On Fri, Feb 29, 2008 at 12:19 AM, ThoML wrote: > > as expected. but if i put it inside a method > > AFAIK the way return inside a block works has changed in ruby 1.9 > though (it then returns from the block). > Hmm... I don't see this behaviour, but I may be out of date. irb(main):004:0> RUBY_VERSION => "1.9.0" irb(main):005:0> Proc.new {return true}.call LocalJumpError: unexpected return from (irb):5:in `block (3 levels) in irb_binding' from (irb):5:in `call' from (irb):5 from /usr/lib/ruby/1.9/irb.rb:150:in `block (2 levels) in eval_input' from /usr/lib/ruby/1.9/irb.rb:259:in `signal_status' from /usr/lib/ruby/1.9/irb.rb:147:in `block in eval_input' from /usr/lib/ruby/1.9/irb.rb:146:in `eval_input' from /usr/lib/ruby/1.9/irb.rb:70:in `block in start' from /usr/lib/ruby/1.9/irb.rb:69:in `catch' from /usr/lib/ruby/1.9/irb.rb:69:in `start' from /usr/bin/irb1.9:13:in `
' irb(main):006:0> I can't find any relevant documentation that says it should be otherwise. Arlen. ------=_Part_15771_30100701.1204205353636--