12. Using the SLIB package

SLIB is a library for the programming language Scheme, written by Aubrey Jaffer [SLIB]. It provides a platform independent framework for using packages of Scheme procedures and syntax. It uses only standard Scheme syntax and thus works on many different Scheme implementations.

To use this package, you have just to type

(require "slib")

or use the SRFI-96 (SLIB Prerequisites) with

(import (srfi 96))

and follow the instructions given in the SLIB library manual to use a particular package.

SLIB uses also the require and provide mechanism to load components of the library. Once SLIB has been loaded, the standard STklos require and provide are overloaded such as if their parameter is a string this is the old STklos procedure which is called, and if their parameter is a symbol, this is the SLIB one which is called.

SLIB needs to create a catalog of the file that must be loaded to implement a given feature. This catalog is stored in a file named slibcat This file is, by default located in the slib directory into the STklos configuration directory (generally ~/.config/stklos). It is possible to change this directory with the STKLOS_IMPLEMENTATION_PATH shell variable.

STklos searches the SLIB implementation directory in some standard places. If not found, you can fix it with the SCHEME_LIBRARY_PATH shell variable.


1. Documentation about hygienic macros has been stolen in the SLIB manual
1. In fact define-module on a given name defines a new module only the first time it is invoked on this name. By this way, interactively reloading a module does not define a new entity, and the other modules which use it are not altered.
2. This transcript uses the default toplevel loop which displays the name of the current module in the evaluator prompt.
1. Under Unix, you can simply connect to a listening socket with the telnet of netcat command. For the given example, this can be achieved with netcat localhost 12345
2. Port 13, if open, can be used for testing: making a connection to it permits to know the distant system’s idea of the time of day.
1. The "pattern matching compiler" has been written by Jean-Marie Geffroy and is part of the Manuel Serrano’s Bigloo compiler since several years [Bigloo]
1. This section is an adaptation of Jeff Dalton’s (J.Dalton@ed.ac.uk) "Brief introduction to CLOS" which can be found at http://www.aiai.ed.ac.uk/~jeff/clos-guide.html