std - Maple Help

type/stdlib

test for a standard library object

type/std

test for a standard object

 Calling Sequence type(expr, 'stdlib') type(expr, 'std')

Parameters

 expr - expression

Description

 • The type(expr, 'stdlib') command distinguishes user defined procedures and modules from those provided by the standard Maple library. An expression expr is of type stdlib if it is a global symbol saved in the standard repository shipped with Maple.
 • Currently, this type is implemented by testing for the presence of a particular attribute on the expression. This attribute is given to all top-level symbols saved in the standard repository.
 • The type(expr, 'std') command describes the name of a built-in procedure or an object of type stdlib. It is, by definition, equivalent to the (structured) type {builtin, stdlib}.

Examples

 > $\mathrm{type}\left(\mathrm{sin},'\mathrm{stdlib}'\right)$
 ${\mathrm{true}}$ (1)
 > $\mathrm{type}\left(\mathrm{sin},'\mathrm{std}'\right)$
 ${\mathrm{true}}$ (2)
 > $\mathrm{type}\left(\mathrm{op},'\mathrm{std}'\right)$
 ${\mathrm{true}}$ (3)
 > $\mathrm{type}\left(\mathrm{op},'\mathrm{stdlib}'\right)$
 ${\mathrm{false}}$ (4)
 > $\mathrm{type}\left(2,'\mathrm{stdlib}'\right)$
 ${\mathrm{false}}$ (5)
 > $\mathrm{type}\left(\mathrm{Units},'\mathrm{stdlib}'\right)$
 ${\mathrm{true}}$ (6)
 > $f≔s↦\frac{\mathrm{sin}\left(s\right)}{\mathrm{cos}\left(s\right)}:$
 > $\mathrm{type}\left(f,'\mathrm{stdlib}'\right)$
 ${\mathrm{false}}$ (7)

Get all user defined procedures in the current session.

 > $\mathrm{select}\left(\mathrm{type},\left\{\mathrm{anames}\left('\mathrm{procedure}'\right)\right\}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{minus}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\left\{\mathrm{anames}\left('\mathrm{environment}'\right)\right\},'\mathrm{Not}\left(\mathrm{std}\right)'\right)$
 $\left\{{\mathrm{anames}}{,}{f}{,}{\mathrm{print}}\right\}$ (8)