KRL (the "Kawa Report Language") is powerful Kawa dialect for embedding
Scheme code in text files such as HTML or XML templates. You select
the KRL language by specifying --krl
on the Kawa command line.
KRL is based on on BRL,
Bruce Lewis's "Beautiful Report Language", and
uses some of BRL's code, but there are some experimental differences,
and the implementation core is different. You can run KRL in
BRL-compatility-mode by specifying --brl
instead of --krl
.
This section summarizes the known differences between KRL and BRL. Unless otherwise specified, KRL in BRL-compatibility mode will act as BRL.
In BRL a normal Scheme string "mystring"
is the same
as the inverted quote string ]mystring[
, and both are instances
of the type <string>
.
In KRL "mystring"
is a normal Scheme string of type <string>
,
but ]mystring[
is special type that suppresses output escaping.
(It is equivalent to (unescaped-data "mystring")
.)
When BRL writes out a string, it does not do any processing
to escape special characters like <
. However, KRL in its default
mode does normally escape characters and strings. Thus "<a>"
is written as <a&gr;
.
You can stop it from doing this by overriding the output format, for example
by specifying --output-format scheme
on the Kawa command line,
or by using the unescaped-data
function.
Various Scheme syntax forms, including lambda
,
take a <body>
, which is a list of one or more declarations and
expressions. In normal Scheme and in BRL the value of a <body>
is the value of the last expression. In KRL the value of a <body>
is the concatenation of all the values of the expressions,
as if using values-append
.
In BRL a word starting with a colon is a keyword.
In KRL a word starting with a colon is an identifier, which by
default is bound to the make-element
function specialized
to take the rest of the word as the tag name (first argument).
BRL has an extensive utility library. Most of this has not yet been ported to KRL, even in BRL-compatibility mode.