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: java/kawa hello world example


On 08/21/2010 08:28 AM, David Dreisigmeyer wrote:
Hi,

I'm new to kawa and java.  I was wondering if anyone can provide a
"hello world" example (more details are better) of how to write the
hello world example in java, create a jar file and then use that in
the kawa repl?

The Java part is the same as Clojure, of course. Then once you create the jar file, either:

$ CLASSPATH=/tmp/demo.jar kawa
#|kawa:1|# (define-alias counter demo.counter)
#|kawa:2|# (counter:sqr 4)
16

or:

$ java -cp /tmp/demo.jar:/tmp/kawa-1.10.jar kawa.repl
#|kawa:1|# (define-alias counter demo.counter)
#|kawa:2|# (counter:sqr 4)
16

You can skip the define-alias:
$ CLASSPATH=/tmp/demo.jar kawa
#|kawa:1|# (demo.counter:sqr 4)
16

You letter mentioned lein/swank/slime.  There is no leiningen
equivalent for Kawa that I know of.

It might be worthwhile to create swank/slime support for Kawa,
but I don't know what's involved.  Where is the "swank protocol"
documented?
--
	--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]