Hi,
In message "Re: questions... about Proc,lambda,block"
on 04/03/04, Dave Thomas <dave / pragprog.com> writes:
|I'm not sure I understand the orphaning rules. For example, in
|
|def m1(&b)
| puts "m1"
| yield
|end
|
|def m2(&b)
| puts "m2"
| b.call
|end
|
|m1 { break }
|m2 { break }
|
|The two blocks appear to have the same relationship to their point of
|invocation (that is, both are attached to the method from with they are
|called), and yet the first break terminates m1 (which I expected) but
|the second break causes a LocalJumpError (which I didn't).
m2 should not raise the LocalJumpError. Now it is clear that I need
to apply the fix to 1.8. Sorry for confusion.
matz.