From: "Mauricio Fernández" Date: 2005-11-23T17:40:30+09:00 Subject: Re: what is the ruby way to do this? On Wed, Nov 23, 2005 at 01:58:01PM +0900, Joel VanderWerf wrote: > It's not completely useless: > > irb(main):001:0> noargs = proc { || 3 } > => # > irb(main):002:0> noargs[] > => 3 > irb(main):003:0> noargs[2] > ArgumentError: wrong number of arguments (1 for 0) > from (irb):3 > from (irb):3 Maybe not for long [lambda{ }.arity, RUBY_VERSION] # => [0, "1.9.0"] vs. [lambda{ }.arity, RUBY_VERSION] # => [-1, "1.8.3"] -- Mauricio Fernandez