Class Application

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

public class Application
extends java.lang.Object
implements Expression

An Application is an expression that when evaluated applies a function (found by evaluating the operator) to some argument value (found by evaluating the operand).


Constructor Summary
Application(Expression operator, Expression operand)
          Create an Application with the specified components.
 
Method Summary
 java.lang.Object eval(Environment env)
          Evaluate this expression.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Application

public Application(Expression operator,
                   Expression operand)
Create an Application with the specified components.

Parameters:
operator - the expression which computes the function
operand - the expression which computes the argument
Method Detail

eval

public java.lang.Object 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