type/suffixed - Maple Programming Help

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

type/suffixed

check for a symbol with a given suffix

 Calling Sequence type(x, suffixed(y)) type(x, suffixed(y, stype))

Parameters

 x - any expression y - symbol, string, or set or list of either symbols or strings stype - type

Description

 • A call to type suffixed with one parameter checks whether a symbol or string x has the same type as y, and x begins with the characters of y.
 • With two parameters, x is checked to see if it has the same type of and begins with the characters of y and that the balance, when parsed, is of type stype.
 • If y is a set or  list, then x is checked against each operand of y.
 • Note that x and "x" are considered to be of type suffixed(x) and suffixed("x"), respectively.  Also note that parse will automatically simplify the balance, so "x6/2" and "x4!" is an "x" suffixed by the integers 3 and 24, respectively.

Examples

 > $\mathrm{type}\left(\mathrm{_Z1},'\mathrm{suffixed}\left(\mathrm{_Z},\mathrm{integer}\right)'\right)$
 ${\mathrm{true}}$ (1)
 > $\mathrm{type}\left("x1.32",'\mathrm{suffixed}\left("x",\left\{\mathrm{float},\mathrm{integer}\right\}\right)'\right)$
 ${\mathrm{true}}$ (2)
 > $\mathrm{discont}\left(\mathrm{tan}\left(x\right),x\right)$
 $\left\{{\mathrm{\pi }}{}{\mathrm{_Z1~}}{+}\frac{{1}}{{2}}{}{\mathrm{\pi }}\right\}$ (3)
 > $\mathrm{hastype}\left(,'\mathrm{suffixed}\left(\left\{\mathrm{_B},\mathrm{_N},\mathrm{_NN},\mathrm{_Z}\right\},\mathrm{integer}\right)'\right)$
 ${\mathrm{true}}$ (4)
 > $\mathrm{dsolve}\left(\left\{\mathrm{diff}\left(y\left(t\right),t\right)=y\left(t\right)\right\},y\left(t\right)\right)$
 $\left\{{y}{}\left({t}\right){=}{\mathrm{_C1}}{}{{ⅇ}}^{{t}}\right\}$ (5)
 > $\mathrm{hastype}\left(,'\mathrm{suffixed}\left(\mathrm{_C},\mathrm{integer}\right)'\right)$
 ${\mathrm{true}}$ (6)
 > $\mathrm{type}\left("x4/2",'\mathrm{suffixed}\left("x",\mathrm{integer}\right)'\right)$
 ${\mathrm{true}}$ (7)