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: Variables not initialized when module is required?


The following cycle works if you compile first:

$ cat /tmp/test.scm
(require "testobj.scm")
((java.lang.Error "in test"):printStackTrace)
(display test) (newline)
$ cat /tmp/testobj.scm
(require  "test.scm")
(module-export test)
(define test 'symbol)
$ kawa -d /tmp -C /tmp/test.scm /tmp/testobj.scm
(compiling /tmp/test.scm to test)
(compiling /tmp/testobj.scm to testobj)
$ CLASSPATH=/tmp kawa -e '(require test)'
java.lang.Error: in test
	at test.run(test.scm:1)
	at gnu.expr.ModuleBody.run(ModuleBody.java:44)
	at gnu.expr.ModuleBody.run(ModuleBody.java:32)
	at atInteractiveLevel$1.run(<string>:1)
	at gnu.expr.ModuleExp.evalModule2(ModuleExp.java:309)
	at gnu.expr.ModuleExp.evalModule(ModuleExp.java:182)
	at kawa.Shell.run(Shell.java:273)
	at kawa.Shell.run(Shell.java:184)
	at kawa.repl.processArgs(repl.java:192)
	at kawa.repl.main(repl.java:767)
symbol
$

I have a patch almost-ready-to-go that will allow:

$ CLASSPATH=/tmp kawa test

The idea is to make it easier to use the kawa command
to run a named class, just as in Kawa.  More on this later.
Until this works, you can use -e '(require test)'

I'd also like to have the following work:

$ kawa /tmp/test.scm

This doesn't work for a couple of reasons, including that
"/tmp/test.scm" doesn't get registered in the module-registery
when evaluated from the command line, so we get two versions
of the test class, and things get confused ...  I'm trying to
figure out how to fix this.
--
	--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]