From: Brian Candler Date: 2008-11-13T02:12:32+09:00 Subject: Re: unexpected return (LocalJumpError) Robert Dober wrote: > IIRC this will change in 1.9 In what way? proc is now an alias for Proc.new instead of lambda. But what other changes are in the pipeline? BTW I agree that this is a feature, not a bug. But it's not obvious to the newcomer that there are two, rather different, closure-like objects: - lambda is standalone. A 'return' returns from the lambda. - Proc.new / block is created within the context of a method. A 'return' returns from that method. If the method has already terminated, then 'return' makes no sense and causes an error. The first is what Lisp programmers expect. The second is what makes it possible to write def calculate_something(foo) foo.each do |params| ... return val if cond end end -- Posted via http://www.ruby-forum.com/.