From: hemant Date: 2006-10-20T23:20:23+09:00 Subject: Re: break from block On 10/20/06, Farrel Lifson wrote: > I've just run into the following problem. Doing this: > block = lambda{|i| i > 5 ? break : nil} > n.times &block > raises a LocalJumpError, I assume because break is not valid from > within a Proc object. Is there any way to get around this? > > Farrel > > I am not sure about the solution, but the reason of the error is not that break is not valid within in Procs!! Try return in place of break and you will still get the error. Something else is going on here that needs explanation. -- There was only one Road; that it was like a great river: its springs were at every doorstep, and every path was its tributary.