Functions
|
Calling Sequence
|
|
expr(expseq)
|
|
Description
|
|
•
|
This help page describes the Maple function expression. A "function" expression represents a function call, or application of a function or procedure to arguments. For a list of mathematical functions defined in Maple, see initial functions. A mathematical function can be defined in Maple using a functional operator. Use these to define a function of a single variable, a multivariate function, or a vector function.
|
•
|
Apart from procedure applications, one of the most useful applications of function expressions is the ability to use them to define abstract data types. This application makes use of Maple's ability to manipulate unevaluated function calls easily and naturally.
|
•
|
Function expressions may be created using the constructor apply.
|
|
|
Examples
|
|
Two ways to apply sin to :
>
|
|
| (1) |
>
|
|
| (2) |
The next command, entered two ways, returns unevaluated.
>
|
|
| (3) |
>
|
|
| (4) |
>
|
|
| (5) |
>
|
|
| (6) |
>
|
|
| (7) |
>
|
|
| (8) |
>
|
type( 'proc(x) 1+x; end( 2 )', 'function' );
|
| (9) |
>
|
|
| (10) |
>
|
|
| (11) |
>
|
|
| (12) |
>
|
|
>
|
|
>
|
|
| (13) |
Assign to this function expression.
>
|
|
| (14) |
Now is assigned a procedure with a remember table.
>
|
|
| (15) |
Add more entries to the remember table.
>
|
|
>
|
|
| (16) |
>
|
|
|
|