Download LAML     LAML Browser     Scheme Browser     LAML News     Why LAML?     LAML System Overview     Slides about LAML     Porting LAML     LAML Home     Install LAML     

LAML

This is the homepage of LAML Version 16.20 slim (September 11, 2001) . This slim version only provides the Scheme source files, examples, and the installation guide; All remaining documentation is addressed at the the LAML WWW site in Aalborg, Denmark. As an alternative you can download a full version which includes all the documentation.

See below for a section about installation of LAML.

The LAML home page at the Computer Science WWW server at Aalborg University contains additional and up-to-date information about LAML.

The main idea behind LAML is to bring HTML into the domain of the Scheme programming language, and as such let the WWW author use the power of abstraction and programmed solutions when he or she produces WWW pages. LAML can be used for both statical markup purposes and for server side CGI programming purposes. For further information, see the LAML background page.

In order to realize what has happened recently in LAML please consult the page what is new in LAML.

Below follows a structured overview of the LAML software documentation in terms of library interfaces and programmatic descriptions of styles and tools. Dimmed entries represent old stuff, provided for backward compatibility.

CategoryIn download bundle?KindManualExamples
LAML setupyesFundamental LAML setupManual-
StylesyesSimpleManualExamples
 yesSimple Html4.0ManualExamples
 yesManualManualExamples
 yesLENO Lecture NotesManualExamples
 yesThe Scheme ElucidatorManualExample
 yesQuestionnaireManualExamples
 yesCourse planManualExamples
 yesArticleManualExamples
LibrariesyesGeneralManual-
 yesHtml4.0 loose (basic)ManualExamples
 yesHtml4.0 loose (surface)ManualExamples
 yesHtml4.0 loose (convenience)ManualExamples
 yesHtml simple mirrorManual-
 yesAd hoc HTML stuffManual-
 yesCgiManual-
 yesTimeManual-
 yesCryptManual-
 yesFile read and writeManual-
 yesURL encode and decodeManual-
 yesText collection and skippingManual-
 yesString make-upManual-
 yesColorManual-
 yesScheme pretty printingManual-
 yesSCM compatibilityManual-
 yesMzScheme compatibilityManual-
 yesLibrary master indexManual
Browser
-
ToolsyesThe Schemedoc toolManual-
 yesThe Calendar toolManualExamples
 yesThe HTML mirroring toolManual-
 yesThe photo show toolManualExamples
 yesBibtexManualExamples
 yesXML parsing and pretty printingManualExamples
 yesHTML parsing and pretty printingManualExamples

 

Which Scheme Systems?

The following table shows the existing LAML configurations by Scheme systems, Platform and Operating System:

Scheme SystemPlatformOperating SystemStatus
mzschemeunixsolaris-7OK
mzschemeunixlinuxprobably OK
mzschemewindowswin95OK
mzschemewindowswin98OK
mzschemewindowsnt40OK
mzschemewindowswin2000OK
guileunixsolaris-7OK
scmunixsolaris-7OK
scmunixsolaris-6?
scmunixlinux?
drschemewindowsnt40OK

A bold 'OK' means that I use the combination myself, and that it works for me. An 'OK' means that am confident that the configuration works, and that it is supported in the distribution. (Perhaps I used it earlier, I have tested it to some degree, or others have reported positively on that combination.) When a combination is OK you should be able to install LAML with no or very reasonable efforts (GNU Emacs support included). If you use a combination not supported you should make some porting efforts, which is more difficult.

Currently I use MzScheme on both Unix (static LAML and for CGI programming) and Windows (Win2000, NT, Win98). Before that I used SCM on Unix. DRScheme is too slow for LAML purposes, at least for my taste; But as noticed, DRScheme works with LAML if you have time to wait. I do not use Guile in my daily work, but I have ported LAML to Guile and tested it in a reasonable way. LAML is also known to work with MzScheme on Linux. I have never used LAML on a Mac.

As part of the LAML distribution we have a useful Scheme R4RS manual browser. My contribution is solely the indexing (which is not accurate in the index made from the TeXInfo source of the document).

Which Emacs?

I recommend that you use LAML from GNU Emacs. The Emacs interface makes it possible to activate LAML directly on a buffer, and to produce an HTML file in a very flexible way. The Emacs interface abstracts away the starting of the Scheme system, and the loading of all the necessary files. The Emacs interface works well on both the UNIX and PC (NT4.0/Win98/Win95) platforms. You can download a PC verion of Emacs (win95/98/NT) from the GNU FTP site. As of November 2000 I recommend version 20.7, but earlier versions will probably also work without problems. (I do not rely on new Emacs features, as far as I am aware).

Which non-standard functions are used in LAML?

The LAML software uses the following non-standard R4RS functions:

(current-time)Returns the number of seconds elapsed since January 1, 1970
(sort-list list leq-fn)Returns a sorted version of list. The sorting is based on the function leq-fn, which returns when two elements in the list are considered less than or equal
(file-exists? file-path)Returns whether a file named file-path (full path) exists.
(delete-file file-name)Deletes a file.
(directory-exists? dir-path)Returns whether the directory dir-path exists
(copy-file source destination)Copy the source file to destination file. Both source and destination are supposed to be full paths

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...

(make-directory-in-directory in-directory-path new-dir)Make a new directory new-dir in an existing directory path. Used in LENO and Course-plan.
(directory-list path)Return a list of files and directories in path. As of version 15, this function is only used in laml-ls.
(mail receiver title contents)Send email to receiver with title and contents.

The Scheme system compatibility files in lib4/compatibility/ provide implementations of the functions mentioned above. (In case no implementation is possible, we call the error procedure.) In the distribution, there are a compatibility files for a number of Scheme systems and operating systems.

Installation

You are supposed to unzip the LAML distribution into a directory of your choice. Next you have to make a few modifications to a configuration file in order to describe properties of your installation. Finally you run a particular Scheme program which effectuates the configuration process. See the LAML installation guide for details on that. We assume that you are a competent Scheme programmer, and as such that you are able to fix simple installation problems that may occur.

Processing LAML files

By processing an LAML file (a file with extension laml) the LAML Scheme expressions are translated to HTML. Thus, by processing the file f.laml you typically get g.html in the same directory. Usually f equals g (depending on the method of processing).

When we start a LAML process, we transfer a bit of context to the processing which gives us knowledge about the name of the file, on which the laml source resides, and the directory in which the source file is placed. In addition, the underlying Scheme process needs to know where the LAML software is located (and a few other options to allow correct processing using a particular Scheme engine).

We support the following LAML processing methods:

  • Via an Emacs text editor
    A single keystroke (C-o or double key stroke C-x C-o) or a single Emacs command (M-x laml-process-current-buffer or M-x laml-sync-process-current-buffer) starts a Scheme processor on the buffer with an LAML file. This is undoubtedly the most flexible method of LAML activation. It requires Emacs to be configured appropriately. The Emacs configuration is described as part of the LAML installation guide referred to above.

  • Via an operating system command file called laml
    From a command prompt activate the laml command on an laml file in the current directory:
    c:\users\kurt\laml> laml file
    The file is written without the laml extension. First, however, insert the laml/bin directory into your PATH. Also, on UNIX, make sure that the command file is executable ( chmod 775 laml, for instance).

    On some platforms we also support the variant

    c:\users\kurt\laml> absolute-laml absolute-path file
    where absolute-path is the file path leading to file (again given without extension). This variant is useful from cron jobs, which starts LAML processing at some given point in time.

    The laml command depends on bin/SETENV.EXE which does not work on NT4.0 and Windows 2000, but it works on Win95/98. Thus, it is currently not possible to use the this mode of activation on Window NT or Windows 2000. The laml command works on Unix.

  • Directly from a running Scheme interpreter in Emacs
    Activation the Emacs command M-x run-laml-interactively. This gives you a Scheme system in which LAML has been loaded. This means of LAML execution is useful for interactive experiments and for debugging purposes.

    Now use the laml procedure to process a laml file. You can also use one of the LAML tools. Use the parameter less procedures laml-cd to change the working directory, laml-pwd to find out about the working directory, and laml-ls to list the working directory (laml-ls depends on directory-list).

  • Directly from a running Scheme interpreter (outside Emacs)
    First start your Scheme system.

    1. Define the variable laml-dir as the file path of your LAML directory. For instance
         (define laml-dir "c:/users/kurt/laml/")

    2. Load laml-init.scm file from the laml directory by
         (load (string-append laml-dir "laml-init.scm"))

      This loads the fundamental setup file laml.scm, and as such lib4/general.scm, and the Scheme necessary compatility file and - if requested in the your installation file configuration - your laml init file. Other useful stuff is also loaded by laml-init.scm, and you will be located in one of LAML example directories.

    3. Now process LAML files with the laml procedure, for instance:
         (laml "index.laml")
      LAML finds file in the so-called LAML startup directory. Change the LAML startup directory with:
         (laml-cd new-dir)
      where new-dir can be absolute, relative, or "..". The function laml-pwd returns the current LAML startup directory.

      Please also notice all the other LAML tools that can be activated from this level.

    If possible, you can arrange that the first two steps are carried out in the init file of your Scheme system.

If specified in the configuration file, a laml init file - such as .laml from you home directory - can be used for your personal LAML customization purposes. The LAML init file is loaded as the last action in laml.scm. You can redefine stuff from laml.scm and general.scm, but not LAML style or tool stuff (which is loaded after laml.scm).

The Scheme Elucidator

Elucidative Programming in Scheme is supported by a tool which we call the Scheme Elucidator. Elucidative programming is a variant of literate programming in which programs and internal documentation is presented in an Internet Browser. The Scheme Elucidator is one of the most substantial LAML-based pieces of software I have written.

The Scheme Elucidator is an integrated part the LAML distribution. With respect to installation and setup of the Scheme Elucidator see the Elucidator Installation page. In addition, the distribution contains elucidative documentation of the Elucidator tool itself. See also the Home Page of Elucidative Programming on the Aalborg University WWW site.

Emacs support

As an integral part of this software package you will find special LAML support from the Emacs editor, including a LAML mode with both key bindings and menu entries. If you followed the installation steps you should be able to use LAML from emacs.

The following gives an overview of the most important, general LAML Emacs commands.

  • laml-process-current-buffer
    Start LAML asynchronously on the current buffer, say f.laml. This defines the file f.html.
    In the standard setup this command is bound to C-o.

  • laml-sync-process-current-buffer
    Start LAML synchronously on the current buffer, say f.laml. This defines the file f.html.
    In the standard setup this command is bound to C-x C-o.

  • laml-process-buffer
    Start LAML on particular buffer of your choice, say b. This typically creates the file b.html

  • embed
    Embed the currently selected substring or word into a LAML form. A word is selected implicitly by pointing at its first character. This command handles the necessary string splitting and string concatenation.

  • unembed
    Unembeds the currently selected form. This is the reverse command to embed. The form is selected by pointing at the start parenthesis or a character in the form name. This command unnests the form, joins neighboring strings, and gets rid of a possibly unnecessary string concatenation form.

  • laml-mode
    Set the major mode of the current buffer to LAML mode.

  • laml-insert-template
    Insert a stored template. You are prompted for a particular one.

  • insert-laml-template
    An alias for laml-insert-template

  • nest
    Nest the current Lisp form into an extra form (a general lisp editing command)

  • unnest
    The opposite command to nest

The embed and unembed commands are very important, because they help the LAML user to embed portions of a string into a Lisp form. Stated in a slightly different way, these commands alleviate the inconvenience caused by the string passing problem (the problem that occurs because all strings must be passed explicitly to LAML functions - this is the main point which in a significant way makes LAML different from the SGML family of mark up languages). The embed command is controlled by the two Emacs Lisp variables laml-single-string-approach and smart-word-determination. Please see the documentation of these (via C-h v) in order to addapt embed to your taste and needs. In the standard setup, embed can be activated via C-x C-e. Unembed is similarly activated by C-x C-r.

Besides these, a variety of specialized template insertion commands are available. They all start with insert-. Use the Emacs completion facility to find out about these.

There also exists a number of more specific emacs command for the Elucidator, the Manual style, and for LENO. See the relevant manual pages for description of these.

In case you want to change the key bindings used by Emacs LAML mode, you will have to change these in emacs-support/dot-emacs-contribution.el

Slide presentations of LAML

Besides the papers about LAML available from the LAML home page, there is also a slide presentation of the ideas behind LAML. The slides were - in the original version - presented at the Lisp User Group Meeting in Amsterdam in 1999. There is also a brief version available. The slides are made by the LENO tool, which itself is LAML based. The brief version illustrates the LENO trail facility. The slides are contained in the LAML distribution.

Change logs

We keep track of the changes from one version to the next. Below you can navigate to these

Porting LAML to other Scheme Systems

In order to port the LAML software package to another Scheme system you will need to carry our some programming work. I have written a guide for people who want to port LAML to another Scheme system.

Known bugs and problems

  1. The laml bat files for NT4.0 and Windows 2000 do not work. It does not find in which directory it is started, and it therefore fails to transfer this information to the Scheme process. As a consequence, all files are written into the laml directory instead of being written into the same directory as the LAML source file.

  2. The Emacs stuff may cause conflicts with other Emacs packages. As pointed out by several people, all Emacs Lisp functions should have a 'laml-' prefix. This is a major work, which I postpone. Is there a program that makes such conversions? If not, it would be worthwhile to make one, perhaps...

 

Kurt Nørmark
Aalborg University
normark@cs.auc.dk 

 

Genereret: 11. September 2001, 10:29:52