[Rd] creating environments in package's C code

2009-10-01 Thread Martin Becker
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. Best wishes, Martin -- Dr. Martin Becker Statistics and Econometrics

Re: [Rd] creating environments in package's C code

2009-10-01 Thread Jeff Horner
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. Best wishes, Here's a function I use in rapache

Re: [Rd] creating environments in package's C code

2009-10-01 Thread Duncan Murdoch
On 10/1/2009 12:37 PM, Jeff Horner wrote: Jeff Horner wrote: 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

Re: [Rd] creating environments in package's C code

2009-10-01 Thread Jeff Horner
Simon Urbanek wrote: Jeff, On Oct 1, 2009, at 12:37 , Jeff Horner wrote: Jeff Horner wrote: 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