Kurt Nørmark
Department of Computer Science, Aalborg University, Denmark
Abstract Previous lecture Next lecture Index References Contents | In this side track lecture we will introduce the LAML system, which allows us to do web programming Scheme and in the functional programming paradigm |
An Introductory LAML Example |
HTML documents in LAML Slide Annotated slide Contents Index References Textbook |
|
Program: A very simple HTML document that illustrates the overall HTML document structure. It may, however, be tedious to write these tags for each and every small HTML page you
have to produce. |
|
Program: The same document as an LAML expression. We see that the the shift from HTML to LAML is a matter of a few changes, some of which
can be claimed to be of lexcical nature, and some of which are of concrete syntactical of nature.
Notice the use of the underscore character, which suppresses the insertion of white space.
This document cannot be processed immediately. However, the next version that we show can be processed. |
|
Program: The document from above embedded in the LAML framework. Besides initial loading, we see the imperative writing of the functionally generated
document to a specific target file. If the source file is doc1.laml, the target file
will be doc1.html. |
|
|
Programmatic Authoring |
Authoring of web materials Slide Annotated slide Contents Index References Textbook |
|
|
Programmatic authoring Slide Annotated slide Contents Index References Textbook |
The concept Programmatic authoring: Using programmatic authoring the document source is a program written in a programming language. By executing the program, the document source program is transformed to another format, typically HTML. |
|
|
LAML basics |
LAML: Lisp Abstracted Markup Language Slide Annotated slide Contents Index References Textbook | We now introduce the LAML system, which basically is Scheme with access to libraries which mirror HTML. In addition, we support a number of functions which in our experience are very helpful during a typical web authoring process. Some of these functions are organized in document styles, others in tools of various kinds. |
The concept LAML: LAML means Lisp Abstracted Markup Language | LAML provides abstractions, in terms of functions, for HTML. Beyond these it is possible to create arbitrary abstractions, along the line of XML. |
|
|
HTML mirror functions in LAML |
The HTML mirrors in LAML Slide Annotated slide Contents Index References Textbook | We will here describe the HTML4.01 transitional and the XHTML mirrors in LAML. All the essential observations also hold for XML-in-LAML languages. The XHTML mirrors are made via the XML-in-LAML framework. |
The concept HTML mirror in Scheme: A HTML mirror in Scheme is a set of functions that in an accurate way makes the HTML elements of a particular HTML version available in Scheme |
|
|
Mirroring of HTML (1) Slide Annotated slide Contents Index References Textbook |
Program: A HTML mirror expression with attribute names (symbols), attribute values (strings following symbols) and content strings. |
|
Program: The rendering of the value of the HTML mirror expression. |
|
|
Mirroring of HTML (2) Slide Annotated slide Contents Index References Textbook |
|
Program: An HTML mirror expression which suppresses white space in front of punctuation characters. |
|
Program: The rendering of the value of the HTML mirror expression. |
|
Mirroring of HTML (3) Slide Annotated slide Contents Index References Textbook |
|
Program: An HTML mirror expression in which lists are passed as parameters to the HTML mirror functions. |
|
Program: The rendering of the value of the HTML mirror expression. |
|
Mirroring of HTML (4) Slide Annotated slide Contents Index References Textbook |
|
Program: An HTML mirror form in which we highlight a CSS attribute. |
|
Program: The rendering of the value of the HTML mirror expression. |
|
Summary of Mirror Rules Slide Annotated slide Contents Index References Textbook |
|
|
Practical LAML Work |
LAML document processing Slide Annotated slide Contents Index References Textbook |
|
|
|
LAML document styles and tools Slide Annotated slide Contents Index References Textbook |
|
|
LAML server-side programming - CGI Slide Annotated slide Contents Index References Textbook |
|
|
An example of CGI Programming in Scheme with LAML |
|
|
XML-in-LAML |
XML in LAML Slide Annotated slide Contents Index References Textbook |
|
|
More info about LAML |
More information Slide Annotated slide Contents Index References Textbook |
|
|
|
|
Exercises |
Exercises Slide Annotated slide Contents Index References | Here we propose exercises related to LAML |
Exercise 7.2. Bookmark administration | Exercise motivation: It is not practical to bind web bookmarks to a single machine nor to a single browser. Therefore we will maintain a list of bookmark entries in a file, and generate web bookmark pages from this description. We will assume that we maintain a list of bookmark entries, each of the form (bookmark URL title category comment) The first constituent is a symbol (a tag that distinguishes bookmark entries from other structured data) and the other fields are text strings. You can find an example of a bookmark list here. See the link in the web version. The exercise is to complete a frame-based bookmark browser, given a list of bookmarks.You can find an example of a frame-based bookmark browser here. See again the link in the web version. To make it realistic for you to solve this exercises, you are only asked to make the left frame: the category overview frame. The frameset page and the right frame page are already programmed. You are, however, supposed to understand the pre-programmed frame of the exercise. So start to read through the existing pieces of the program. You can find the pre-programmed part of the bookmark browser in the zip file bookmarks-zip.zip. Please consult the web version of the material to get access to it. Unzip it, and LAML process the file bookmark.laml. Bring up the file bookmark-frameset.html in a browser to get started. You are welcome to extend the solution, for example with a good use of the comment field from the bookmark entry. |
Chapter 7: LAML
Course home Author home About producing this web Previous lecture (top) Next lecture (top) Previous lecture (bund) Next lecture (bund)
Generated: July 2, 2013, 09:15:59