The book you are referring to is on Ruby 1.8.
In that version of Ruby, lambda
and procs
are effectively aliases, while Proc
is a different beast. This is obviously misleading, which is why it is not recommended that you use proc
as in
prc = proc {|x, y| puts x + y}
This syntax is considered deprecated and it is recommended using lambda in this case.
This is no longer valid for later versions of Ruby, starting with 1.9.