- All Implemented Interfaces:
- java.lang.Cloneable, Freezable
public class Env
extends Iced
Execute a set of instructions in the context of an H2O cloud.
An Env (environment) object is a classic stack of values used during the execution of a Program (see Program.java
for more details on what makes a Program a Program). The Program itself may be a single `main` program or an array
of programs. In the latter case, additional programs represent a user-defined function that is at some point called
by the main program.
Each Program will have a new instance of Env so as to preserve the functional aspects of the R language (lexical
scoping, functions are first class, etc.).
For efficiency, reference counting is employed to recycle objects already in use rather than creating copies upon
copies (a la R). When a Vec is `pushed` on to the stack, its reference count is incremented by 1. When a Vec is
`popped` off of the stack, its reference count is decremented by 1. When the reference count is 0, the Env instance
will dispose of the object. All objects live and die by the Env's that create them. That means that any object not
created by an Env instance shalt not be DKV.removed. Every Env has a set of these.
Therefore, the Env class is a stack of values + an API for reference counting.