From ripley at stats.ox.ac.uk  Sat Mar  3 18:29:21 2012
From: ripley at stats.ox.ac.uk (Prof Brian Ripley)
Date: Sat, 03 Mar 2012 17:29:21 +0000
Subject: [Rd] .C clarification
In-Reply-To: <1330782163.27537.24.camel@nemo>
References: <1330782163.27537.24.camel@nemo>
Message-ID: <4F5254F1.7010400@stats.ox.ac.uk>

On 03/03/2012 13:42, Terry Therneau wrote:
> Does .C duplicate unnecessary arguments?  For instance
>    fit<- .C("xxx", as.integer(n), x, y, z=double(15))
>
> The first and fourth arguments would have NAMED = 0. Is my guess that .C
> won't make yet one more (unnecessary) copy correct?

.C's internals (do_dotcode) does not know about NAMED.  It duplicates 
(unless DUP=FALSE).

Use .Call if you want to control duplication.

> (Just trying to understand).
>
> Terry T
>
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel


-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595



[Rd] .C clarification
Prof Brian Ripley