You can pass various flags to Kawa, for example:
kawa -e '(display (+ 12 4))(newline)'or:
java kawa.repl -e '(display (+ 12 4))(newline)'Either causes Kawa to print
16
, and then exit.
At startup, Kawa executes an init file from the user's home
directory.
The init file is named .kawarc.scm
on Unix-like systems
(those for which the file separator is '/'
),
and kawarc.scm
on other systems.
This is done before the read-eval-print loop
or before the first -f
or -c
argument. (It is not run
for a -e
command, to allow you to set options to override
the defaults.)
-e
expr
~/.kawarc.scm
init file to be run.
-c
expr
-e
expr
, except that it
does cause the ~/.kawarc.scm
init file to be run.
-f
filename-or-url
-
,
standard input is read (with no prompting). Otherwise,
it is equivalent to evaluating (load "
filename-or-url")
.
The filename-or-url is interpreted as a URL
if it is absolute - it starts with a "URI scheme" like http:
.
-s
--
command-line-arguments
is set to the remaining
arguments (if any), and an interactive read-eval-print loop is started.
This uses the same "console" as where you started up Kawa;
use -w
to get a new window.
-w
-e (scheme-window #t)
.
You can specify multiple -w
options, and also use -s
.
--help
--version
--server
portnum
--scheme
--elisp
--emacs
--emacs-lisp
--lisp
--clisp
--clisp
--commonlisp
--common-lisp
--krl
--brl
--xquery
--xslt
--output-format
format
--format
format
The following options control which calling conventions are used:
--full-tailcalls
--no-full-tailcalls
The default is currently --no-full-tailcalls
because I believe it is
faster (though I have not done any measurements yet).
It is also closer to the Java call model, so may be better for people
primarily interested in using Kawa for scripting Java systems.
Both calling conventions can co-exist: Code compiled
with --full-tailcalls
can call code compiled
with --no-full-tailcalls
and vice versa.
The options -C
, -d
, -T
, -P
, --main
--applet
, and --servlet
are used to compile a Scheme file;
see Files compilation.
The option --connect
portnum is only used by
the
kawa
front-end program.
The following options are useful if you want to debug or understand how Kawa works.
--debug-dump-zip
.zip
archive
whose name has the prefix kawa-zip-dump-
.
--debug-print-expr
Expression
data structure. This option causes that data structure to be written out
in a readable format to the standard output.
--debug-print-final-expr
Expression
after
various transformations and optimizations have been done, and just before
code generation.
If there are further command-line arguments after the options
have been processed, then the first remaining argument names a
file that is read and evaluated. If there is no such argument,
then Kawa enters an interactive read-eval-print loop,
but only if none of the -c
, -e
, -f
, -s
,
-C
, or --
options were specified.