On 10/26/2011 12:22 PM, Taylor Venable wrote:
Thanks, I was reading that page but not looking in the right place. It
also says: "If 'init-run is specified, in addition the module body is
evaluated in the class's static initializer. (Otherwise, it is run the
first time it is require'd.)" That makes me think that the following
modification alone should work (that is, without using the init-run in
alpha.scm), but it does not:
(module-name "com.example.Beta")
(require com.example.Alpha)
(define (test)
(display test-a) (newline)
(display test-b) (newline)
(display test-c) (newline))
require and import are equivalent - both cause the imported module's
initializer (including the body) to be run.
The problem is gamma. It does not use either import or require,
so it just runs the Beta:test method *without insuring that Beta
has been initialized* - which means that Alpha hasn't been initialized
either.