From: Brian Candler Date: 2011-04-20T03:19:04+09:00 Subject: Re: anonymous closures with Proc,new, lambda and -> 7stud -- wrote in post #993798: > Where does this syntax come from? > > closed = Proc.new(over=0){over+=1} It's invalid in 1.8: >> Proc.new(0) {} ArgumentError: wrong number of arguments (1 for 0) from (irb):2:in `initialize' from (irb):2:in `new' from (irb):2 from :0 But accepted in 1.9.2: >> Proc.new(0) {} => # Seems to be undocumented, like much of ruby 1.9. http://ruby-doc.org/core/classes/Proc.html I can't see any obvious purpose for these args: irb(main):006:0> c = Proc.new(1,2,3) { |x,y,z| p x,y,z } => # irb(main):007:0> c.call(5) 5 nil nil => [5, nil, nil] -- Posted via http://www.ruby-forum.com/.