package - Maple Help

type/package

check for a Maple package

 Calling Sequence type(expr, 'package')

Parameters

 expr - expression

Description

 • The call type(expr, 'package') checks if expr is a Maple package. A Maple package is a module that has option package. For information on Maple packages, see module,package.
 • Not all modules are packages. Package semantics differ from module semantics in two ways. First, (module-based) package exports are automatically protected. Second, packages can be used as the first argument to with.
 • For historical reasons, type package also recognizes Maple tables and procedures with option package as packages. (The use of tables and procedures to implement packages in Maple is deprecated.)

Examples

 > $\mathrm{type}\left(\mathrm{foo},'\mathrm{package}'\right)$
 ${\mathrm{false}}$ (1)
 > $\mathrm{type}\left(\mathrm{plots},'\mathrm{package}'\right)$
 ${\mathrm{true}}$ (2)
 > $\mathrm{type}\left(\mathrm{Statistics},'\mathrm{package}'\right)$
 ${\mathrm{true}}$ (3)
 > $\mathrm{type}\left(\mathrm{LinearAlgebra},'\mathrm{package}'\right)$
 ${\mathrm{true}}$ (4)
 > $Q≔\mathbf{module}\left(\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}\mathrm{_export}\left(e,f\right);\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}e≔x→2*x-1;\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}f≔x→\mathrm{sin}\left(x\right)/\mathrm{cos}\left(x-1\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}\mathbf{end module}:$
 > $\mathrm{type}\left(Q,'\mathrm{package}'\right)$
 ${\mathrm{false}}$ (5)
 > $P≔\mathbf{module}\left(\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}\mathbf{option}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}\mathrm{package};\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}\mathrm{_export}\left(e,f\right);\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}e≔x→2*x-1;\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}f≔x→\mathrm{sin}\left(x\right)/\mathrm{cos}\left(x-1\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}\mathbf{end module}:$
 > $\mathrm{type}\left(P,'\mathrm{package}'\right)$
 ${\mathrm{true}}$ (6)
 > $\mathrm{type}\left(\mathrm{Record}\left(a=2,b=3\right),'\mathrm{package}'\right)$
 ${\mathrm{false}}$ (7)