[#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:00316] Re: Arity features for Proc object?
From:
gotoken@... (GOTO Kentaro)
Date:
1999-05-17 07:12:27 UTC
List:
ruby-talk #316
In message "[ruby-talk:00315] Re: Arity features for Proc object?"
on 99/05/17, Yukihiro Matsumoto <matz@netlab.co.jp> writes:
>|Would it be possible to add arity feature to the Proc object.
>|So that one could easily determine the required args for a user passed
>|Proc in a function.
>
>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...
>Is it the feature to determin whether a proc requires arguments? Or
>the feature to retrieve the argument information (number, names,
>type)?
>
>I think the former is possible, the latter is ... I don't know. I'm
>sure the latter is very hard even if possible.
I guess the former; I also don't understand why Proc does not
check number of arguments whareas any method do:
% ruby -e 'Proc.new{|i,j| p [i,j]}.call(1,2,3)'
[1, 2]
% ruby -e 'def a(i,j); p [i,j]; end; a(1,2,3)'
/tmp/rbMd8430:1:in `a': wrong # of arguments(3 for 2) (ArgumentError)
from /tmp/rbMd8430:1
-- gotoken