1
<?xml version="1.0" encoding="UTF-8"?>
3
* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
4
* Copyright (C) ????-2008 - INRIA
6
* This file must be used under the terms of the CeCILL.
7
* This source file is licensed as described in the file COPYING, which
8
* you should have received as part of this distribution. The terms
9
* are also available at
10
* http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
13
<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" version="5.0-subset Scilab" xml:lang="en" xml:id="library">
15
<refname>library</refname>
16
<refpurpose> library datatype description
20
<title>Calling Sequence</title>
24
<title>Description</title>
26
A library is a data type with type number 14. It contains a path-name
27
and a set of names. It allows automatic loading of variables using the
31
Suppose the Scilab user references the variable named <literal>foo</literal>.
32
Scilab first looks if <literal>foo</literal> is the name of a primitive or of an
33
already defined variable. If not, it looks for <literal>foo</literal> sequentially
34
(the newest first) in all defined library .
37
Suppose <literal>foo</literal> belongs to the set of names of the library <literal>xlib</literal>
38
then Scilab tries to load the file
39
<xlib-path-name>/foo.bin. <xlib-path-name>/foo.bin must have been
40
created using the <literal>save</literal> function
43
Library are often used for collection of functions, but they can also
44
be used for any collection of scilab variables
47
If a function is defined in more than one library, the default search
48
algorithm loads thode contained in the newest. It possible to force
49
the use of a specific library using dot notation:
52
<literal>xlib.foo</literal> loads the variable <literal>foo</literal> contained in <literal>xlib</literal>.
53
if <literal>foo</literal> is a function
54
and <literal>xlib.foo(args)</literal> executes the functions
58
<title>Examples</title>
59
<programlisting role="example"><![CDATA[
60
// elemlib is a predefined library
61
elementary_functionlib //displays the contents of the library
63
cosm(A) //loads cosm and executes it
64
whos -name cosm // now cosm is a variable
65
elementary_functionlib.sinm //loads sinm from the library
66
elementary_functionlib.cosm(A) //reloads cosm and executes it
69
<refsection role="see also">
70
<title>See Also</title>
71
<simplelist type="inline">
73
<link linkend="lib">lib</link>
76
<link linkend="string">string</link>
79
<link linkend="load">load</link>
82
<link linkend="save">save</link>