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 * Copyright (C) 2012 - 2016 - Scilab Enterprises
8 * This file is hereby licensed under the terms of the GNU GPL v2.0,
9 * pursuant to article 5.3.4 of the CeCILL v.2.1.
10 * This file was originally licensed under the terms of the CeCILL v2.1,
11 * and continues to be available under such terms.
12 * For more information, see the COPYING file which you should have received
13 * along with this program.
16 <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns3="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="library" xml:lang="pt">
18 <refname>library</refname>
19 <refpurpose>descrição de tipo de dado bibilioteca</refpurpose>
22 <title>Seqüência de Chamamento</title>
26 <title>Descrição</title>
27 <para>Uma bibilioteca é um tipo de dado com número 14. Contém um nome de
28 endereço e um conjunto de nomes. Permite o carregamento automático de
29 variáveis utilizando o seguinte algoritmo:
31 <para>Suponha o usuário Scilab referencie a variável de nome
32 <literal>foo</literal>. O Scilab procura primeiro se
33 <literal>foo</literal> é o nome de uma primitiva, ou de uma variável já
34 definida. Se naõ for, procura por <literal>foo</literal> seqüencialmente
35 (a mais nova) em toda a biblioteca definida .
38 Suponha que <literal>foo</literal> pertence ao conjunto de nomes da
39 biblioteca <literal>xlib</literal>. Então o Scilab tenta carregar o
40 arquivo <xlib-path-name>/foo.bin. <xlib-path-name>/foo.bin
41 deve ter sido criado utilizando-se a função
42 <literal>save</literal>.
44 <para>Bibliotecas geralmente são utilizadas para coleções de funções, mas
45 também podem ser utilizadas para coleções de variáveis Scilab.
47 <para>Se uma função estiver definida em mais de uma biblioteca, o
48 algoritmo de busca padrão carrega aquela contida na mais nova. É possível
49 forçar o uso de uma biblioteca específica utilizando a notação de
53 <literal>xlib.foo</literal> carrega a variável
54 <literal>foo</literal> contida em <literal>xlib</literal>, if
55 <literal>foo</literal> for uma função e <literal>xlib.foo(args)</literal>
60 <title>Exemplos</title>
61 <programlisting role="example"><![CDATA[
62 // elemlib é uma biblioteca predefinida
63 elementary_functionlib //exibindo o conteúdo da biblioteca
65 cosm(A) //carregando cosm e executando-o
66 whos -name cosm // agora, cosm é uma variável
67 elementary_functionlib.sinm //carregando sinm da biblioteca
68 elementary_functionlib.cosm(A) //carregando novamente cosm e executando-o
71 <refsection role="see also">
72 <title>Ver Também</title>
73 <simplelist type="inline">
75 <link linkend="lib">lib</link>
78 <link linkend="string">string</link>
81 <link linkend="load">load</link>
84 <link linkend="save">save</link>