From: Logan Capaldo Date: 2006-03-09T03:29:07+09:00 Subject: Re: type at rubycentral? On Mar 8, 2006, at 10:08 AM, Sch�le Daniel wrote: > and one case is missing there > > irb(main):169:0> proc{}.arity > => -1 > > which means, all paramers are ignored(right?) > > Negative arities indicate the _minimum_ number of args to a proc that takes a variable number of args min args = abs(arity + 1) if arity < 0 otherwise arity so a proc with no arg speciafication is the same as proc { |*args| }. (You just can't get at the argument list) proc { |a, *b| } will have an arity of -2 abs(-2 + 1) = 1 so it must be passed at least one arg proc { |a, b, c| } will have an arity of 3 proc { || } will have an artity of zero (contrasted with proc { } )