Accessing - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


exports

retrieve the exported locals of a module

 

Calling Sequence

Parameters

Description

Thread Safety

Examples

Compatibility

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.

Thread Safety

• 

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

• 

For more information on thread safety, see index/threadsafe.

Examples

mmodule_exporte1,e2end module:

eexportsm

ee1,e2

(1)

evalbe1=e1

true

(2)

eexportsm,instance

ee1,e2

(3)

evalbe1=e1

false

(4)

mmodule_exporte1::integer3,e2::`module`end module:

exportsm

e1,e2

(5)

exportsm,typed

e1::,e2::module

(6)

exportsm,instance,typed

e1::,e2::module

(7)

exportsm,string,typed

e1::,e2::module

(8)

exportsm,type=posint,typed

e1::

(9)

Compatibility

• 

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

module/export