Ruby lambdas versus procsEdit
Lambdas:
- written using
lambda {}syntax - check passed-in arguments against the arity of the block (in Ruby >= 1.9)
returnreturns from the lambda
Procs:
- written using
proc {}orProc.new {}syntax - do not check passed-in arguments against the arity of the block
returnreturns from the enclosing scope