On Wed, Nov 12, 2008 at 9:52 AM, Brian Candler <b.candler / pobox.com> 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/.
>
>



--=20
C'est v=E9ritablement utile puisque c'est joli.

Antoine de Saint Exup=E9ry