Hi,
In message "[ruby-talk:01048] Extract args from binding?"
on 00/01/04, Andrew Hunt <andy / Toolshed.Com> writes:
|Is there an easy way in Ruby to get the arguments of the function
|from a binding? (In the C code, this would be the argc,argv from the
|frame within the binding.) How can I access that from Ruby?
Hmm, there's no easy way.
Maybe adding some method to Binding object would work.
BTW, Proc and Method objects have `arity' method to tell number of
formal arguments.
p self.method("foobar").arity
Negative number means number of required argument in 1's complement.
it's not always informative, because almost all method with variable
number of arguments which is defined in C, reports -1.
matz.