From: matz@... (Yukihiro Matsumoto) Date: 1999-05-24T14:41:31+09:00 Subject: [ruby-talk:00337] Re: Arity features for Proc object? Hi. In message "[ruby-talk:00336] Re: Arity features for Proc object?" on 99/05/24, GOTO Kentaro writes: |In message "[ruby-talk:00320] Re: Arity features for Proc object?" | on 99/05/17, Yukihiro Matsumoto writes: |>I defined two methods, Proc#arity, and Method#arity, which return the |>number of required arguments for the Proc and Method objects. If they |>accepts variable number of arguments, the arity return negative number. | |% ruby -e 'p lambda{}.arity' |-1 |% ruby -e 'p lambda{|i|}.arity' |-2 | |Well, I expect 0 for the former and -1 for the latter. The negative number is -(n+1) where n is least required number of arguments The former seems to accepts zero argument, but actually accepts arbitrary number of arguments (for compatibility reason), so arity returns a negative number. matz.