net.christopherschultz.evaluator.function
Class LambdaFunction
java.lang.Object
net.christopherschultz.evaluator.function.LambdaFunction
- All Implemented Interfaces:
- Function
public class LambdaFunction
- extends Object
- implements Function
Creates an executable closure.
Usage: (lambda (arg1 arg2...) (exp1 exp2 exp3))
Returns the value of the last expression executed.
- Version:
- $Revision: 1.4 $ $Date: 2007-05-05 21:39:24 $
- Author:
- Chris Schultz
Method Summary |
Object |
call(EvaluationContext ec,
String functionName,
List argumentExpressions)
Invokes the function with the specified argument expressions in
the specified evaluation context. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LambdaFunction
public LambdaFunction()
call
public Object call(EvaluationContext ec,
String functionName,
List argumentExpressions)
throws EvaluationException
- Description copied from interface:
Function
- Invokes the function with the specified argument expressions in
the specified evaluation context.
- Specified by:
call
in interface Function
- Parameters:
ec
- The EvaluationContext in which this function is being called.functionName
- The name of the function being called.argumentExpressions
- The expressions which, when evaluated, result
in the arguments to the function.
- Returns:
- The result of the function.
- Throws:
EvaluationException
- If there is a problem evaluating any of
the arguments' expressions, or if there is
an error during function execution.