tags:

views:

52

answers:

1

Key differences between proc and lambda?

What is a lambda and what is a proc?

And how are they each used?

+2  A: 

Just found few links. These might be helpful for you -

http://www.skorks.com/2010/05/ruby-procs-and-lambdas-and-the-difference-between-them/

also possible duplicate of -

http://stackoverflow.com/questions/626/when-to-use-lambda-when-to-use-proc-new

additionally taken from the below link -

lambda handles arguments exactly as a Ruby method; pass less or more arguments than the function expects, and you get an ArgumentError. Proc.new tolerates errors; if you call it with less arguments than specified, the rest are set to nil; if you specify more, the ones in excess are ignored.

http://raulparolari.com/Ruby2/lambda_Proc

Sachin Shanbhag