The --output-format
(or --format
) command-line switch
can be used to override the default format for how values are
printed on the standard output. This format is used for values printed
by the read-eval-print interactive interface. It is also used to
control how values are printed when Kawa evaluates a file named on the
command line (using the -f
flag or just a script name).
(It also affects applications compiled with the --main
flag.)
It currently affects how values are printed by a load
,
though that may change.
The default format depends on the current programming language.
For Scheme, the default is scheme
for read-eval-print
interaction, and ignore
for files that are loaded.
The formats currently supported include the following:
scheme
Values are printed in a format matching the Scheme programming language,
as if using display
. "Groups" or "elements" are written as lists.
readable-scheme
Like scheme
, as if using write
:
Values are generally printed in a way that they can
be read back by a Scheme reader. For example, strings have quotation marks,
and character values are written like ‘#\A
’.
elisp
Values are printed in a format matching the Emacs Lisp programming language.
Mostly the same as scheme
.
readable-elisp
Like elisp
, but values are generally printed in a way that they can
be read back by an Emacs Lisp reader. For example, strings have quotation
marks, and character values are written like ‘?A
’.
clisp
commonlisp
Values are printed in a format matching the Common Lisp programming language,
as if written by princ
.
Mostly the same as scheme
.
readable-clisp
readable-commonlisp
Like clisp
, but as if written by prin1
: values are generally
printed in a way that they can be read back by a Common Lisp reader.
For example, strings have quotation marks, and character values are
written like ‘#\A
’.
xml
xhtml
html
Values are printed in XML, XHTML, or HTML format. This is discussed in more detail in Formatting XML.
cgi
The output should follow the CGI standards. I.e. assume that this
script is invoked by a web server as a CGI script/program, and that the
output should start with some response header,
followed by the actual response data.
To generate the response headers, use the response-header
function.
If the Content-type
response header has not been specified, and
it is required by the CGI standard, Kawa will attempt
to infer an appropriate Content-type
depending on the following value.
ignore
Top-level values are ignored, instead of printed.