creating environments in package's C code
On Oct 1, 2009, at 11:33 , Martin Becker wrote:
Dear developers, is it possible to create environments in C code of packages? Simply using SEXP env; PROTECT (env = allocSExp(ENVSXP)); and assigning the enclosing environment with SET_ENCLOS seems to be insufficient.
Rf_NewEnvironment is the function that does it, e.g., Rf_NewEnvironment(R_NilValue, R_NilValue, parent) it's not part of the official API (headers) but it is visible. For hashed environments it's R_NewHashedEnv(). Cheers, Simon