From: "David A. Black" Date: 2008-04-18T19:43:49+09:00 Subject: Re: When are lambdas needed? Hi -- On Fri, 18 Apr 2008, Ken Bloom wrote: > The difference between lambda and the other ways of getting a Proc object > is that lambda treats return, next, and break a little bit differently. It's actually a difference between lambda and proc (which are synonyms), on the one hand, and Proc.new on the other: irb(main):009:0> lambda { return }.call => nil irb(main):010:0> proc { return }.call => nil irb(main):011:0> Proc.new { return }.call LocalJumpError: unexpected return Since it's a bit confusing to have proc and Proc.new be different, this has been changed in 1.9: proc and Proc.new are the same in 1.9, and lambda is different. (I still have no idea how to memorize which is which.) David -- Rails training from David A. Black and Ruby Power and Light: INTRO TO RAILS June 9-12 Berlin ADVANCING WITH RAILS June 16-19 Berlin INTRO TO RAILS June 24-27 London (Skills Matter) See http://www.rubypal.com for details and updates!