[R] Functioning and source code location of .Primitive()

Stefano Baraldo stefano.baraldo at gmail.com
Mon May 24 10:03:57 CEST 2010


Hi all.
I began examining the R source code in the last few days, for a better understanding of its structure. I read the manuals and digged deeply (maybe not enough?) into the source code, but I couldn't totally understand how .Primitive() works. Its effects, if I understand well, are quite clear to me (calling the C compiled counterpart of a "primitive" function), but where is its definition? The only things I was able to find were:
-in src/library/base/R/zzz.R, its creation in the .ArgsEnv environment, but with NULL body!
-in src/main/names.c, the association of .Primitive() to the C function do_primitive, which I cannot find anywhere else in the source code.
Does any of you know where should I look?
Thank you!

Stefano Baraldo


More information about the R-help mailing list