Top
Back: 3.8.1 Loading of a library
Forward: 3.9 Guidelines for writing a library
FastBack: 3. General concepts
FastForward: 4. Data types
Up: 3.8 Libraries
Top: Singular 2-0-4 Manual
Contents: Table of Contents
Index: F. Index
About: About This Document

3.8.2 Format of a library

A library file can contain comments, a category-, info- and version-string definition, LIB commands, proc commands and proc commands with example and help sections, i.e., the following keywords are allowed: category, info, version, LIB, /* ... */, //, [static] proc. Anything else is not recognized by the parser of SINGULAR and leads to an error message while loading the library. If an error occurs, loading is aborted and an error message is displayed, specifying the type of error and the line where it was detected.

The category-, info- and version-string are defined as follows:

Syntax:

info = string_constant ;

Purpose:

defines the general help for the library. This text is displayed on help libname_lib;.

Example:
 
info="
      This could be the general help of a library.
     Quotes must be escaped with a \ such as \"
";
Note:

In the info-string the characters \ and " must be preceded by a \ (escaped). It is recommended that the info string is placed on the top of a library file and contains general information about the library as well as a listing of all procedures available to the users (with a one line description of each procedure).

Although there is no enforced format of the info string of a library, we recommend that you follow certain rules as explained in The help string of a library.

Syntax:

version = string_constant ;

Purpose:

defines the version number for the library. It is displayed when the library is loaded.

Example:
 
version="$Id: sample.lib,v 1.2 1998/05/07 singular Exp $";
version="some version string";
Note:

It is common practice to simply define the version string to be "$Id:$" and let a version control system expand it.

Syntax:

category = string_constant ;

Purpose:

defines the category for the library.

Example:
 
category="Utilities";
Note:

reserved for sorting the libraries into categories.


Top Back: 3.8.1 Loading of a library Forward: 3.9 Guidelines for writing a library FastBack: 3. General concepts FastForward: 4. Data types Up: 3.8 Libraries Top: Singular 2-0-4 Manual Contents: Table of Contents Index: F. Index About: About This Document
            User manual for Singular version 2-0-4, October 2002, generated by texi2html.