type/local - Maple Programming Help

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

type/local

check for a local variable

 Calling Sequence type(x, local) type(x, local(t))

Parameters

 x - any expression t - type

Description

 • The call type(x,local) returns true if x is a local variable and false otherwise.
 • The name local is a keyword and therefore it must be enclosed by backquotes in a call to type.
 • If the parameter t is included, it will check that x is assigned something of that type.

Supertypes

 •

Examples

 > $\mathrm{type}\left(x,\mathrm{local}\right)$
 ${\mathrm{false}}$ (1)
 > $\mathrm{type}\left(\mathrm{convert}\left(x,\mathrm{local}\right),\mathrm{local}\right)$
 ${\mathrm{true}}$ (2)
 > f := proc() local a; a end proc:
 > $z≔f\left(\right)$
 ${z}{≔}{a}$ (3)
 > $\mathrm{type}\left(z,\mathrm{local}\right)$
 ${\mathrm{true}}$ (4)