Accessing - Maple Help

exports

retrieve the exported locals of a module

 Calling Sequence exports(m) exports(m, options)

Parameters

 m - module options - (optional) one or more options

Description

 • The procedure exports returns an expression sequence containing the names (symbols) of the exported members of a module m.
 • In addition to the module argument, exports accepts several optional arguments.

Output Format Options

 • By default, the global instances of the exported member names are returned. The instances of the names local to the module can be requested by specifying the option instance as an optional argument.
 • By default, only the name portion (first operand) of an exported member that has been declared as an expression of type :: is returned. The entire structure, including the type, can be retrieved by passing the optional argument typed.
 • The string option causes exports to return the exported names as strings instead of names. In cases where it is necessary to know only the names of the exports and not their values (for example, for reporting purposes), this avoids any danger of accidental unintended evaluation.
 • The typed option can be used in conjunction with instance or string. The instance and string options cannot be used together.

Scope Selection Options

 • A module can contain both per-instance and static exports, the latter of which are shared by all instances of a module. By default, the exports function returns only the per-instance exports. Specifying the static option causes it to return only the static exports instead.
 • The all option causes exports to return both the per-instance and static exports. All of the per-instance exports will appear in the result before the static exports.
 • The static and all options cannot be used together.

Type Specification Options

 • The option type=T, where T is a valid Maple type specification, causes exports to return only those exports whose current value is of that type.
 • The method option selects per-instance and static exports whose value is of type callable, returning the global names of those exports. It is equivalent to the sequence of options, all,type=callable.
 • The type and method options cannot be used together.

 • The exports command is thread-safe as of Maple 15.

Examples

 > $m≔\mathbf{module}\left(\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}\mathrm{_export}\left(\mathrm{e1},\mathrm{e2}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}\mathbf{end module}:$
 > $e≔\mathrm{exports}\left(m\right)$
 ${e}{≔}{\mathrm{e1}}{,}{\mathrm{e2}}$ (1)
 > $\mathrm{evalb}\left(e\left[1\right]=\mathrm{e1}\right)$
 ${\mathrm{true}}$ (2)
 > $e≔\mathrm{exports}\left(m,'\mathrm{instance}'\right)$
 ${e}{≔}{\mathrm{e1}}{,}{\mathrm{e2}}$ (3)
 > $\mathrm{evalb}\left(e\left[1\right]=\mathrm{e1}\right)$
 ${\mathrm{false}}$ (4)
 > $m≔\mathbf{module}\left(\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}\mathrm{_export}\left(\mathrm{e1}::\mathrm{integer}≔3,\mathrm{e2}::\mathrm{module}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}\mathbf{end module}:$
 > $\mathrm{exports}\left(m\right)$
 ${\mathrm{e1}}{,}{\mathrm{e2}}$ (5)
 > $\mathrm{exports}\left(m,'\mathrm{typed}'\right)$
 ${\mathrm{e1}}{::}{\mathrm{Typesetting}}{:-}{\mathrm{_Hold}}{}\left(\left[{'}{\mathrm{integer}}{'}\right]\right){,}{\mathrm{e2}}{::}{\mathrm{module}}$ (6)
 > $\mathrm{exports}\left(m,'\mathrm{instance}','\mathrm{typed}'\right)$
 ${\mathrm{e1}}{::}{\mathrm{Typesetting}}{:-}{\mathrm{_Hold}}{}\left(\left[{'}{\mathrm{integer}}{'}\right]\right){,}{\mathrm{e2}}{::}{\mathrm{module}}$ (7)
 > $\mathrm{exports}\left(m,'\mathrm{string}','\mathrm{typed}'\right)$
 ${"e1"}{::}{\mathrm{Typesetting}}{:-}{\mathrm{_Hold}}{}\left(\left[{'}{\mathrm{integer}}{'}\right]\right){,}{"e2"}{::}{\mathrm{module}}$ (8)
 > $\mathrm{exports}\left(m,'\mathrm{type}'='\mathrm{posint}','\mathrm{typed}'\right)$
 ${\mathrm{e1}}{::}{\mathrm{Typesetting}}{:-}{\mathrm{_Hold}}{}\left(\left[{'}{\mathrm{integer}}{'}\right]\right)$ (9)

Compatibility

 • The exports command was updated in Maple 2021.
 • The all, type and method options were introduced in Maple 2021.