exports - Maple Programming Help

exports

retrieve the exported locals of a module

 Calling Sequence exports(m) exports(m, opts)

Parameters

 m - module opts - (optional) one or more of the names instance, typed, static, and string

Description

 • The procedure exports returns an expression sequence containing the names (symbols) of the exported members of a module m.
 • 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 a second (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.
 • 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 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 there values (for example, for reporting purposes), this avoids any danger of accidental unintended evaluation.
 • The instance or string, typed, and static options may be used separately or together in any single call to exports, and may occur in any order after the first (module) argument.
 • The instance and string options are contradictory, and may not 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}}\mathbf{export}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}\mathrm{e1},\mathrm{e2};\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}\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}_{1}=\mathrm{e1}\right)$
 ${\mathrm{true}}$ (2)
 > $e≔\mathrm{exports}\left(m,'\mathrm{instance}'\right)$
 ${e}{≔}{\mathrm{e1}}{,}{\mathrm{e2}}$ (3)
 > $\mathrm{evalb}\left({e}_{1}=\mathrm{e1}\right)$
 ${\mathrm{false}}$ (4)
 > $m≔\mathbf{module}\left(\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}\mathbf{export}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}\mathrm{e1}::\mathrm{integer},\mathrm{e2}::\mathrm{module};\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}\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{integer}}{,}{\mathrm{e2}}{::}{\mathrm{module}}$ (6)
 > $\mathrm{exports}\left(m,'\mathrm{instance}','\mathrm{typed}'\right)$
 ${\mathrm{e1}}{::}{\mathrm{integer}}{,}{\mathrm{e2}}{::}{\mathrm{module}}$ (7)
 > $\mathrm{exports}\left(m,'\mathrm{string}','\mathrm{typed}'\right)$
 ${"e1"}{::}{\mathrm{integer}}{,}{"e2"}{::}{\mathrm{module}}$ (8)