This is the mail archive of the kawa@sourceware.org mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: How define single java class using kawa IO system?


Yaroslav Kavenchuk wrote:
It is enough? (It works)

(define-simple-class test2 ()
((main (args :: <String[]>)) :: <void> allocation: 'static access: 'public
(kawa.standard.Scheme:registerEnvironment) ;; <<<<< !!!!!!!!!!
(display "Hallo, World!\n")
(force-output)))

It might work, but it is not the cleanest way to do it. Just put the actions you in the main body of the class:

Normally, you don't write a 'main' method in Kawa - the compiler
does that for you if you specify --main.  And you usually don't
define a top-level class explicitly - the "module" (source file)
does that instead.

$ cat test2.scm
(display "Hallo, World!\n")
(force-output)
$ kawa --main -C test2.scm
(compiling test2.scm to test2)
$ java -cp ~/Kawa/work3/kawa-1.9.3.jar:. test2
Hallo, World!
$

You might also consider --module-static or --module-static-run.

http://www.gnu.org/software/kawa/Application-compilation.html
http://www.gnu.org/software/kawa/Module-classes.html
http://www.gnu.org/software/kawa/Compilation-options.html
--
	--Per Bothner
per@bothner.com   http://per.bothner.com/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]