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

From: matz@... (Yukihiro Matsumoto)
Date: 1999-05-17 08:19:01 UTC
List: ruby-talk #318
Hi.

In message "[ruby-talk:00316] Re: Arity features for Proc object?"
    on 99/05/17, GOTO Kentaro <gotoken@math.sci.hokudai.ac.jp> writes:

|>Hmm, what is ARITY?  Does somebody know that word in Japanese??
|
|Arity is (called `ariti-' in Japan :-) number of arguments. 
|It is part of method signitures.  For example arity of `to_s' is 0, 
|of `+' is 1, of `print' is variable...

I see.  Thank you.  I expected you to answer this question, Gotoken.

|>Is it the feature to determin whether a proc requires arguments?  Or
|>the feature to retrieve the argument information (number, names,
|>type)?
|>

|I guess the former; I also don't understand why Proc does not
|check number of arguments whareas any method do:

Parameter assignment for blocks is done by multiple assignment, which
does not do the number check.  I know it's little bit weird for Proc
objects, but the Proc is relatively new feature to Ruby.  I couldn't
ignore compatibility.  I would add argument number check to the Proc
objects in the future version, maybe.

Anyway, I understand Pros' request.  I will put it into my ToDo list.
Maybe for the version after 1.4, which is my first priority.

                                                matz.

In This Thread