From: Michael Studman Date: 2006-10-20T23:14:23+09:00 Subject: Re: break from block --------------000705000001000109070404 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit I'm not sure it's the Ruby way (I'm too new to Ruby to judge) but how about: block = lambda{|i| i > 5 ? throw(:enough) : nil} n = 10 catch(:enough) do n.times &block end > 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 > > --------------000705000001000109070404--