Previous Page Next Page Contents

export, unexport -- export library functions or undo the export

Introduction

export(L, f) exports the public function L::f of the library L, such that it can be accessed as f, without the prefix L.

export(L) exports all public functions of the library L.

unexport(L, f) undoes the export of the public function L::f of the library L, such that it is no longer available as f.

unexport(L) undoes the export of all previously exported public functions of the library L.

Call(s)

export(L, f1, f2, ...)
export(L)
unexport(L, f1, f2, ...)
unexport(L)

Parameters

L - the library: a domain
f1, f2, ... - public functions of L: identifiers

Returns

the void object null() of type DOM_NULL.

Side Effects

When a function is exported, it is assigned to the corresponding global identifier. When it is unexported, the corresponding identifier is deleted.

Further Documentation

Chapter ``The MuPAD libraries'' of the Tutorial.

Related Functions

:=, delete, info, loadmod, loadproc, package, unloadmod

Details

Example 1

We export the public function powerset of the library combinat and then undo the export:

>> combinat::powerset(2)
                          {{}, {2}, {1}, {1, 2}}
>> export(combinat, powerset):
>> powerset(2)
                          {{}, {2}, {1}, {1, 2}}
>> unexport(combinat, powerset):
>> powerset(2)
                                powerset(2)

We export and unexport all public functions of the library combinat:

>> export(combinat):
   permute([1, 2])
                             [[1, 2], [2, 1]]
>> unexport(combinat):
   permute([1, 2])
                              permute([1, 2])

Example 2

export issues a warning if a function cannot be exported since the corresponding identifier already has a value:

>> powerset := 17:
   export(combinat, powerset)
      Warning: 'powerset' already has a value, not exported.

A function will not be exported twice, and export issues a corresponding message if you try:

>> delete powerset:
   export(combinat, powerset):
   export(combinat, powerset):
   unexport(combinat, powerset):
      Info: 'combinat::powerset' already is exported.

Background

Changes




Do you have questions or comments?


Copyright © SciFace Software GmbH & Co. KG 2000