Hi Paul,

I have read the definition of rb_scan_args() and probably I will not dare
to mess with changing ISDIGIT(); I think it will be really tricky.  And
for scanning the arguments themselves, you are perfectly right, it is
there for convenience; it is really inconvenient to write our own scanning
arguments.

Actually there is a deeper and wider question.  For example, in this case,
we can use either the -1-arity format or the -2-arity format.  How do you
choose among the two?  Do you consistently use only the -2-arity format
all the time?

The deeper and wider question is, has there been any published good
guidelines in writing Ruby-C extension?  It seems that even the Ruby C API
provides several possible ways of doing things.  Will it be beneficial if
someone tries to compile all the known good practice and possible pitfalls
in combining Ruby and C?  Currently my guess is, a good knowledge of C
by itself and a good knowledge or Ruby by itself is still not 100%
adequate for writing a good Ruby-C combination; they need to be
complemented with this additional knowledge.

Regards,

Bill
=============================================================================
Paul Brannan <pbrannan / atdesk.com> wrote:
> On Mon, Aug 19, 2002 at 11:28:24PM +0900, William Djaja Tjokroaminata wrote:
>> 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?

> Well, you could change the definition of isdigit(), and then you can get
> as many arguments as you want. :)

> Or, you can scan the arguments yourself.  There's no written rule that
> says you have to use rb_scan_args(); it's only there for convenience.

> Paul