;; beta.scm
(module-name "com.example.Beta")
(import (only (com example Alpha) test-a test-b test-c))
(define (test)
(display test-a) (newline)
(display test-b) (newline)
(display test-c) (newline))
(test)
;; gamma.scm
(module-name "com.example.Gamma")
(com.example.Beta:test)
I'll compile these into classes.
$ rm -rf classes/
$ mkdir classes
$ CLASSPATH='classes' kawa -d classes -C alpha.scm
$ CLASSPATH='classes' kawa -d classes --main -C beta.scm
$ CLASSPATH='classes' kawa -d classes --main -C gamma.scm
Now I try to run Gamma and Beta, getting different results:
$ java -cp lib/kawa-1.11.jar:classes 'com.example.Beta'
#<procedure test-a>
#<procedure alpha.scm:4>
42
$ java -cp lib/kawa-1.11.jar:classes 'com.example.Gamma'
#<procedure test-a>
#!null
#!null
Why are test-b and test-c bound to the values they have in Alpha only
when running Beta as the main class? How can I get the "right" bindings
when running Gamma as the main class? I must be missing something
obvious, but I can't figure it out. Thank you for any advice.