module::new -- loads a module
Introductionmodule(name) loads a dynamic module and creates a
corresponding module domain. module(name,fname) creates a
module function environment.
Call(s)module::new(name)
module::new(name, fname)
module(name) module(name, fname)
Parametersname |
- | module name: character string or identifier |
fname |
- | function name: character string or identifier |
Returnseither a module domain of type DOM_DOMAIN or a function
environment of type DOM_FUNC_ENV.
Side
EffectsIf module::new(name) successfully loads a
dynamic module, it creates a corresponding module domain and assigns it
to the identifier name.
Related
Functionsexternal, loadmod, module::age, module::displace, module::max, module::stat, module::which, unloadmod
Detailsmodule::new(name) uses the function
module::load to load a
module.module::new(name,fname) uses the function
module::func to create a
module function environment.
Example
1This example loads a dynamic module. Since a module is
represented as a domain, it can be used in the
same way as library packages or other MuPAD domains. Module
online documentation can be displayed with the library function
module::help.
>> module("stdmod")
stdmod
>> stdmod::which("stdmod")
"/usr/local/mupad/linux/modules/stdmod.mdm"
>> type(stdmod); info(stdmod)
DOM_DOMAIN
Module: 'stdmod' created on 16.Oct.00 by mmg R-2.0.0
Module: Extended Module Management
- Interface:
stdmod::age, stdmod::doc, stdmod::help, stdmod::max,
stdmod::stat, stdmod::which
>> export(stdmod): which("stdmod")
Warning: 'max' already has a value, not exported.
Warning: 'help' already has a value, not exported.
"/usr/local/mupad/linux/modules/stdmod.mdm"
Example
2Module function environments can be stored in local or global variables and used to execute module functions without loading the module explicitly. The corresponding machine code is loaded on demand when the module function is executed.
>> where := module("stdmod","which"):
where("stdmod")
"/usr/local/mupad/linux/modules/stdmod.mdm"
Backgroundloadmod, unloadmod and external.module::help.