Hi,

In rb_scan_args() the char *fmt is specified as a string containing zero,
one, or two digits followed by some flag characters.  Does this plainly
mean that we cannot have more than 9 mandatory arguments?

At first glance it seems that we can have more than 9 optional arguments
by simply packing the rest of arguments into array, but this will not
limit how many arguments a user can specify.  The same is true by using
the "VALUE func (VALUE self, VALUE args)" format instead of the "VALUE
func (int argc, VALUE *argv, VALUE self)" format.  I prefer the later
because, combined with rb_scan_args(), we can specify how many mandatory
and optional arguments, which can be used to trap user's errors in using a
method.  (Well, we can also test RARRAY(args)->len, but it means it is
more work.)

Then, does this design mean that:

"VALUE func (VALUE self, VALUR args)" is the more general format, but it
requires more work for the C programmer.  "VALUE func (int argc, VALUE
*argv, VALUE self)" is more like a shortcut, but it comes with some limits
on the number of arguments.

?  Or is there any other design philosophy behind these two function
formats?

Regards,

Bill