[#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:00322] Re: Arity features for Proc object?
From:
matz@... (Yukihiro Matsumoto)
Date:
1999-05-18 00:59:45 UTC
List:
ruby-talk #322
Hi.
In message "[ruby-talk:00321] Re: Arity features for Proc object?"
on 99/05/17, GOTO Kentaro <gotoken@math.sci.hokudai.ac.jp> writes:
|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?)
Yes. It works.
|> proc = Proc.new{|i,| ..} # explicitly declare single argument
|> proc.call(a,b)
|
|Well, Is this feature - camma-trailing block parameter - documented
|anywhare??
This is feature. Remember the block parameters are the left hand side
of multiple assignment. The syntax is:
expr `,' [expr `,'...] [`*' expr] = expr [, expr...][`*' expr]
`*' expr = expr [, expr...][`*' expr]
See? `expr, = expr' is legal left side.
|> 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.
There's restriction for the argument check; Check will not done if 0
or 1 block parameter given.
|tons of thanks!!
You can check this out from Open CVS <cvs.netlab.co.jp>.
matz.