1
lib Scilab Group Scilab Function lib
5
lib - library definition
12
lib-dir: character string
15
lib-dir is a character string defining a directory that contains compiled
16
Scilab function (.bin) files. In addition to these files lib-dir must
17
have a file called names, that contains the names of the functions
18
defined in lib-dir. On success, all functions in lib-dir are available
19
from within Scilab. They are loaded on demand when called for the first
20
time. Binary files can be created from within Scilab with the command
21
save. Scilab's standard libraries are defined using lib on the
22
SCIDIR/macros/* subdirectories. As an example, given the following
25
deff('z = myplus(x, y)', 'z = x + y')
26
deff('z = yourplus(x, y)', 'x = x - y')
27
lib_dir = '/home/joeuser/myscidir'
28
myplus and yourplus are compiled into lib_dir with the commands
30
save(lib_dir + '/myplus.bin', myplus)
31
save(lib_dir + '/yourplus.bin', yourplus)
32
A library can now be created from the two .bin files with the command
34
xlib = lib(lib_path + '/')
35
xlib is a Scilab variable of type "library". A library variable usually
36
is saved for later loading, either on-line or from the user-specific
37
startup file ($HOME/.scilab).
40
Scilab tacitly assumes that file foo.bin defines only a single function
44
genlib, save, deff, getf, whereis