|
3.8.1 Loading of a library
Libraries can be loaded with the LIB command:
-
Syntax:
LIB string_expression ;
-
Type:
none
-
Purpose:
reads a library of procedures from a file. If the given filename does
not start with . or / and can not be located in the current
directory, each directory contained in the library
SearchPath is searched for file of this name.
-
Note on SearchPath:
The the library SearchPath is constructed at SINGULAR
start-up time as follows:
-
the directories contained in the environment variable
SINGULARPATH are appended
-
the directories
$BinDir/LIB , $RootDir/LIB ,
$RootDir/../LIB , $DefaultDir/LIB , $DefaultDir/../LIB
are appended, where
-
$BinDir
is the value of the environment variable
SINGULAR_BIN_DIR , if set, or, if not set, the directory in which the
SINGULAR program
resides
-
$RootDir
is the value of the environment variable
SINGULAR_ROOT_DIR , if set, or, if not set, $BinDir/../ .
-
$DefaultDir
is the value of the environment variable
SINGULAR_DEFAULT_DIR , if set, or /usr/local/Singular/ on a
Unix platform, \Singular\ on a Windows 95/98/NT platform, and
::Singular: on a Macintosh.
-
all directories which do not exist are removed from the
SearchPath .
For setting environment variables see system, or consult the manual of
your shell.
The library SearchPath can be examined by starting up
SINGULAR with the option -v , or by issuing the command
system("--version"); .
-
Note on standard.lib:
Unless SINGULAR is started with the --no-stdlib option, the
library standard.lib is automatically loaded at start-up time.
Only the names of the procedures in the library are loaded, the body of
the procedures is read during the first call of this procedure. This minimizes
memory consumption by unused procedures. When SINGULAR is started
with the -q or --quiet option, no message about the
loading of a library is displayed. More precisely, option -q (and
likewise --quiet ) unsets option loadLib to inhibit
monitoring of library loading (see option).
All loaded libraries are displayed by the LIB;
command:
| option(loadLib); // show loading of libraries;
// standard.lib is loaded
LIB;
→ standard.lib
// the names of the procedures of inout.lib
LIB "inout.lib"; // are now known to Singular
→ // ** loaded inout.lib (1.21.2.5,2002/06/12)
LIB;
→ standard.lib,inout.lib
|
See
Command line options;
LIB;
Procedures and libraries;
SINGULAR libraries;
proc;
standard_lib;
string;
system.
|