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 functionName, java.lang.String parameterName, Expression functionBody, Environment nestingLink)
          Creates an activation record that binds a name to a value that is a (possibly recursive) function.
ActivationRecord(java.lang.String name, Value value, Environment nestingLink)
          Creates an activation record that binds a name to an ordinary value.
 
Method Summary
 Value get(java.lang.String name)
          Return the value corresponding to the specified name.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ActivationRecord

public ActivationRecord(java.lang.String name,
                        Value 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 value that is 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 Value 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