procmake - Maple Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : System : Libraries and Packages : Deprecated Packages and Commands : Deprecated commands : procmake(deprecated)

procmake

create a Maple procedure

 

Calling Sequence

Parameters

Description

Examples

Calling Sequence

procmake(neutralform)

Parameters

neutralform

-

``neutral form'' of a procedure

Description

• 

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, fa,b is accepted as well as fa &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&args1. When entering such function calls, it is best to use the &function form for example `&function`gcd,`&expseqa,b or quote them, as with 'gcda,b'.

• 

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, &args1, and &args2. If there are no statements in the procedure, use &expseq.

• 

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

• 

The expression &expseqA,B,C is an expression sequence, where A, B, and C are expressions.

• 

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

• 

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

• 

The expression `&if`A1,B1,A2,B2,....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 &forVAR,INIT,INCR,FIN,COND,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 instead.  If there is no looping condition, use true.  Note that break and next are represented by &break and &next.

• 

The expression &forVAR,EXPR,COND,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 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 strings &%, &%%, and &%%% represent %, %%, and %%%.

• 

The expressions A &read B and &saveB 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 g1,2 would be g &function 1 &expseq 2.

• 

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

• 

An unevaluated expression is represented with the &uneval function. For example 'f' would be &unevalf.

• 

An unevaluated catenated name is represented by the &catenate function. For example a.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 f12 would be represented by 1=2 &hashtab 3=4.

• 

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

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.

b`&proc`x,y,a,remember,`&local`1 &:= `&args`1+`&args`2 &statseq `&RETURN`''gcd`&args`1,`&local`1'':

procmakeb

procx,yoptionremember;locala;a:=x+y;RETURNgcdx,aend proc

(1)

See Also

FromInert

procbody(deprecated)

ToInert

 


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