Key differences between proc and lambda?
What is a lambda and what is a proc?
And how are they each used?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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 –
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