public class Env extends Iced
An Env (environment) object is a classic stack of values used during execution of an AstRoot. The stack is hidden in the normal Java execution stack and is not explicit.
For efficiency, reference counting is employed to recycle objects already in use rather than creating copies upon copies (a la R). When a Frame is `pushed` on to the stack, its reference count is incremented by 1. When a Frame 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.
Therefore, the Env class is a stack of values + an API for reference counting.
Modifier and Type | Class and Description |
---|---|
class |
Env.StackHelp |
Modifier and Type | Field and Description |
---|---|
AstFunction |
_scope |
Session |
_ses |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
expand(java.lang.String id) |
Val |
lookup(java.lang.String id) |
<V extends Val> |
returning(V val) |
int |
sp() |
Env.StackHelp |
stk() |
java.lang.String |
toString() |
asBytes, clone, copyOver, frozenType, read, readExternal, readJSON, reloadFromBytes, toJsonBytes, toJsonString, write, writeExternal, writeJSON
public final Session _ses
public AstFunction _scope
public Env(Session ses)
public int sp()
public Env.StackHelp stk()
public <V extends Val> V returning(V val)
public Val lookup(java.lang.String id)
public java.lang.String expand(java.lang.String id)
public java.lang.String toString()
toString
in class java.lang.Object