
type - type of an expression

Calling sequence:
type(expr)

Parameter:

expr   --  expression

Overloading:

1

Summary:

type returns the expression type of expr. If expr is an element of the basic
domain DOM_EXPR, type usually returns a string identifying the operator
of the expression. If expr is no element of DOM_EXPR then type normally
returns the domain which expr belongs to.

One may define the type of expressions formed by ones own operators by
adding the attribute "type" to the function environment of the operator.
One may also define the type of own domain elements by adding a method
"type" to the domain.

The pre-defined expression types are listed in table ?? in the appendix.
Note that expressions of the form a-b and a/b internally are represented as

a+(-1)*b and a*b^(-1) such that they have the expression types "_plus"
and "_mult". To determine the domain an object belongs to one should use
the function domtype.

In contrast to most other functions, arguments which are expression sequences,
are not flattened. type is a kernel function.

>>  type(x + y*z);

      "_plus"

>>  type(x - y);

      "_plus"

See also:  testtype , domtype

