From: "Skye Shaw!@#$" Date: 2010-11-14T18:20:16+09:00 Subject: Re: Is it possible to break a loop from within an internal lambda function? On Nov 14, 12:54 am, timr wrote: > This code works because 'exit' within the lambda within the block > stops the loop. However, I don't want to stop the program. I need to > use break rather than exit. > > #I want to use: solve_by_iter { |test|  lambda{puts test; break}.call > if (1..6).all?{|num| test%num == (num-1)} } This seems like an odd code arrangement. What's wrong with returning a boolean value from the inner lambda and breaking in the block? solve_by_iter { |test| break if lambda{puts test; false}.call } -Skye