[#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:00321] Re: Arity features for Proc object?
From:
gotoken@... (GOTO Kentaro)
Date:
1999-05-17 11:09:10 UTC
List:
ruby-talk #321
In message "[ruby-talk:00320] Re: Arity features for Proc object?"
on 99/05/17, Yukihiro Matsumoto <matz@netlab.co.jp> writes:
>Well, well, I opened eval.c to see how hard to implement arity and
>arugument check for block evaluation, and then spent about 1 hour, now
>you see, it's done. :-)
I've done already?? How quick your hack is!!
>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.
Great! it seems suitable spec. Is to use Method#arity as follows??
# obj.method(:method_name).arity
# e.g.
"a".method(:concat).arity #=> 1 (correct?)
> proc = Proc.new{|i,| ..} # explicitly declare single argument
> proc.call(a,b)
Well, Is this feature - camma-trailing block parameter - documented
anywhare??
>and
>
> proc = Proc.new{|i,j| ..} # more than two arguments
> proc.call(a,b,c)
>
>will cause ArgumentError exception, just like methods.
>I think it does not break any existing code.
I see. It is very what I want.
tons of thanks!!
-- gotoken