3

Key differences between proc and lambda?

What is a lambda and what is a proc?

And how are they each used?

RoR
  • 15,934
  • 22
  • 71
  • 92
  • possible duplicate of [What's the difference between a proc and a lambda in Ruby?](http://stackoverflow.com/questions/1740046/whats-the-difference-between-a-proc-and-a-lambda-in-ruby) – Nakilon Jun 19 '12 at 07:28

1 Answers1

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

Community
  • 1
  • 1
Sachin Shanbhag
  • 54,530
  • 11
  • 89
  • 103