Class ActivationRecord

java.lang.Object
  extended by ActivationRecord
All Implemented Interfaces:
Environment

public class ActivationRecord
extends java.lang.Object
implements Environment

An ActivationRecord is an environment in which one new name is bound to some value, while all other names retain the values they have in some pre-existing outer environment, accessed via a nesting link.


Constructor Summary
ActivationRecord(java.lang.String name, java.lang.Object value, Environment nestingLink)
          Creates an activation record that binds a name to an ordinary value.
ActivationRecord(java.lang.String functionName, java.lang.String parameterName, Expression functionBody, Environment nestingLink)
          Creates an activation record that binds a name to a (possibly recursive) function.
 
Method Summary
 java.lang.Object get(java.lang.String name)
          Return the value corresponding to the specified name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ActivationRecord

public ActivationRecord(java.lang.String name,
                        java.lang.Object value,
                        Environment nestingLink)
Creates an activation record that binds a name to an ordinary value. This is the kind of binding used for ML's "val".

Parameters:
name - the name being bound
value - the value the name is bound to
nestingLink - the environment being augmented

ActivationRecord

public ActivationRecord(java.lang.String functionName,
                        java.lang.String parameterName,
                        Expression functionBody,
                        Environment nestingLink)
Creates an activation record that binds a name to a (possibly recursive) function. This is the kind of binding used for ML's "fun".

Parameters:
functionName - the name being bound
parameterName - the function's parameter
functionBody - the function's body
nestingLink - the environment being augmented
Method Detail

get

public java.lang.Object get(java.lang.String name)
Description copied from interface: Environment
Return the value corresponding to the specified name.

Specified by:
get in interface Environment
Parameters:
name - the name to look up
Returns:
the value associated with the name