[Rd] capturing value of C or Fortran function

From: Harris A. Jaffee <hjaffee_at_jhmi.edu>
Date: Wed 13 Dec 2006 - 16:56:13 GMT


Re: src/main/dotcode.c:do_dotCode()

The value, if there is one, of a function called by .C or .Fortran is not captured, so one needs a wrapper. To avoid that, the user would have to declare that there is a value, specify its type, and supply an R variable to hold the value. Presumably, all of these could be combined in a new "VALUE=var" parameter. Then do_dotCode could arrange the correct type of C variable to receive the value (for every one of the 66 possible instances of the call), and then transfer that value to 'var'. It seems doable with a strong enough macro, if a bit complicated. Or one could say VALUE=<type> and get the value as a new, (n+1)_th element of the current list value.

Of course, existing code naming an argument with "VALUE" would break, so a completely new interface, perhaps .C.function(), .Fortran.function(), would be required to avoid that.

Has this facility been ruled out?



R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Thu Dec 14 05:59:18 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Mon 18 Dec 2006 - 21:30:56 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.