GetType - Maple Help

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}\left[\mathrm{AddType}\right]\left(\mathrm{tff},'\left\{\mathrm{identical}\left(\mathrm{FAIL}\right),\mathrm{identical}\left(\mathrm{false}\right),\mathrm{identical}\left(\mathrm{true}\right)\right\}'\right)$
 > $\mathrm{TypeTools}\left[\mathrm{GetType}\right]\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}\left[\mathrm{AddType}\right]\left(\mathrm{integer7},t↦\mathrm{evalb}\left(t::'\mathrm{integer}'\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{and}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathrm{irem}\left(t,7\right)=0\right)\right)$
 > $a≔\mathrm{TypeTools}\left[\mathrm{GetType}\right]\left(\mathrm{integer7}\right)$
 ${a}{≔}{\mathrm{TypeTools/integer7}}$ (2)
 > $\mathrm{print}\left(a\right)$
 ${t}{↦}{\mathrm{evalb}}{}\left({t}{::}{\mathrm{Typesetting}}{:-}{\mathrm{_Hold}}{}\left(\left[{'}{\mathrm{integer}}{'}\right]\right)\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{\mathbf{and}}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{\mathrm{irem}}{}\left({t}{,}{7}\right){=}{0}\right)$ (3)