Generated: Tuesday, May 2, 2006, 13:35:16 Copyright © 2006, Kurt Nørmark The local LAML software home page

The LAML compatibility functions

It is intended that this page is to be replace by the corresponding manual page.

The LAML software relies on a number of functions, which are non-standard both in R4RS and R5RS. You can think of these as functions that extend R4RS/R5RS a little bit to fill the gap between the LAML code base and the Scheme standard.

We support a set of compatibility files for different platforms, operating systems, and Scheme systems in the directory lib/compatibility/. The relevant compatibility file is loaded automatically by laml.scm, based on the configuration file that you set up as part of the LAML installation process.

The set of LAML compatibility files are:

(current-time) Returns the number of seconds elapsed since January 1, 1970
(sort-list list leq-fn) Returns a sorted copy of list. The sorting is based on the function leq-fn, which returns if two elements in the list are considered less than or equal. See note below.
(file-exists? file-path) Returns whether a file named file-path exists. file-path is the full and absolute path to the file. file-path is a text string.
(delete-file file-path) Deletes a file. file-path is the full and absolute path to the file. file-path is a text string.
(directory-exists? dir-path) Returns whether the directory dir-path exists. dir-path is the full and absolute directory path to the directory. As a convention in LAML, a directory path is always terminated by a forward slash character: '/'. dir-path is a text string.
(copy-file source destination) Copy the source file to destination file. Both source and destination are supposed to be full and absolute file paths, and both are text strings.
(make-directory-in-directory in-directory-path new-dir) Make a new directory new-dir in an existing directory path. in-directory-path is a full and absolute directory path (ending in a forward slash), and new-dir is just a simple directory name (without any slash character).
(directory-list dir-path) Return a list of files and directories in dir-path. dir-path is supposed to be a full and absolute directory path, which ends in a forward slash. The resulting list does not include the directories named '.' and '..'.
(bound? name) Return if the name is bound in the current interaction environment.
(eval-cur-env e) Evaluates the expression e in the current interaction environment.
Rationale: Bridges the differences between R4RS systems (in which eval is not standardized) and R5RS systems, in which eval takes two parameters.
(error error-message-string) Stop program executation and print information about the error, as described by the string error-message-string. Most Scheme systems supports this function already.

In addition, the following functions are desirable although not used in the central pieces of the LAML software. If you cannot implement them, just relax...

(getenv name) Read and return the value of an environment variable in the operating system. Used for LAML CGI programming purposes.
(mail receiver title contents) Send email to receiver with title and contents.
(url-target-exists? url-string) Return if the absolute URL, as represented by url-string, exists. If you use the value all or absolute of the variable xml-link-checking in lib/xml-in-laml/xml-in-laml.scm you must implement this function. This provides for checking the existence of the absolute URLs in your documents. In other situations, you do not need to implement it.

The Scheme system compatibility files in lib/compatibility/ provide implementations of the functions mentioned above. (In case no implementation is possible, we call the error procedure.) In the distribution, there are compatibility files for a number of Scheme systems and operating systems. When you have installed LAML, the appropriate compatibility file will be loaded automatically.

A note about sort-list: If you cannot easily provide an implementation of sort-list, we provide the file lib/compatibility/sorting/sort.scm with Aubrey Jaffer's sorting functions. You can include this file in the compatibility file and add (define sort-list sort:sort).

See also advice on how to port LAML to another Scheme System.