From: Brad Hilton Date: 2004-04-02T10:54:01+09:00 Subject: Re: calling break in proc Yukihiro Matsumoto wrote: > Hi, > > In message "Re: calling break in proc" > on 04/04/02, Brad Hilton writes: > > |I found a simpler example that exposes this strange proc/break problem. > > The point is the break destination. > > |data_loader = proc { |hash| > | p hash > | break if hash['i'] == 5 > |} > > |# this produces an error... > |obj.fetch(&data_loader) > > The destination of a break in the data_loader is the continuation to > the "proc", which is already passed through at the point of > "obj.fetch". Use catch/throw for dynamic exit. Thanks for the explanation - it makes sense. What surprises me is that this code worked for 1.8.1, and still works of you remove the initialize() function in my example code. That made me think there might be a bug lurking somewhere... Ie, why would changing the initialize function of my example class affect the behavior of a break-point in a proc object? -Brad