[Rd] Summary: too many arguments in foreign function call

Warnes, Gregory R gregory_r_warnes@groton.pfizer.com
Wed, 18 Jul 2001 12:23:53 -0400

OK, to summarize and clarify a bit

1) I downloaded some code that existed in "pure" FORTRAN, FORTRAN+S-Plus,
and FORTRAN+R versions.  

2) I discovered that the primary difference between R and S-Plus version was
the use of a wrapper to reduce the number of arguments from 87 to 65.   When
I inquired why, the author of the code replied

	"R won't take more than 65 arguments to the FORTRAN code 
	(I have no idea why they would have this restriction, it
	seems ludicrous to me. Anyway, the 65 limit is why I combined 
	all those arguments (they were originally explicitly passed)."

He also noted that the 65 argument restriction is not present in Splus 5.

3) I posted a patch to change the limit on the number of parameters to .C,
.Fortran, and .Call from 65 to 255.  

4) I asked if this patch, or something like it would appear in the next
release of R because I wanted to create a package that used the exact same
(simpler) code for R and S-Plus.

5) There was a debate on the merit of using .Fortran to handle a large
number of arguments.  Most people suggested one of 

	- write a wrapper function Fortran C or that accepts some set of
arguments as a single 	vector and that calls the original Fortran function.

	- write a wrapper function using .Call or .External

Several reasons were put forth for *not* extending the number of permissible
arguments.  The core point seemed to be that there have been few reports of
problems with the restriction, and there is uncertainty about the maximum
number of arguments an operating system will support.

6) I still feel that it is a reasonable change to increase the number of
permitted arguments, at least to the same limits (whatever they are) imposed
by S-Plus.  This seems simpler than telling users that as soon as they hit
65 arguments they have to change their code or learn a new interface


Unless expressly stated otherwise, this message is confidential and may be privileged. It is intended for the addressee(s) only. Access to this E-mail by anyone else is unauthorized. If you are not an addressee, any disclosure or copying of the contents of this E-mail or any action taken (or not taken) in reliance on it is unauthorized and may be unlawful. If you are not an addressee, please inform the sender immediately.
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch