Hi,
 
"Writing R Extensions Guide" clearly states that a C-function interfaced
via .Call() should not modify any of its arguments. However I wonder if
there are exceptions to this rule, i.e. when .Call can safely modify the
arguments. For example when a function creates a list that is then
populated by a call to a C function:
 
getData <- function() {
    data <- list(a=double(2), b=character(3))
 
    # now populate_list modifies data
    .Call("populate_list", data) 
 
    data
}
 
 
What can go wrong in this example?
 
And while we are here I wonder what happens to 'data' when getData()
returns it. Is it copied or some more efficient mechanism is used?
 
Thanks,
Vadim

	[[alternative HTML version deleted]]


