ix.util.lisp
Class Interpreter.LexicalEnv
java.lang.Object
ix.util.lisp.Interpreter.AbstractEnv
ix.util.lisp.Interpreter.LexicalEnv
- All Implemented Interfaces:
- Interpreter.Env
- Enclosing class:
- Interpreter
public class Interpreter.LexicalEnv
- extends Interpreter.AbstractEnv
An environment for local values of variables.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
vars
Symbol[] vars
vals
java.lang.Object[] vals
enclosingEnv
Interpreter.LexicalEnv enclosingEnv
Interpreter.LexicalEnv
public Interpreter.LexicalEnv(Symbol[] vars,
java.lang.Object[] vals,
Interpreter.LexicalEnv next)
lookup
public java.lang.Object lookup(Interpreter.VarRef ref)
- Description copied from interface:
Interpreter.Env
- Returns the value bound to the variable by this environment.
bind
public Interpreter.Env bind(Symbol[] vars,
java.lang.Object[] vals)
- Description copied from interface:
Interpreter.Env
- Returns a new Env in which the variables are
bound to the corresponding values.
assign
public java.lang.Object assign(Interpreter.VarRef ref,
java.lang.Object val)
- Description copied from interface:
Interpreter.Env
- Changes the value bound to the variable and then
returns the new value. Note that this typically modifies
an existing binding relationship rather than create a
new one; however, a new one may be created, for instance
if the variable is not already bound.
findOffsets
protected void findOffsets(Interpreter.VarRef ref)
findIndex
protected int findIndex(Symbol var)