ix.util.lisp
Class Interpreter.GlobalEnv

java.lang.Object
  extended by ix.util.lisp.Interpreter.AbstractEnv
      extended by ix.util.lisp.Interpreter.GlobalEnv
All Implemented Interfaces:
Interpreter.Env
Enclosing class:
Interpreter

public class Interpreter.GlobalEnv
extends Interpreter.AbstractEnv

A global / top-level environment.


Field Summary
(package private)  java.util.Map varToValMap
           
 
Constructor Summary
Interpreter.GlobalEnv()
           
 
Method Summary
 java.lang.Object assign(Interpreter.VarRef ref, java.lang.Object val)
          Changes the value bound to the variable and then returns the new value.
 java.lang.Object assign(Symbol var, java.lang.Object val)
           
 Interpreter.Env bind(Symbol[] vars, java.lang.Object[] vals)
          Returns a new Env in which the variables are bound to the corresponding values.
 java.lang.Object lookup(Interpreter.VarRef ref)
          Returns the value bound to the variable by this environment.
 java.lang.Object lookup(Symbol var)
           
 
Methods inherited from class ix.util.lisp.Interpreter.AbstractEnv
defaultValue, isTrue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

varToValMap

java.util.Map varToValMap
Constructor Detail

Interpreter.GlobalEnv

public Interpreter.GlobalEnv()
Method Detail

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.


lookup

public java.lang.Object lookup(Symbol var)

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.


assign

public java.lang.Object assign(Symbol var,
                               java.lang.Object val)