This is the mail archive of the
kawa@sourceware.org
mailing list for the Kawa project.
the right way to compile and load modules
- From: mikel evins <mevins at me dot com>
- To: kawa at sourceware dot org
- Cc: mikel evins <mevins at me dot com>
- Date: Mon, 12 May 2014 23:09:15 -0500
- Subject: the right way to compile and load modules
- Authentication-results: sourceware.org; auth=none
I have a main file, foo.scm. The code in that file uses a function bar, defined in bar.scm.
The kawa docs claim that by default, all definitions in bar.scm are exported, but that does not appear to be the case. When I compile the two files with --main, I get a foo.class that throws a runtime error because bar is not defined.
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.
In fact, though, bar is defined; checking in the kawa repl shows that it's defined, and, of course, the built foo.class runs as expected, including the call to bar.
I can only hope I'm doing something wrong.
What's the right way to make symbols from bar visible in foo, and also avoid generating spurious warnings about undefined symbols when loading bar.scm interactively?