[#1611] set_trace_func/Array#fetch error — "Nathaniel Talbott" <nathaniel@...>

I've reduced the error I reported in ruby-talk:84013 to the following code:

17 messages 2003/10/11

Re: arity bug?

From: "Christoph" <chr_news@...>
Date: 2003-10-08 20:21:14 UTC
List: ruby-core #1594
Yukihiro Matsumoto wrote:
..
> |proc {  p 12 }[12,13]
> |
> |it feels that the arity of these Proc's is 0 and not the current -1.
> 
> Why don't you specify parameters explicitly if you want to get the
> argument.  Omitting parameters means "don't care".

But if I don't provide explicit parameters at definition time 
I see little reason why it should be allowed to supply superfluous
parameters at calling time. 
Anyway it is no big deal (arity = -1 works fine in any occasion) and 
it probably worked like this for ages - I just was really surprised when
I finally tripped over this fact.

/Christoph


In This Thread

Prev Next