Functional Operators - Maple Programming Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Programming : Procedures and Functions : operators/functional

Functional Operators

 

Description

Examples

Description

• 

A functional operator in Maple is a special form of a procedure. Functional operators are written using arrow notation.

varsresult

  

Here, vars is a sequence of variable names (or a single variable) and result is the result of the procedure acting on vars.

• 

For example, the following

xx2

  

represents the function that squares its argument.

• 

Multivariate and vector functions are also allowed. You must put parentheses around vars or result whenever they are expression sequences. For example, the following functions have the correct syntax.

x,yx2+y2

x2x,3x4

x,y,zxy,yz

• 

You can also create a functional operator by using the unapply command.  (See unapply.)

• 

A functional operator of the form:

varsresult

  

is semantically equivalent to:

proc(vars) option operator, arrow; result end

• 

The identity operator is expressed as xx for any variable name x.

• 

Constant operators do not simplify to numbers. For example, x1 does not simplify to 1.

• 

Expressions such as xfx do not simplify to f. This is invalid if f can also take fewer or greater than one argument.

• 

Note that optional and keyword parameters (see the paramprocessing help page for more information on these) cannot be used in functional operators.

Examples

fx→3x+5

f:=x→3x+5

(1)

f2

11

(2)

gx,y→sinxcosy+xy

g:=x,y→sinxcosy+xy

(3)

gπ2,π

1+12π2

(4)

hx→2x,x3

h:=x→2x,x3

(5)

h3

6,27

(6)

See Also

@

@@

D

examples/functionaloperators

operators/D

type/operator

unapply

 


Download Help Document

Was this information helpful?



Please add your Comment (Optional)
E-mail Address (Optional)
What is ? This question helps us to combat spam