From: Robert Dober Date: 2008-11-12T19:06:55+09:00 Subject: Re: unexpected return (LocalJumpError) On Wed, Nov 12, 2008 at 9:52 AM, Brian Candler wrote: > For the differences between lambda and Proc, including a lot of gory > detail, see > http://innig.net/software/ruby/closures-in-ruby.rb or better dont, All you need to know is that lambda and Proc::new behave as they are designed to behave, therefore the behavior you encountered is not a bug but a feature as surprising as that comes to most of us ;). IIRC this will change in 1.9 To better understand what really happens just run this code: def a blk b blk puts :in_a end def b blk c blk puts :in_b end def c blk blk.call puts :in_c end def main #a lambda{ puts :in_lambda; return; puts :nonsense} #a Proc::new{ puts :in_proc; return; puts :nonsense} puts :in_main end -- > Posted via http://www.ruby-forum.com/. > > -- C'est véritablement utile puisque c'est joli. Antoine de Saint Exupéry