When to use lambda, when to use Proc.new?
In Ruby 1.8, there are subtle differences between proc/lambda on the one hand, and Proc.new on the other. What are those differences? Can you give guidelines on how to decide which one to choose? In Ruby 1.9, proc and lambda are different. What's the deal? Joey deVilla Another important but subtle difference between procs created with lambda and procs created with Proc.new is how they handle the return statement: In a lambda -created proc, the return statement returns only from the proc itself In a Proc.new -created proc, the return statement is a little more surprising: it returns control not