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?


On 02/15/2010 09:37 PM, alex mitchell wrote:
I'm having some problems with variables that are exported from one module
and used in a second module. This gives me an error when I run test.scm:

;----- test.scm --------
(begin
   (require "testobj.scm")
   (display test))

;-----testobj.scm-------
(begin
   (require "test.scm")
   (module-export test)
   (define test 'symbol))

#|kawa:1|# unbound location test
#|kawa:2|#     at gnu.mapping.Location.get(Location.java:67)

The error goes away if I don't require test.scm in testobj.scm, so I'm
guessing that initialization is deferred due to the mutual require, but is
never actually done.

I just check in a fix that should help some: The problem was that the 'run' body of test.scm was being called more than once. Now you should get a definition for test.

I have some related code I've been working on that is almost
ready for check in and that may help some more, but it's late
and it will have to wait until tomorrow.
--
	--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]