This is the mail archive of the
kawa@sourceware.org
mailing list for the Kawa project.
Re: Variables not initialized when module is required?
- From: alex mitchell <lexaay at gmail dot com>
- To: Per Bothner <per at bothner dot com>, "kawa at sourceware dot org" <kawa at sourceware dot org>
- Date: Wed, 17 Feb 2010 21:04:54 +0800
- Subject: Re: Variables not initialized when module is required?
Hi Per,
Thanks for the reply. I grabbed the latest (rev. 6491) but I'm still getting
the unbound location error. I'll try again tomorrow after you check in your
next set of changes.
thanks,
Alex
On 2/17/10 4:24 PM, "Per Bothner" <per@bothner.com> wrote:
> 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.