On Nov 14, 12:54=A0am, timr <timra... / gmail.com> 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| =A0lambda{puts test; break}.call
> if (1..6).all?{|num| test%num =3D=3D (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