type/function - Maple Programming Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Programming : Data Types : Type Checking : Types : type/function

type/function

check for a function

 

Calling Sequence

Parameters

Description

Examples

Calling Sequence

type(expr, function)

type(expr, function(vtype))

Parameters

expr

-

any expression

vtype

-

type

Description

• 

The call type(expr, function) checks if expr is of the form name(args), where args is an expression sequence of zero or more items.  Expressions of type function represent function calls. For more information, see function.

• 

A mathematical "function" in Maple can be defined using a functional operator.  Use these to define a function of a single variable, a multivariate function, or a vector function.

  

Note that in Maple it is the procedure type, rather than function type that corresponds to what you think of as a "mathematical function".

• 

If the parameter vtype is given, then it also checks that each argument is of type vtype.

• 

A "function" can also be something written in infix notation, for example,

type(a &q b, function);

true

(1)
  

This does not include the infix operators +, -, *, /, ^, ||, =, <, >, <=, >=, <>, .., ::, `and`, `implies`, `or`, and `xor`, but it does include @, @@, ., $, mod, union, intersect, minus, subset, &*, and all other operators starting with &.

Examples

typesinx&comma;function

true

(2)

typesin&comma;function

false

(3)

typef&comma;function

true

(4)

typefx&comma;y&comma;z&comma;function

true

(5)

typefx&comma;y&comma;z&comma;functionname

true

(6)

typef1&comma;y&comma;z&comma;functionname

false

(7)

typea&plus;b&comma;&apos;function&apos;

false

(8)

typeaandb&comma;&apos;function&apos;

false

(9)

typea&cup;b&comma;&apos;function&apos;

true

(10)

See Also

function

functional operators

type

type/applied

type/evenfunc

type/oddfunc

type/procedure

type/structured