This is the mail archive of the
kawa@sourceware.org
mailing list for the Kawa project.
Reloading jar files
- From: Helmut Eller <eller dot helmut at gmail dot com>
- To: kawa at sources dot redhat dot com
- Date: Wed, 12 Aug 2009 21:00:50 +0200
- Subject: Reloading jar files
Consider this code:
(define (test)
(call-with-output-file "/tmp/x.scm"
(lambda (port) (format port "(define x 100)\n")))
(compile-file "/tmp/x.scm" "/tmp/x.jar")
(eval '(load "/tmp/x.jar"))
(format #t "x.1 => ~s [100 expected]\n" (eval 'x))
(eval '(define x 2))
(format #t "x.2 => ~s [2 expected]\n" (eval 'x))
(eval '(load "/tmp/x.jar"))
(format #t "x.3 => ~s [100 expected]\n" (eval 'x))
(eval '(define x 4))
(format #t "x.4 => ~s [4 expected]\n" (eval 'x))
(force (future (eval '(load "/tmp/x.jar"))))
(format #t "x.5 => ~s [100 expected]\n" (eval 'x))
(force-output))
It prints
x.1 => 100 [100 expected]
x.2 => 2 [2 expected]
x.3 => 2 [100 expected]
x.4 => 4 [4 expected]
x.5 => 4 [100 expected]
Are my expectations odd or is loading jars kinda broken?
Helmut