[#300] Ruby 1.3.3-990507 — matz <matz@...>
Ruby 1.3.3-990507 is out, check out:
1 message
1999/05/07
[#314] Arity features for Proc object? — matz@... (Yukihiro Matsumoto)
A mail from <yeboah@tu-harburg.de> is somehow rejected by the list
12 messages
1999/05/17
[#315] Re: Arity features for Proc object?
— matz@... (Yukihiro Matsumoto)
1999/05/17
[#316] Re: Arity features for Proc object?
— gotoken@... (GOTO Kentaro)
1999/05/17
In message "[ruby-talk:00315] Re: Arity features for Proc object?"
[#318] Re: Arity features for Proc object?
— matz@... (Yukihiro Matsumoto)
1999/05/17
Hi.
[#319] Re: Arity features for Proc object?
— gotoken@... (GOTO Kentaro)
1999/05/17
In message "[ruby-talk:00318] Re: Arity features for Proc object?"
[#320] Re: Arity features for Proc object?
— matz@... (Yukihiro Matsumoto)
1999/05/17
Hi.
[#323] binding — Pros Yeboah <yeboah@...>
Hi
5 messages
1999/05/18
[#357] thinking aloud — "Bryce Dooley" <thecrow@...>
First off, I think Ruby is a very nice scripting language.
7 messages
1999/05/29
[ruby-talk:00337] Re: Arity features for Proc object?
From:
matz@... (Yukihiro Matsumoto)
Date:
1999-05-24 05:41:31 UTC
List:
ruby-talk #337
Hi.
In message "[ruby-talk:00336] Re: Arity features for Proc object?"
on 99/05/24, GOTO Kentaro <gotoken@math.sci.hokudai.ac.jp> writes:
|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.
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.