Download LAML           Install LAML           LAML & Scheme Browser           LAML News           Why LAML?           LAML System Overview           Porting LAML           LAML Tutorial           LAML Home          

LAML

This is the homepage of LAML Version 38.0 (November 14, 2011, full). This is the full distribution, including all available documentation. As an alternative, it is possible to download a slim version with only the Scheme files (without the tutorial, without manuals, and without the examples directory). The slim version is much smaller than the full version. The slim version is OK if you have a good and permanent connection to the Internet, via which you can reach the LAML documentation.

The LAML home page at the Computer Science WWW server at Aalborg University contains additional and up-to-date information about LAML. The development version of the LAML software home page is also available.

LAML means Lisp Abstracted Markup Language. The main idea behind LAML is to bring XML and HTML into the domain of the Scheme programming language. The LAML tutorial is a good place to start.

You can use the LAML software together with any R4RS or R5RS compliant Scheme system. The Scheme system must, however, support a few compatibility functions that give access to operating system resources. We recommend that you use one of the XHTML mirrors, or one of the existing XML-in-LAML languages we provide. (The HTML4.01 mirror, as well as number of earlier mirrors, are only supported because a number of useful document styles and tools still make use of them).

The LAML distribution also contains the Scheme elucidator (a tool for creation of elucidative programs), SchemeDoc (a system to document Scheme libraries), and the LENO system (a system for creation of web-based teaching materials).

It is also possible to create your own XML-in-LAML language from an XML DTD, using the LAML DTD parser and the LAML mirror generation tool.

LAML can be used for creation of both static WEB pages and for server side CGI programming purposes (via the cgi library). However, the main mission of LAML is to support generation of static web pages via XML.

For installation details, please see the installation section below.

LAML is free software, as defined by the GNU general public licence.

In order to trace the recent developments of the system please consult the page what is new in LAML.

Below follows a structured overview of the LAML software in terms of library interfaces and programmatic descriptions of styles and tools. Notice that all the examples, as referred by the right column, are found in the examples directory of the full version.

Category Kind Manual Examples
LAML setup LAML setup Manual -
XML-in-LAML Mirrors
and Styles
XHTML1.0 strict Manual Examples
XHTML1.0 transitional Manual Examples
XHTML1.0 frameset Manual Examples
XHTML1.1 Manual Examples
SVG1.1 Manual Examples
XSL-FO Manual Examples
LENO Lecture Notes Manual Examples
The Scheme Elucidator 2 Manual Examples
LAML Course Plan Manual Examples
LAML SchemeDoc Manual Examples
LAML Photo Show Manual Examples
LAML Chords Manual Examples
MIDI LAML - MIDI Sequencing in Scheme Manual -
Older LAML Styles Questionnaire Manual Examples
Article Manual Examples
LAML Libraries Generally useful Scheme functions Manual -
XML-in-LAML common library Manual Examples
XHTML convenience library Manual -
SVG extension library - Graph Abstractions Manual Examples
Time Manual -
Color Manual -
Reading and writing of text files Manual -
Buffered Input Streams Manual -
Finite state automaton Manual -
Cgi Manual -
URL encode and decode Manual -
Crypt Manual -
String make-up Manual -
Scheme pretty printing Manual -
MzScheme compatibility Manual -
Tools The XML-in-LAML mirror generation tool Manual Examples
The Calendar tool - XHTML Manual Examples
The XML DTD parsing tool Manual Examples
Bibtex Manual Examples
XML parsing and pretty printing Manual Examples
HTML parsing and pretty printing Manual Examples
The Schemedoc extraction tool Manual -
Additional Examples LAML Processing - Examples
 

Which non-standard functions are used in LAML?

The LAML software uses a number of functions, which are non-standard both in R4RS and R5RS. They are called LAML Compatibility Functions. See details about these functions.

Old stuff

LAML comes with a number of old styles and mirrors, which are used internally in some parts of LAML the software. New development should not be based on the old stuff. The old software can be accessed from above, in case you need to look at the details.

Which Scheme Systems?

The following table shows the existing LAML configurations by Scheme systems, Platform and Operating System, which correspond to the symbols scheme-system, laml-platform, and operating-system in the LAML configuration description.

Note, LAML version 37: I still use MzScheme version 209 on Windows 7 and on Linux.

Scheme System Applies to Platform Operating System Status Notes
mzscheme-300 mzscheme 300, ..., 370 windows Win-7/win2000/Win XP OK
see note
note
mzscheme-300 mzscheme 300, ..., 370 unix/linux linux OK
see note
note
drscheme-300 drscheme windows Win XP OK note
mzscheme-200 mzscheme 200, ... 209 unix linux OK note
mzscheme-200 mzscheme 200, ... 209 windows Win7/Win-XP/win2000 OK note
mzscheme-200 mzscheme 200, ... 209 unix osx ? note
mzscheme mzscheme 103, 101, ... windows win2000/Win XP OK note
guile guile 1.8 unix linux OK note
guile guile 1.8 Mac MacOS 10.6.2 OK note
guile guile 1.6 unix linux OK note
guile guile 1.3, 1.4, 1.6 unix solaris-7 and solaris-8 OK note
drscheme drscheme windows win2000/Win XP OK note
scm scm unix solaris-7 and solaris-8 ? note
scm scm unix linux ? note
SISC SISC unix linux ? note
Gambit Gambit 4.0 unix linux ? note

Note as of May, 2011, LAML version 37: MzScheme is the primary Scheme system which I use for LAML. MzScheme 400, and newer versions, deviate a lot from earlier versions of MzScheme. It was difficult to update to MzScheme 400 while still supporting a number of other scheme systems (such as Guile) via the same code base. As a consequence, LAML cannot be used together with MzScheme 400+. Therefore you should download a legacy version of MzScheme (209 or 372) if you want to use LAML together with PLT MzScheme. It is not a problem to install both a legacy version of MzScheme and the Racket system on the same computer.

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 or OK you should be able to install LAML with no or very reasonable efforts (GNU Emacs support included). If you use a combination marked '?' I will not promise anything. In case you use a combination not mentioned above, you should make some porting efforts, and this is more difficult.

LAML does not conform to R6RS on any Scheme system or platform.

Case sensitiveness

Although Scheme is basically case insensitive, the LAML software does not rely on this property, and we recommend case sensitive reading. From LAML version 26 we assume that the Scheme reader is case sensitive. The LAML software is written in a case sensitive style, in the sense that a given name, such as xyz is consistently referred to as xyz, not XYZ nor xYz. The SVG mirror requires case sensitive reading of symbols. Guile uses case sensitive reader per default. In MzScheme (read-case-sensitive #t) is used to obtain it. read-case-sensitive is called in the MzScheme compatibility file.

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 on WINDOWS (Win7, XP, and earlier versions). You can download a WINDOWS version of Emacs from the GNU FTP site. As of May 2011 I use version 22.0 on Unix and 22.2 on Windows. LAML also works fine with GNU Emacs version 23.

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 the Emacs text editor
    The Emacs commands M-x laml-process-current-buffer or M-x laml-sync-process-current-buffer starts a Scheme processor on the buffer containing an LAML file. The command laml-process-current-buffer is bound to C-o in the original setup, and to C-c C-o in the hygienic setup. This is undoubtedly the most flexible method of LAML activation. The operate menu of Emacs dired is also supplied with LAML menu items, which allows LAML to be activated directly from dired.

  • Via an operating system command called laml
    From a command prompt activate the laml command on an laml file in the current directory:
    c:\users\kurt\laml>  laml file
    From version 31 of LAML, file should include the laml extension (or a similar extension such as sdoc ). (In earlier versions the file extensions should not be given explicitly). Be sure to 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 the file and file is the name of the file (with file extension). This variant is, for instance, useful from cron jobs that 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 of 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.

    You can control which HTML/XML mirror to use via the Emacs command M-x set-interactive-laml-mirror-library . This commands will present the possibilities, via Emacs completion. As the default, the fully validating XHTML 1.0 transitional mirror is used.

    You can use the laml procedure to process a LAML file. You can also use one of the LAML tools. Use the single-parameter procedure 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
    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 lib/general.scm, the necessary Scheme compatility file, and - if requested in the your installation file configuration - your laml init file. The XHTML1.0 transitional mirror is also loaded by laml-init.scm, and the LAML startup directory will be set to the LAML root directory.

    3. If necessary, relocate your position in the file system by with:
         (laml-cd  new-dir )
      where new-dir can be absolute, relative, or "..". This sets the LAML startup directory, from which all input files are read. The function laml-pwd is also helpful because returns the current LAML startup directory.

    4. Now process LAML files with the laml procedure, for instance:
         (laml "index")
      The laml procedure takes its input file from the startup directory, as set by the previous step.

    A separate guide for use of LAML from DrScheme exists.

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

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

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 by the function begin-laml, and by its alias end-laml-loading. In the laml init file you can redefine stuff from laml.scm and general.scm. Danish authors may find it useful to add support for conversion of the national Danish characters to the HTML counterparts.

Time Correction

LAML uses the time library in lib/time.scm to access time and date information, in part based on the LAML compatibility function current-time. It may be necessary to change the value of the constant time-zone-info in lib/time.scm. We also use (or misuse) this variable for the necessary Daylight Saving Time adjustments.

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, elucidative documentation of the Elucidator tool is available from the www.cs.auc.dk web site. See also the Home Page of Elucidative Programming on the Aalborg University WWW site.

The LAML tutorial is represented as a set of elucidative programs.

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 bindings. If you followed the installation steps you should be able to use LAML from Emacs. Many LAML command are available via the LAML menu, which will apear when you work on a Emacs buffer in LAML mode.

The following gives an overview of the most important Emacs commands of general LAML relevance. All the mentioned keybindings belong to the so-called hygienic keybinding mode, which does not conflict with other Emacs keybindings. The orginal keybindings are shorter, but with a number of conflics. The choice between hygienic and original keybindings is done at LAML configuration time, in the file laml-config/configuration. Roughly speaking, the original keybindings omit the initial C-c.
  • laml-process-current-buffer
    Start LAML asynchronously on the current buffer, say f.laml. This creates or overwrites the file f.html.
    In the hygienic setup this command is bound to C-c C-o.

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

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

  • tidy-laml-form
    Tidy up the LAML form under point. Breaks long strings relative to the value of the variable tidy-fill-column, fixes LAML forms with fix-laml-form, and takes care of indentation. If tidy-laml-form is applied multiple times at the same location, tidy-fill-column will be incremented for each application. When you are satisfied with the value of tidy-fill-column you should use tidy-laml-form-again instead of tidy-laml-form. tidy-laml-form-again does not change tidy-fill-column. Keybinding C-c C-x C-t and C-c C-x C-y respectively.

  • 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. Keybinding C-c C-x C-e.

  • 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. Keybinding: C-c C-r

  • split
    Splits a string in two parts and insert a surrounding concatenate form if desired. Keybinding: C-c C-q.

  • unsplit
    Joins neigboring strings to a single string and remove a possible surrounding concatenate form if it is redundant. Keybinding: C-c C-a.

  • 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). Keybinding: C-c C-n.

  • unnest
    The opposite command to nest. Keybinding: C-c C-m.

  • open-laml-form
    Open a new laml form. Keybinding: C-c C-x C-l.

  • insert-relative-file-path
    Insert a file path, which is relative to the current directory associated with the current buffer. This command is, for instance, useful whenever you make relative links from one web document to another.

The embed, unembed, split, and unsplit commands are 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 one of the main points which in a significant way makes LAML different from other similar work).

There also exists a number of more specific emacs command for the Elucidator and LENO.

In case you want to change the key bindings used by Emacs LAML mode, you find most of them in the file emacs-support/laml-key-menu-bindings.el. The keybindings of LENO and the Scheme Elucidator are not in this file, however.

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.
 

 
Kurt Nørmark
normark@cs.aau.dk
http://www.cs.aau.dk/~normark/

Program Oriented Web Engineering - using LAML Generated: Monday, November 14, 2011, 08:52:42