Skip to content

Consider new default for Environment ctor / new_env() static function #215

@kevinushey

Description

@kevinushey

Currently, the default constructor for the Environment class is implemented as:

Environment_Impl() : data(R_GlobalEnv){}

IMO this is silly because we already have a static global_env() function -- preferably, this function should return an empty environment (perhaps with parent as the empty env, since that is a preferable default).

Of course, this would be a breaking change and so we may already be locked in -- so maybe a static function like the following would be a suitable alternative:

static Environment_Impl new_env() {
     // create a new environment with parent as empty env
}

static Environment_Impl new_env(SEXP parent) {
    // create environment with some parent
}

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions