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.
The following features come from R4RS:
set!
) expressions
(with restrictions)
call-with-current-continuation
(with restrictions)
begin
expressions
cond
clauses
if
expression optional
cond
or
case
expression
eqv?
and memv
procedures;
these behave as specified in R4RS for vectors but behave
the same as equal?
for strings and lists
This is so that case expressions can use eqv?
as required
by R4RS without breaking compatibility with existing DSSSL code which
assumes case expressions with strings and lists will use
equal?
. R4RS specifies that eqv?
should
return #t when its arguments "should normally be regarded as the same
object". R4RS treats strings and lists as mutable and its
specification of eqv?
for strings and lists is consistent
with this. So long as DSSSL keeps strings and lists as immutable
data-types with value semantics, it is more consistent to define
eqv?
to behave like equal?
for them.
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:
(let ((x 10pt)) (make paragraph font-size: (begin (set! x 12pt) x)))
(inherited-C)
or (actual-C)
procedure
node-list-map
procedure
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.
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