![]() | [using it] | Interface Manipulation Package v4.0 (2008-06-25) | ![]() | ©copyright | ![]() |
java.lang.Objectimp.core.Function
public abstract class Function
Defines and implements a function over value.
Constructor Summary | |
---|---|
Function()
|
Method Summary | |
---|---|
abstract Value |
call(Expression value)
Defines how this function evaluates the input value. |
static Value |
eval(Value value)
Returns the evaluation of the input value. |
static void |
popContext(Value input)
Pops an expression value from the present context. |
static void |
pushContext(Value input,
Value value)
Pushes an expression value into the present context. |
Function |
setArity(int arity)
Sets this function arity and return this. |
Function |
setFixedPoint(boolean fixed_point)
Sets the fixed-point evaluation mechanism and return this. |
Function |
setName(String name)
Sets this function name and returns this. |
Function |
setQuoted(boolean quoted)
Sets if the function quotes or evaluate its arguments and return this. |
Function |
setRemember(boolean remember)
Sets/Clears the evaluator map remember table of a function and return this. |
static void |
setTrace(boolean trace)
Sets if the eval function dumps a trace during evaluation. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Function()
Method Detail |
---|
public abstract Value call(Expression value)
value
- The value to be evaluated.
public static Value eval(Value value)
value
- The value to be evaluated.
public static void popContext(Value input)
input
- The expression to remove from the context.public static void pushContext(Value input, Value value)
input
- The expression which has a specific value at the present state of the evaluation context.value
- The expression value in the present context.public Function setArity(int arity)
arity
- [optional, default is 0, no arity] The required number of arguments for this function or 0 if none.public Function setFixedPoint(boolean fixed_point)
fixed_point
- [optional, default is false] If true the function is evaluated as a fixed-point (i.e. evaluation is repeated until a stationary value is found).
If fixed-point is set to true, the remember mechanism is activated.public Function setName(String name)
name
- This function name.public Function setQuoted(boolean quoted)
quoted
- [optional, default is false] If true the function arguments are not evaluated, else they are (default state).public Function setRemember(boolean remember)
remember
- [optional, default is false] If true the remember is cleared and used to save/returned already evaluated values, else no remember mechanism is used (default state).public static void setTrace(boolean trace)