From: The Higgs bozo Date: 2009-04-23T02:34:06+09:00 Subject: Re: How to distinguish blocks of certain arity in 1.8 unknown wrote: > Hi all, > > I'd like to distinguish the two following blocks by means of their > arity, but in Ruby 1.8 I don't see how to do this as Proc#arity > returns the same value. > > lambda {}.arity => -1 > lambda {|*a|}.arity => -1 I suppose the answer is that they have the same arity. These are all legal lambda {}.call lambda {}.call :hello lambda {}.call :hello, :world lambda { |*a| }.call lambda { |*a| }.call :hello lambda { |*a| }.call :hello, :world From the caller's point of view, I see nothing which would distinguish one from the other. -- Posted via http://www.ruby-forum.com/.