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 w

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 insu

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

2009-10-01 Thread Simon Urbanek
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 with SET_ENCLOS seems t

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

2009-10-01 Thread Jeff Horner
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 insufficient. Best wishes, Here's a functio

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

2009-10-01 Thread Simon Urbanek
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

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 t

[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 S