loadmod -- load a module
Introductionloadmod("modulename") loads the dynamic module named
modulename.
loadmod() checks whether the MuPAD
kernel supports dynamic modules.
Call(s)loadmod("modulename")
loadmod()
Parameters"modulename" |
- | the name of a module: a character string |
Returnsloadmod() returns TRUE or FALSE;
loadmod("modulename") returns a module domain
of type DOM_DOMAIN.
Side
Effectsloadmod("modulename") assigns a value to
the identifier modulename. E.g., after
loadmod(ßtdmod"), the identifier
stdmod has the loaded module as its value.
Further
DocumentationDynamic Modules - User's Manual and Programming Guide for MuPAD 1.4, Andreas Sorgatz, Oct 1998, Springer Verlag, Heidelberg, with CD-ROM, ISBN 3-540-65043-1.
Related
Functionsexternal, export, module::new, package, unloadmod
Detailsloadmod() returns TRUE if this MuPAD version
supports the use of dynamic modules. Otherwise, it returns FALSE.loadmod("modulename") loads the dynamic
module named modulename. Doing this, it defines a
corresponding module domain, assigns it to the identifier
modulename and returns the domain to the MuPAD
session. A previously assigned value of the identifier
modulname is overwritten.Warning: Redefinition of domain ...' is
displayed.modulename.mdm'' is first searched
for in the directories defined in the variable READPATH, then in the current
working directory and, finally, in the MuPAD module
directory.modulename.mdg'' exists, then it
contains MuPAD objects that are likewise loaded and bound to the
module domain. If an error occurs while loading these objects, a
warning is displayed and MuPAD tries once more to load them at
each call of the module functions affected by it.modulename.mdm'', there may also be a text file
``modulename.mdh'' containing a brief description of the
module. This documentation can be read online using the module function
modulename::doc() or
modulename::doc("methodname"), respectively.loadmod is a function of the system kernel.
Example
1The following call loads the dynamic module
stdmod:
>> loadmod("stdmod")
stdmod
>> type(stdmod);
DOM_DOMAIN
Since modules are represented as domains, they can be used in the same way as
library packages or other MuPAD domains. E.g., a module function
is called with the prefix modulename:
>> stdmod::which("stdmod")
"/usr/local/mupad/linux/modules/stdmod.mdm"
As for libraries, info can also be used to get
information about a loaded module:
>> info(stdmod)
Module: 'stdmod' created on 28.Sep.00 by mmg R-2.0.0
Module: Extended Module Management
-- Interface:
stdmod::age, stdmod::doc, stdmod::help, stdmod::max,
stdmod::stat, stdmod::which
The function export exports all public functions
of the module. After this, the method "which" can be
called without the domain prefix stdmod:
>> export(stdmod): which("stdmod")
"/usr/local/mupad/linux/modules/stdmod.mdm"
Example
2Documentation of a dynamic module named
modulename may be provided by a plain text file
``modulename.mdh'' which must be located in the same
directory as the module file ``modulename.mdm''. Such
documentation can be accessed as demonstrated below. Cf. module::help for details.
>> stdmod::doc()
MODULE
stdmod - Extended Module Management
INTRODUCTION
This module provides functions for an extended module ...
INTERFACE
age, doc, help, max, stat, which
Above, the introductory page of the module documentation
was displayed. Below, using the argument "doc", the help
page of the function stdmod::doc is shown:
>> stdmod::doc("doc")
NAME
stdmod::doc - Display online documentation
SYNOPSIS
...
SEE ALSO
info, module::help
Backgroundexternal, loadmod, and unloadmod provide basic tools for
accessing modules. Extended facilities are available with the module library.loadmod only reloads the machine code
if it was unloaded or displaced before. However, the module domain is
always re-created on loading.unloadmod.unloadmod.