From: matt@... (matt neuburg) Date: 2006-10-22T02:25:12+09:00 Subject: Re: break from block 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? block = lambda{|i| p i; i > 5 ? throw(:done) : nil} catch(:done) {42.times &block} m. -- matt neuburg, phd = matt@tidbits.com, http://www.tidbits.com/matt/ Tiger - http://www.takecontrolbooks.com/tiger-customizing.html AppleScript - http://www.amazon.com/gp/product/0596102119 Read TidBITS! It's free and smart. http://www.tidbits.com