|
Tea Java Runtime API Version 3.2.5 |
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectcom.pdmfc.tea.runtime.SLambdaFunction
public class SLambdaFunction
A function defined inside a Tea program. A function is defined by a list of symbols and a code block. The list of symbols represent its formal parameters. The code block is the function body that is executed when the function is invoked.
The block is executed in a new context. This new context is an imediate descendent of the context where the block was created. Before the block is actually executed, variables named after the formal parameters are created and initialized with the values with which the command was invoked. The return value of the function is the return value of the last statement of the block.
| Constructor Summary | |
|---|---|
SLambdaFunction(SObjSymbol[] argNames,
SObjBlock body)
Initializes the new object. |
|
| Method Summary | |
|---|---|
java.lang.Object |
exec(SObjFunction func,
SContext context,
java.lang.Object[] args)
Executes the Tea function. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SLambdaFunction(SObjSymbol[] argNames,
SObjBlock body)
argNames - List of symbols representing the formal parameters.body - Block of code, representing the body of the command.| Method Detail |
|---|
public java.lang.Object exec(SObjFunction func,
SContext context,
java.lang.Object[] args)
throws STeaException
exec in interface SObjFunctioncontext - The context where this command is being invoked.args - Array with the arguments passed to the command.func - The SObjFunction that led to call this function. Most of the
time is the same as the this object.
STeaException - Thrown if the number of arguments does not
match or if there were any problems executing the function body.
|
Tea Java Runtime API Version 3.2.5 |
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||