Important: The procmake function has been deprecated. Use the superseding functions ToInert and FromInert instead to translate between Maple expressions and the corresponding inert forms.

•

This routine takes the ``neutral form'' of a procedure (such as that generated by procbody) and creates an executable procedure.

•

There are ``neutral forms'' for statements, local variables, parameters, and several functions. The function procmake does not require a ``neutral form'' exactly equivalent to the internal representation. For example, f&ApplyFunction;a&comma;b is accepted as well as f&ApplyFunction;a &expseq b and f &function a &expseq b. Similar examples exist for table references, sets, and lists.

•

Do not fully evaluate the ``neutral form'' as this will probably invoke functions that are part of procedures, such as indets&ApplyFunction;&args−1. When entering such function calls, it is best to use the &function form for example &grave;&function&grave;gcd&comma;&grave;&expseq&ApplyFunction;a&comma;b or quote them, as with &apos;gcd&ApplyFunction;a&comma;b&apos;.

•

The short specific neutral form is:

The expression `&proc`(A, B, C, D) is a procedure, where:

A is a list of arguments

B is a list of local variables

C is a list of options

D is the statement sequence

•

The long specific neutral form is:

The expression `&proc`(P, L, O, R, B, S, G, X) is a procedure, where:

P is an `&expseq` of parameters

L is an `&expseq` of locals

O is an `&expseq` of options

R is the remember table `&hashtab`

B is the body `&statseq`

S is the description string

G is an `&expseq` of globals

X is the (empty) `&expseq` of scoped

variables

•

Inside a procedure, arguments are represented by &argsn where n is the position in A and local variables by `&local`[n] where n is the position by B. The three special names, nargs, args, and procname, are represented by &args0, &args−1, and &args−2. If there are no statements in the procedure, use &expseq&ApplyFunction;.

•

The expression &grave;&statseq&grave;A&comma;B&comma;C&comma;.... is a statement sequence, where A, B, and C are statements.

•

The expression &expseq&ApplyFunction;A&comma;B&comma;C is an expression sequence, where A, B, and C are expressions.

•

The empty expression sequence (NULL) is represented by &expseq&ApplyFunction;.

•

The expression A &:= B is an assignment statement, where A is assigned the value of B.

•

The expression &grave;&if&grave;A1&comma;B1&comma;A2&comma;B2&comma;...&period;E is an if statement, where Ai are the conditions, Bi are the matching statements, E is the else part (if there is an odd number of arguments).

•

The expression &for&ApplyFunction;VAR&comma;INIT&comma;INCR&comma;FIN&comma;COND&comma;STAT is a for-from statement, where:

VAR is the variable

INIT is the initial value

INCR is the increment

FIN is the final value

COND is the looping condition

STAT is the statement sequence

•

If any of VAR, FIN, or STAT is missing, use &expseq&ApplyFunction; instead. If there is no looping condition, use true. Note that break and next are represented by &break and &next.

•

The expression &for&ApplyFunction;VAR&comma;EXPR&comma;COND&comma;STAT is a for-in statement, where:

VAR is the variable

EXPR is the expression

COND is the looping condition

STAT is the statement sequence

•

If there is no statement sequence, use &expseq&ApplyFunction; instead. If there is no looping condition, use true. Note that break and next are represented by &break and &next.

•

The strings &done, &quit, and &stop are all accepted for the quit statement.

The expressions A &read B and &save&ApplyFunction;B are the read and save statements, where A is a name being saved and B is the file being saved to. The functions &read and &save accept any arrangement of arguments that read and save would accept.

•

Any function call can be represented by the &function function. For example g&ApplyFunction;1&comma;2 would be g &function 1 &expseq 2.

•

The functions &ERROR&ApplyFunction; and &RETURN&ApplyFunction; represent ERROR() and RETURN() or use the above general function call syntax.

•

An unevaluated expression is represented with the &uneval function. For example &apos;f&apos; would be &uneval&ApplyFunction;f.

•

An unevaluated catenated name is represented by the &catenate function. For example a&period;i would be a &catenate i.

•

A series is represented by the &series function.

•

A table is represented by the &table function.

•

The remember table and the hash table part of a table is represented by the &hashtab function. For example, the remember table of procedure f created f&ApplyFunction;1 ≔ 2 would be represented by 1&equals;2 &hashtab 3&equals;4.

•

If there is no remember table then use &expseq&ApplyFunction;. If there is no description string then use &expseq&ApplyFunction;. If there are no globals then use &expseq&ApplyFunction;.

Examples

Important: The procmake function has been deprecated. Use the superseding functions ToInert and FromInert instead to translate between Maple expressions and the corresponding inert forms.

Maplesoft™, a subsidiary of Cybernet Systems Co. Ltd. in Japan, is the leading provider of high-performance software tools for engineering, science, and mathematics. Its product suite reflects the philosophy that given great tools, people can do great things.