Experimental DSSSL extensions

This document descibes some experimental extensions to DSSSL that I have implemented in Jade. These are designed so that, with these extensions, DSSSL provides a superset of the semantics XSL for flow object tree construction. Jade has a -2 option that enables these extensions.

These extensions do not include the additional flow object classes and characteristics that will be needed for XSL; in particular they do not include the HTML/CSS flow object classes.

Imperative programming

The following features come from R4RS:

The use of side-effects is restricted. Assignment to top-level variables is not allowed. There is also the concept that a memory location can be read-only. When a memory location is read-only, it is an error to change that location. An memory location can be recursively marked as read-only; this means that the memory location along with all memory locations reachable from that memory location become read-only. A memory location is recursively marked as read-only when:

A continuation created with call-with-current-continuation cannot be called if it is read-only, and can only be used to return to a stack frame in the current call chain (sometimes referred to as upwards only).

There's a void data type with a single value which can be written as #v. This is returned by cond, case and if expressions which don't match.

Style rules

When a construction rule has a keyword argument list instead of a construct expression it is treated as a style rule. For example,

(element H1
  font-size: 14pt
  font-weight: 'bold)

The keyword argument list can include a use: keyword just as with