TypeTools - Maple Programming Help

Home : Support : Online Help : Programming : Data Types : Type Checking : TypeTools : TypeTools/GetType

TypeTools

 GetType
 retrieve definition of user-defined type

 Calling Sequence GetType(typename)

Parameters

 typename - symbol; name of the type

Description

 • The definition for the type typename is returned.
 • This function can only be used to retrieve definitions of types that have been registered using TypeTools[AddType]. In particular, it cannot be used to retrieve built-in types.

Examples

 > $\mathrm{TypeTools}[\mathrm{AddType}]\left(\mathrm{tff},'\left\{\mathrm{identical}\left(\mathrm{true}\right),\mathrm{identical}\left(\mathrm{false}\right),\mathrm{identical}\left(\mathrm{FAIL}\right)\right\}'\right)$
 > $\mathrm{TypeTools}[\mathrm{GetType}]\left(\mathrm{tff}\right)$
 $\left\{{\mathrm{identical}}{}\left({\mathrm{FAIL}}\right){,}{\mathrm{identical}}{}\left({\mathrm{false}}\right){,}{\mathrm{identical}}{}\left({\mathrm{true}}\right)\right\}$ (1)
 > $\mathrm{TypeTools}[\mathrm{AddType}]\left(\mathrm{integer7},t→\mathrm{evalb}\left(t::\mathrm{integer}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}\mathbf{and}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}\mathrm{irem}\left(t,7\right)=0\right)\right)$
 > $a≔\mathrm{TypeTools}[\mathrm{GetType}]\left(\mathrm{integer7}\right)$
 ${a}{:=}{\mathrm{TypeTools/integer7}}$ (2)
 > $\mathrm{print}\left(a\right)$
 ${t}{→}{\mathrm{evalb}}{}\left({t}{::}{\mathrm{integer}}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{and}}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathrm{irem}}{}\left({t}{,}{7}\right){=}{0}\right)$ (3)