From: nobu.nokada@... Date: 2003-11-28T01:10:42+09:00 Subject: Re: arity of methods defined with define_method Hi, At Thu, 27 Nov 2003 23:52:08 +0900, Paul Brannan wrote: > I would expect that a method that can take any number of arguments would > have an arity of -1. Why is this not the case with methods defined with > define_method()? It's a bug. * eval.c (method_arity): used wrong Proc object. [ruby-talk:86504] Index: eval.c =================================================================== RCS file: /cvs/ruby/src/ruby/eval.c,v retrieving revision 1.597 diff -u -2 -p -r1.597 eval.c --- eval.c 27 Nov 2003 15:47:33 -0000 1.597 +++ eval.c 27 Nov 2003 16:06:46 -0000 @@ -7602,5 +7602,5 @@ method_arity(method) case NODE_BMETHOD: case NODE_DMETHOD: - return proc_arity(method); + return proc_arity(body->nd_cval); default: body = body->nd_next; /* skip NODE_SCOPE */ -- Nobu Nakada