Lambdas vs Procs

A lambda IS a proc β€” with two strict differences

->(x) { x * 2 } creates a lambda, which is a Proc object (lambda.class == Proc, lambda.lambda? == true). But it behaves more strictly than a plain proc in exactly two ways, and those two differences are a top-5 Ruby interview question.

In an interview, say: "A lambda is a proc with method-like semantics: it checks arity strictly, and return inside it returns from the lambda, not from the enclosing method. Plain procs are lenient on arity and their return blows through the enclosing method."