DEV Community

Discussion on: Intro To Ruby Procs and Lambdas(and the difference)

Collapse
 
abeidahmed profile image
Abeid Ahmed

I have to agree with @darkwiiplayer on this one. As far as the syntax is concerned, procs can be created using proc, Proc.new and Kernel.proc.
As far as the differences are concerned, there are two big differences in my opinion.

  1. How the two handles the return statement.
  2. Proc can silently discard extra params and missing params are set to nil, whereas lambda complains.