makeparam - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Mozilla Firefox.

Online Help

All Products    Maple    MapleSim


codegen

  

makeparam

  

change a variable to be a parameter

  

makeglobal

  

make a variable to be a global variable

  

declare

  

declare the type of a parameter

 

Calling Sequence

Parameters

Description

Examples

Calling Sequence

makeparam(x, f)

makeparam(x::t, f)

makeglobal(x, f)

makeglobal(x::t, f)

declare(x::t, f)

Parameters

x

-

symbol (variable) or list of symbols

t

-

type - declaration of the variable

f

-

Maple procedure

Description

• 

The makeparam and makeglobal functions are used to make a variable to be a parameter, respectively global variable in the Maple procedure. If a list of variables is given, then all the variables in the list are made into parameters, respectively globals.

• 

If a type t is specified the variable is given the specified type.  This can be used to declare the type of a variable.

• 

The declare function is used to specify the type t for a variable x which is a parameter in the Maple procedure f.

Examples

> 

with⁡codegen:

> 

f := proc() local A; A := array(1..2); A[1] := x^2; A[2] := x^2; A end proc:

> 

g≔makeparam⁡x,f

g ≔ procxlocalA;A ≔ array⁡1..2;A[1] ≔ x^2;A[2] ≔ x^2;Aend proc

(1)
> 

declare⁡x::numeric,g

procx::numericlocalA;A ≔ array⁡1..2;A[1] ≔ x^2;A[2] ≔ x^2;Aend proc

(2)
> 

makeparam⁡x::numeric,f

procx::numericlocalA;A ≔ array⁡1..2;A[1] ≔ x^2;A[2] ≔ x^2;Aend proc

(3)
> 

makeglobal⁡A,f

procglobalA;A ≔ array⁡1..2;A[1] ≔ x^2;A[2] ≔ x^2;Aend proc

(4)
> 

g≔makeparam⁡A,f

g ≔ procA::array⁡1..2A[1] ≔ x^2;A[2] ≔ x^2;Aend proc

(5)
> 

declare⁡A::array⁡1..2,numeric,g

procA::array⁡1..2,numericA[1] ≔ x^2;A[2] ≔ x^2;Aend proc

(6)

See Also

codegen[makeproc]