Definition of a Type in Maple - Maple Help

Online Help

All Products    Maple    MapleSim


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

Definition of a Type in Maple

Description

• 

By definition, a type in Maple is any expression that is acceptable as the second argument to the procedure type, and that, for any choice of first argument to type causes it to return either true or false. For example, in type(expr, typexpr), expr is of type typexpr if and only if the first expression evaluates to true.

• 

Any particular type belongs to one of the following four categories:

1. 

A system type: a type which is a name that is defined in the kernel of the Maple system. System types usually correspond to primitive algebraic or data structure concepts, such as integer, float, list, and relation.

2. 

A procedural type where the type is a name, for example abc, and there is a procedure `type/abc` which will perform the type analysis of the argument and will return true or false accordingly. This procedure may be available from the global Maple environment or from a library (for the latter case it is automatically loaded into the environment). This is one of the mechanisms to define new types in Maple. For example, monomial, algnum, and specindex are presently implemented as Maple library procedures.

3. 

An assigned type where the type is a name, such as abc, and the global name `type/abc` is assigned a type expression. The type evaluation proceeds as if the type checking were done with the expression assigned to `type/abc`. Thus

`type/intargs` := [algebraic, {name,name=algebraic..algebraic}];

....:

if not type([args],intargs) then error ...;

  

The type last_name_eval is presently implemented as an assigned structured type in the library.

4. 

A type expression which is a general Maple expression as described in type[structured].

See Also

type

type[structured]

 


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