Maple für Professional
Maple für Akademiker
Maple für Studenten
Maple Personal Edition
Maple Player
Maple Player für iPad
MapleSim für Professional
MapleSim für Akademiker
Maple T.A. - Testen & beurteilen
Maple T.A. MAA Placement Test Suite
Möbius - Online-Courseware
Machine Design / Industrial Automation
Luft- und Raumfahrt
Fahrzeugtechnik
Robotics
Energiebranche
System Simulation and Analysis
Model development for HIL
Anlagenmodelle für den Regelungsentwurf
Robotics/Motion Control/Mechatronics
Other Application Areas
Mathematikausbildung
Technik
Allgemein- und berufsbildende Schulen
Testen und beurteilen
Studierende
Finanzmodelle
Betriebsforschung
Hochleistungsrechnen
Physik
Live-Webinare
Aufgezeichnete Webinare
Geplante Veranstaltungen
MaplePrimes
Maplesoft-Blog
Maplesoft-Mitgliedschaft
Maple Ambassador Program
MapleCloud
Technische Whitepapers
E-Mail Newsletters
Maple-Bücher
Math Matters
Anwendungs-Center
MapleSim Modell-Galerie
Anwenderberichte
Exploring Engineering Fundamentals
Lehrkonzepte mit Maple
Maplesoft Welcome-Center
Resource-Center für Lehrer
Help-Center für Studierende
The Predefined Variable libname
Description
This special name specifies the file-system location of the main Maple library and other libraries such as package libraries and user libraries. Its value is normally a single string. By setting libname to a sequence of strings, you can specify locations that are sequentially searched for routines. Each location must be a directory that contains a hierarchy of Maple .m files or Maple archives, or the full path of the .mla or .lib file of a Maple archive (see march).
A repository can be created using the command march('create',"filename"), where "filename" is a string specifying the location of a .mla or .lib file. Name/value pairs can be saved in a library by setting the global variable savelibname, and calling savelib('name') (see savelib). Values can be retrieved from a repository by assigning libname := (libname, "filename"). After "filename", or the directory containing "filename" is in your library search path, the name/value pairs stored in that repository are automatically assigned. For example, the following sequence of commands shows how to create a repository, save a procedure named dostuff, and access it after restart.
> march('create',"/home/user.mla");
> dostuff := proc(x) x^2; end proc:
> savelibname := "/home/user.mla":
> savelib('dostuff'):
> restart;
> libname := libname, "/home/user.mla":
> dostuff(3);
9
When the value of libname is a sequence of strings (directory paths or .mla and .lib file paths), Maple searches the specified libraries (in the order specified by the sequence) for the named routine or package of routines. If a directory contains more than one library, Maple searches the libraries in the priority order specified in the archive. For more details on archive priority, see march. For example, the commands:
> libname := "/usr/me/mylib/joe.mla","/usr/maple/lib";
> myexpand;
result in the two specified locations being searched for a definition of myexpand in a file or a member named myexpand.m. First the single library "joe.mla" in the directory "/user/me/mylib" is searched, and then, if necessary, the libraries in the directory "/usr/maple/lib" are searched. The search is terminated on its first success. In particular, this mechanism allows for easy additions or replacements to the main library.
The locations of user-created Maple help databases (.hdb files) can also be added to libname. See About Help Databases in Maple and INTERFACE_HELP for more information.
To see its current value, enter libname; at the Maple prompt. Notice that any names assigned to libname are converted to strings.
The current directory, "." will appear in the default value of libname. Any .mla in the current directory will be found, and the things stored inside will be available for use. Using the currentdir command to change the working directory will cause an implicit update of libname, making the libraries in the new directory available instead of the ones from the prior path.
The libraries of any installed toolboxes are appended to libname in alphabetical order by toolbox directory name, based on the notion of ordering in a standard directory in the local operating system.
Users can assign an initial value for libname on the command line or in their initialization files. See maple for details. Automatic loading of Maple library functions is accomplished by using this global variable, so users are advised not to change it in the middle of a session.
See Also
file, index/function, initialconstants, INTERFACE_HELP, maple, maplehdb, read, save, savelib, with
Download Help Document