Class LetVal

java.lang.Object
  extended by LetVal
All Implemented Interfaces:
Expression

public class LetVal
extends java.lang.Object
implements Expression


Constructor Summary
LetVal(java.lang.String name, Expression valueExpr, Expression bodyExpr)
           
 
Method Summary
 Value eval(Environment env)
          Evaluate this expression.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LetVal

public LetVal(java.lang.String name,
              Expression valueExpr,
              Expression bodyExpr)
Method Detail

eval

public Value eval(Environment env)
Description copied from interface: Expression
Evaluate this expression. When an Expression is evaluated, this must happen in some particular environment. For example, evaluating the variable x in one environment might produce a totally different value than evaluating it in another environment.

Specified by:
eval in interface Expression
Parameters:
env - the environment in which the expression should be evaluated
Returns:
the value produced by the expression