From: Robert Klemme Date: 2006-10-21T01:10:10+09:00 Subject: Re: break from block On 20.10.2006 16:37, Farrel Lifson wrote: > I'm just trying to optimise some code and I was wondering if doing > block = lambda{|i| #processing; if i > 5; break} > n.times &block > would be any faster than doing it directly. I do not know a single case where the lambda variant is faster than the direct block variant. AFAIK that's because of the conversion that occurs. The advantage of the lambda variant is rather that you can store the block away and reuse it multiple times. Regards robert