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.
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 20, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.7903252243995667, "perplexity": 2822.9025533049166}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2023-06/segments/1674764495012.84/warc/CC-MAIN-20230127195946-20230127225946-00170.warc.gz"}