Generated: Friday, December 2, 2005, 22:50:10 | Copyright © 2005, Kurt Nørmark |
![]() |
The LAML software uses the following functions, which are non-standard both in R4RS and R5RS:
(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 '..'. |
(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. |
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. |
(bound? name) | Return if the name is bound in the current interaction environment. |
(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.