exports
retrieve the exported locals of a module
Calling Sequence
Parameters
Description
Thread Safety
Examples
Compatibility
exports(m)
exports(m, options)
m
-
module
options
(optional) one or more options
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.
For more information on thread safety, see index/threadsafe.
m ≔ module_export⁡e1,e2end module:
e≔exports⁡m
e≔e1,e2
evalb⁡e1=e1
true
e≔exports⁡m,instance
false
m ≔ module_export⁡e1::integer ≔ 3,e2::`module`end module:
exports⁡m
e1,e2
exports⁡m,typed
e1::ℤ,e2::module
exports⁡m,instance,typed
exports⁡m,string,typed
exports⁡m,type=posint,typed
e1::ℤ
The exports command was updated in Maple 2021.
The all, type and method options were introduced in Maple 2021.
For more information on Maple 2021 changes, see Updates in Maple 2021.
See Also
member
module/export
Download Help Document