This is the mail archive of the guile@cygnus.com mailing list for the guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: max # of args in gsubr?


Valentin Kamyshenko <val@kamysh.materials.kiev.ua> writes:

> Hello,
> 
> I'm writing a small wrapper for fortran routines, and faced with the
> above limitation. After quick look through the guile sources I
> have found the evident place, where it is defined/used -- the
> libguile/gsubr.h. But, so far as I understood, the limitation
> SCM_GSUBR_MAX = 10 is quite arbitrary, and, as it is used in
> SCM_GSUBR_MAKTYPE and SCM_GSUBR_REQ() ..., I could use up to 15
> required, and up to 15 optional parameters. Is it true? Also, may I
> use (in principle) more than 17 bits for having, let say, 31 required,
> 31 optional and 1 'rest' parameter (that is, SCM_GSUBR_MAKTYPE would 
> return 0x7ff) after evident changes in gsubr.h and having all the
> other code untouched?

The maximum of 10 is arbitrary, but must agree with the number
of cases handled in the gsubr apply function.  There is no reason
that more of the bits in the car of a gsubr might not be used to
allow a larger number of arguments.