This section describes the klisp, a Kernel Programming Language stand-alone interpreter.
klisp is invoked like this:
klisp [options] [script]
klisp is a stand-alone klisp interpreter for the Kernel
Programming Language. It loads and evaluates Kernel programs in
textual source form. klisp can be used as a batch
interpreter and also interactively. The given
(see Command Line Options) are evaluated and then the klisp
program in file
script is loaded and evaluated. All
evaluations mentioned, including the initialization that is described
below, take place in the same (initially) standard environment. All
values that result from these evaluation are discarded, but if the
error-continuation are passed a
value, the evaluation of
options is interrupted and
See Exit Status, for a description of the
exit status in each case.
script together with all arguments are available as
a list of strings via the applicative
these arguments contain spaces or other characters special to the
shell, then they should be quoted (but note that the quotes will be
removed by the shell). The complete command line, including the name
of the interpreter, options, the script, and its arguments are
available as a list of strings via the applicative
At the very beginning, before even handling the command line,
klisp reads and evaluates the contents of the environment
KLISP_INIT, if it is defined. To use an init file,
KLISP_INIT to the following form:
"/path/to/init-file"). Notice that klisp expects exactly one
KLISP_INIT, if it is defined. So it is an error
to have no expressions or more than one in
same is true of the argument to the
-e option, as both are
implemented in terms of
In interactive mode, klisp prompts the user, reads expressions from the standard input, and evaluates them as they are read. The default prompt is "klisp> ".
Options start with - and are described below. You can use
-- to signal the end of options. If no arguments are given,
then -v -i is assumed when the standard input is a
terminal; otherwise, - is assumed. If no script, or
option -e or
-l is given, -i is assumed.
(load "name")before script is executed. Typically used to do environment initialization.
(require "name")before script is executed. Typically used to load libraries.
If the script or stdin reach EOF or if there is no
EXIT_SUCCESS is returned. If the
error-continuation is passed an object during init, arguments or script
EXIT_FAILURE is returned. If the
root-continuation is passed an object, klisp tries to
convert the value passed to the root-continuation to an exit
status as follows:
EXIT_SUCCESSis returned for
The following environment variables affect the behaviour of klisp
?to be replaced by the required name at run-time.