Interface Expression
- All Known Implementing Classes:
- Application, Conditional, Constant, LetFun, LetVal, Variable
public interface Expression
The representation of an expression; in other words, an AST.
eval
Value eval(Environment env)
- 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.
- Parameters:
env
- the environment in which the expression should be evaluated
- Returns:
- the value produced by the expression