From berwin at maths.uwa.edu.au  Thu Apr  8 12:32:35 2010
From: berwin at maths.uwa.edu.au (Berwin A Turlach)
Date: Thu, 8 Apr 2010 18:32:35 +0800
Subject: [Rd] LOGICAL arguments in FORTRAN code
Message-ID: <20100408183235.4185aa65@bossiaea>

G'day all,

I just took over maintenance of the quadprog package from Kurt Hornik
and noticed that one of the FORTRAN routines has an argument that is
declared to be a LOGICAL.  The R code that calls this routine (via
the .Fortran interface) passes the argument down wrapped in a call to
as.logical().

This was fine (and as documented) under S-Plus 3.4, for which this code
was originally developed.  However, as far as I know, in R objects of
storage mode logical were always supposed to be passed to FORTRAN
arguments of type INTEGER; and that is what the current "Writing R
extension manual states".

Thus, given that the port of quadprog existed for quite some time, I
am wondering whether it is o.k. to pass R objects with storage mode
logical into FORTRAN code to arguments declared as LOGICAL?  Or should
the FORTRAN code be corrected to declare the argument in question as
INTEGER?   

Cheers,

	Berwin



[Rd] LOGICAL arguments in FORTRAN code
Berwin A Turlach