Kawa, the Java-based Scheme system
6.3 Compiling Scheme to a standalone application
A Java application is a Java class with a special method
(whose name is
main). The application can be invoked directly
by naming it in the Java command.
If you want to generate an application from a Scheme program,
create a Scheme source file with the definitions you need, plus
the top-level actions that you want the application to execute.
You can compile in the regular way decribed in the previous section, but add
--main option. For example,
assuming your Scheme file is
This will create a
kawa --main -C MyProgram.scm
MyProgram.class which you can either
(as decribed in the previous section), or invoke as an application:
Your Scheme program can access the command-line arguments args
by using the global variable `command-line-arguments'.