First of all, yes, R stores its environments differently, potentially even with a different differentiation between the baseenv, the emptyenvand other default environments. Yet, during dataflow we want sometimes to know more (static reference information) and sometimes know less (to be honest we do not want that, but statically determining all attached environments is theoretically impossible --- consider attachments by user input). One example would be maps holding a potential list of all definitions of a variable, if we do not know the execution path (like with if(x) A else B).

interface REnvironmentInformation {
    current: IEnvironment;
    level: number;
}

Implemented by

Properties

Properties

current: IEnvironment

The currently active environment (the stack is represented by the currently active IEnvironment#parent). Environments are maintained within the dataflow graph.

level: number

nesting level of the environment, will be 0 for the global/root environment