3

Key differences between proc and lambda?

What is a lambda and what is a proc?

And how are they each used?

1

1 Answer 1

2

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.