Re: [Rd] symbol.For problem? (PR#7974)

From: <murdoch_at_stats.uwo.ca>
Date: Tue 28 Jun 2005 - 02:08:34 GMT


jbremson@neyman.ucdavis.edu wrote:
>
> It seems as though 'symbol.For' does not work correctly.

>>library("foo")
>>add(3,4)

>
> [1] 7
>
>>sym.add(3,5)

>
>
> Error in .Fortran(symbol.For("add"), as.numeric(a), as.numeric(b), c = as.numeric(0)) :
> "Fortran" function name not in load table

I don't see why you think this should have worked. symbol.For shows you how the name would be translated between the function name and the name that .Fortran looks for in the load table. It looks like you're asking for the translation to be done twice.

Is this documented somewhere as something that should work?

Duncan Murdoch
>
> The function 'add' is a R wrapper to a simple fortran 77 subroutine that adds two numbers.
> In 'add' the .Fortran call looks like this:
> .Fortran("add",...)
>
> In 'sym.add' the .Fortran call looks like this:
> .Fortran(symbol.For("add"),...)
>
> symbol.For works correctly if there is an underscore in the name though.
>
> I have tested this on OSX and linux and get the same results.
>
> I have a test package written up if anyone wants it. Email me
> at jbremson@wald.ucdavis.edu.
>
>
>
>
> --please do not edit the information below--
>
> Version:
> platform = i686-pc-linux-gnu
> arch = i686
> os = linux-gnu
> system = i686, linux-gnu
> status =
> major = 2
> minor = 1.0
> year = 2005
> month = 04
> day = 18
> language = R
>
> Search Path:
> .GlobalEnv, package:foo, package:methods, package:stats, package:graphics, package:grDevices, package:utils, package:datasets, Autoloads, package:base
>
> ______________________________________________
> R-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel



R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Tue Jun 28 12:11:20 2005

This archive was generated by hypermail 2.1.8 : Mon 24 Oct 2005 - 22:27:22 GMT