evalapply - user definable control over function application
|
Calling Sequence
|
|
`evalapply/V`(f, t))
|
|
Parameters
|
|
f
|
-
|
function call
|
t
|
-
|
list of arguments
|
|
|
|
|
Description
|
|
•
|
When nontrivial Maple objects such as unevaluated function calls, lists, or sets are applied to arguments as if they were functions, the evalapply command determines the outcome. For example, an object of type function can be applied to arguments, as in V(f, g)(a, b, c).
|
•
|
The effect of applying the result of most built-in constructors to a sequence of arguments is determined by an internal evalapply function. The evalapply command also implements the application semantics for compositions and compositional powers.
|
•
|
The effect of applying a function call to arguments can be specified by defining an optional procedure of the name `evalapply/V`, where V is the name of the function.
|
•
|
When present, the procedure of the name `evalapply/V` is automatically invoked with f set to V(f, g), and t set to [a, b, c] in response to the function invocation V(f, g)(a, b, c).
|
|
|
Examples of Function Application
|
|
| (1) |
>
|
`evalapply/V` := proc(f,t) local i;
V(seq(op(i,f)(op(t)),i=1..nops(f)));
end proc:
|
| (2) |
| (3) |
| (4) |
| (5) |
| (6) |
| (7) |
| (8) |
| (9) |
| (10) |
| (11) |
| (12) |
| (13) |
| (14) |
| (15) |
| (16) |
| (17) |
| (18) |
| (19) |
| (20) |
>
|
combinat['choose']( 4, 3 );
|
| (21) |
>
|
map( {op}, combinat['choose']( 4, 3 ) );
|
| (22) |
|
|