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 05/13/2014 07:05 PM, mikel evins wrote:
factest:
      [kawa] (compiling factest.scm to factest)
      [kawa] /Users/mikel/Workshop/fabric/src/fact.scm:3:9: warning - no use of fact
      [kawa] factest.scm:3:1: warning - no declaration seen for fact

Not quite sure what is going on, but:

Compiling fact.scm creates fact.class.
Compiling factest.scm *recompiles* fact.scm (reasonable because you
only specify the source file name), but it does so *differently* than
the first time (i.e. without the fact function being exported), and
then overwrites fact.class with the bad version.

Still need to look into what is going on, but I suggest replacing the
(require "fact.scm")
by:
(require fact)

However, this may not work when importing into the REPL.

What you're doing is somewhat unusual (and thus poorly tested):
Compiling ahead-of-time, and then in a different module requiring the
source file rather than the compiled module.

Fairly soon I want to combine the functions of import and
require, and both use some kind of search path.  However,
that is orthogonal to the problem that fact is sometimes
not exported - which is a bug.
--
	--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]