Skip to content

Comment on Ruby's not readyparent

Comments

Could you give a more complete example? I'm getting sane behavior in Ruby 1.8.6:

  irb(main):010:0> f = lambda { i = 100; x = 0; [1,2,3].each { |i| x += i }; x}
  => #<Proc:0x05011b34@(irb):10>
  irb(main):011:0> f.call()
  => 6

you missed the fun:

    macbook-pro-2:trunk raganwald$ ruby -v
      => ruby 1.8.6 (2007-03-13 patchlevel 0) [i686-darwin8.10.1]
    macbook-pro-2:trunk raganwald$ irb
    irb(main):001:0> lambda { i = 100; x = 0; [1,2,3].each { |i| x += i }; i }.call
      => 3
AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.