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: the right way to compile and load modules


On May 13, 2014, at 2:54 AM, Per Bothner <per@bothner.com> wrote:

> On 05/12/2014 09:09 PM, mikel evins wrote:
>> Okay, so I add a module-export form to bar.scm and recompile.
>> Now foo.class runs as expected, but there's a new problem: if I load bar.scm, kawa complains that bar is exported but never defined.
> 
> A possible problem is that load is line-by-line, which is fundamentally
> incompatible with modules as a unit - and thus with export.  If you use
> load, leave off the exports.

If I leave off the exports I cannot compile.

I can try requiring or importing from the repl and see how that works.

> Better to always use require (or r7rs import).  You can use require to
> import a source file (though you can't yet use import for that).
> I don't have an example - it late, I'm tired, and my initial experiment
> is doing something weird. :-(

Another point: I was using parameters for certain things, but getting null pointer exceptions when referencing them in compiled code. I'm guessing that the compiled modules did not execute the toplevel defines that should have defined the parameters. I suppose that might reasonbly be an expected result, though it's a little inconvenient.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]