From tlumley at u.washington.edu  Wed Oct 10 20:10:50 2007
From: tlumley at u.washington.edu (Thomas Lumley)
Date: Wed, 10 Oct 2007 11:10:50 -0700 (PDT)
Subject: [Rd] documentation of .C (PR#9948)
In-Reply-To: <20071010143518.573DC288008C@mail.pubhealth.ku.dk>
References: <20071010143518.573DC288008C@mail.pubhealth.ku.dk>
Message-ID: <Pine.LNX.4.64.0710101109540.26217@homer24.u.washington.edu>

On Wed, 10 Oct 2007, schlather at math.uni-goettingen.de wrote:

> Full_Name: Martin Schlather
> Version: R version 2.7.0 Under development (unstable) (2007-10-01 r43043)
> OS: Linux
> Submission from: (NULL) (91.3.209.203)
>
>
> Hi,
>
> There are 2 dangers with using 'DUP=FALSE' mentioned:
>  * formal arguments
>  * lists
>
> Would you also mention a third one, namely
> that values in R are now only referenced  whenever
> possible and not always copied; hence .C(..., DUP=FALSE)
> may change the values of other local variables.
>

How about a warning like

"if you pass a local variable to .C/.Fortran with 
DUP=FALSE, your compiled code can alter the local variable and not just 
the copy in the return list. "

 	-thomas

(copied from ?.C, of course)



[Rd] documentation of .C (PR#9948)
Thomas Lumley