From: matz@... (Yukihiro Matsumoto) Date: 2002-08-20T08:09:52+09:00 Subject: Re: Can't Have More Than 9 Mandatory/Optional Arguments in Ruby/C? Hi, In message "Can't Have More Than 9 Mandatory/Optional Arguments in Ruby/C?" on 02/08/19, William Djaja Tjokroaminata writes: |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? By using rb_scan_args(), yes. For that case (I believe it is very rare case), you can receive arguments via C argc/argv style (-1 for rb_define_method) or Ruby args style (-2), then check the number of argument by yourself. |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? I needed both style in the implementation of the Ruby class library. So I made both to reduce my effort. matz.