[R] "privileged slots",
Torsten.Steuernagel at gmx.de
Tue Jun 1 11:21:14 CEST 2004
On 28 May 2004 at 8:19, Duncan Murdoch wrote:
> I'd advise against doing this kind of optimization. It will make your
> code harder to maintain, and while it might be faster today, if "@<-"
> is really a major time sink, it's an obvious candidate for
> optimization in R, e.g. by making it .Internal or .Primitive. When
> that happens, your "optimized" code will likely be slower (if it even
> works at all).
Agreed. I don't recommend doing this either. I don't believe it makes
any difference using "slot<-" instead of "@<-" in real life. Anyway, that
"optimized" code should always work (slower or not) because "slot<-"
is fully documented and I don't see why it should be removed or its
behaviour should change. That wouldn't only break the kind of code
mentioned here but also everything else that makes use of "slot<-".
More information about the R-help