Skip to content

when .Call can safely modify its arguments

2 messages · Vadim Ogranovich, Brian Ripley

#
On Sat, 28 Feb 2004, Vadim Ogranovich wrote:

            
I don't think anything can, but there is no advantage over using

data <- .Call("populate_list", data)

which makes the intention much clearer.

We would rather you didn't name objects the same as R system functions, 
though.
Nothing.  If the call to getData is of the form

foo <- getData()
bar <- foo

then foo and bar are still the same object, but if either is subsequently 
changed (at R level) it will be copied before being changed.


The way to understand internal details like this is to study the current
source code.  They do change from time to time, and we do find errors from 
time to time.