## `external` -- create a module function environment

#### Introduction

`external``("mstring", "fstring")` returns the function environment of the module function `mstring::fstring`.

#### Call(s)

`external("mstring", "fstring")`

#### Parameters

`"mstring"` | - | the name of a module: a character string
`"fstring"` | - | the name of a module function: a character string

#### Returns

a function environment of type `DOM_FUNC_ENV`.

#### Related Functions

`loadmod`, `module::new`, `unloadmod`

#### Details

- `external``("mstring", "fstring")` creates and returns the function environment of the module function `mstring::fstring`.
- There may be a file `mstring.mdg` containing MuPAD objects that are loaded and bound to the module function environment. If an error occurs while loading these objects, a warning is displayed. MuPAD keeps trying to load them at each subsequent call of module functions affected by it.
- Using `external`, a module function can be accessed without loading the module explicitly and without creating the module domain. If such a module function is executed, its machine code is loaded automatically if necessary.

- Some module functions may only work correctly if their module domain was created before. Such modules must be loaded with `loadmod` before any of their module functions are executed. Refer to the documentation of the corresponding module.

- `external` is a function of the system kernel.

#### Example 1

Module function environments can be stored in local or global variables. They can be used to execute module functions without loading the module explicitly:

    >> where := external("stdmod", "which"): where("stdmod")

                    "/usr/local/mupad/linux/modules/stdmod.mdm"

    >> delete where:

#### Background

- The kernel functions `external`, `loadmod` and `unloadmod` provide basic features for accessing modules. Extended features are available with the `module` library.

#### Changes

- no changes

Do you have questions or comments?
Copyright © SciFace Software GmbH & Co. KG 2000