[Rd] Feature request: put NewEnvironment and R_NewhashedEnv into API

Prof Brian Ripley ripley at stats.ox.ac.uk
Wed Nov 15 07:20:06 CET 2006


On Tue, 14 Nov 2006, Seth Falcon wrote:

> Hi,
>
> I would like to be able to create new environments from package C
> code.  AFAICT, this isn't allowed since both NewEnvironment and
> R_NewHashedEnv are declared in Defn.R.

NewEnvironment is currently exposed as Rf_NewEnvironment.
R_NewHashedEnv is currrently hidden, but I'll unhide it.  It does not need 
a further prefix.

> If exposing this isn't controvertial, I would submit a patch.
> However, I'm not sure where the declarations should go (Rdefines.h?)
> and whether they need to change to Rf_*.

Rdefnes.h is a compatibility header, only used by those who want 
S4-compatible macros covering some of the definitions in Rinternals.h. 
Definitions can be moved from Defn.h to Rinternals.h with little trouble 
as the former includes the latter (you have to be careful about 
R_NO_REMAP, so declare them with Rf_).

If this is not controversial (I don't know if it is) and you want to 
submit a patch there should be a description in R-exts, I think somewhere 
in section 5.7 ('Handling R Objects in C').

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595



More information about the R-devel mailing list