A past puzzle — fully playable. 4 attempts, hints on wrong guesses.
stdle-106.rb
1l=lambda{|a,b|puts"#{a}, #{b}"}
2begin
3l.call(1,2,3)
4rescueArgumentError=>e
5putse.message
6end
7l.call(1,2)
Blocks
Answer & explanation
Console output
wrong number of arguments (given 3, expected 2)
1, 2
Why
Unlike Procs, lambdas enforce arity strictly. Calling with the wrong number of arguments raises `ArgumentError`. After rescuing, the correct call with two arguments succeeds.