Function: math[addlib], math[dellib] - add or delete paths from libname

Calling Sequence:

addlib(path);
addlib(path, m);
dellib(path);
dellib(path, option);
dellib(n);
dellib(n, option);

Parameters:

path - path to a library in backquotes
m - position, an integer >= -1
n - position, an integer

Description:

addlib adds a path to a library to the global variable libname. By default, the path is added to the beginning of libname. By specifying a position n, the path is included as the m-th element of libname, all following paths are 'shifted' to the right. If m=-1 or m=0, then the path is appended to libname, if m is greater than the number of entries in libname, the path is also appended. The return of addlib is the new value of libname (a sequence).

dellib removes an entry from libname. You may specify either the explicit path (of type string or name) or the position (of type integer) of the path to be removed. Opposed to addlib you may specify a negative integer n < -1. If n is negative, dellib removes the abs(n)-th path from the right.
By default, if the path to the main Maple Library is specified (usually "C:\MAPLEV4/lib" or "/usr/bin/maple/lib") the path to it is not deleted. The return of dellib is the new value of libname (a sequence).

The original value of libname is stored in the global variable oldlibname, which cannot be changed by successive dellib statements. (It is protected after the first call to dellib.) If you have problems, either reset Maple V or assign libname := oldlibname;

! READ THE FOLLOWING WITH CARE ! THE AUTHOR OF THIS FUNCTION DOES NOT ACCEPT ANY RESPONSIBILITY FOR ANY DAMAGE THAT MIGHT OCCUR by specifying the following option. YOU USE IT AT YOUR OWN RISK.

The option 'kill' allows to remove the path to the main Maple Library. This only makes sense if you specify a path to another Maple Library immediately after executing the dellib statement. No readlib statements should be executed if there is no current path to a Maple Library. Also many readlib-defined functions will not work any more during the current Maple session since the error message is stored in readlib's remember table.

USING THE KILL OPTION MAY CAUSE INSTABILITY OR LOSS OF DATA.

So far, however, both in Maple V Release 3 and Release 4 for Windows, at the worst, some readlib-defined functions could not be read if they were called while there was no pointer to the Maple Library. In that case, a restart helped.

Using dellib with the kill option and setting a new path is useful when testing another modified Maple Library.

These functions are part of the math package, and so can be used only after performing the command with(math) or with(math, addlib), with(math, dellib) or with(math, addlib, dellib).

Examples:

> restart:

> with(math):

> # display the current value of libname

> libname;

[Maple Math]
[Maple Math]

> dellib(`c:/maplev4/geom3d`);

[Maple Math]

> # append the path to package math again

> addlib(`c:/maplev4/geom3d`);

[Maple Math]
[Maple Math]

> # include a link to Joe Riel's convert/mks units conversion function at the third position

> addlib(`c:/maplev4/mks`, 3);

[Maple Math]
[Maple Math]

> # try to delete the path to the main Maple Library

> dellib(-1);

Warning, path to the Maple Library specified, libname unchanged

[Maple Math]
[Maple Math]

> # force dellib to delete the path now

> dellib(`e:\\maplev4\\lib`, kill);

[Maple Math]
[Maple Math]

> # reading or using library functions does not work any more

> readlib(shake);

Error, could not find `shake` in the library

> addlib(`e:/maplev4/lib`, -1);

[Maple Math]
[Maple Math]

> readlib(iscont)(1/x, x=-1 .. 1);

[Maple Math]

See Also:

libname , readlib , Joe Riel's documentation: ' Administering Maple V Release 4 ' (see ?math for download information).

Version History:

Version 1.00 - May 24, 1997

Version 1.1 - December 13, 1997