[ruby-talk:00336] Re: Arity features for Proc object?

From: gotoken@... (GOTO Kentaro)
Date: 1999-05-24 05:21:50 UTC
List: ruby-talk #336
Hi,

In message "[ruby-talk:00320] Re: Arity features for Proc object?"
    on 99/05/17, Yukihiro Matsumoto <matz@netlab.co.jp> 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. 

# Sorry for replying after such a long time. 

-- gotoken

In This Thread