This is the mail archive of the
kawa@sourceware.org
mailing list for the Kawa project.
Re: the right way to compile and load modules
- From: mikel evins <mevins at me dot com>
- To: Per Bothner <per at bothner dot com>
- Cc: mikel evins <mevins at me dot com>, kawa at sourceware dot org
- Date: Tue, 13 May 2014 22:59:08 -0500
- Subject: Re: the right way to compile and load modules
- Authentication-results: sourceware.org; auth=none
- References: <9F312D97-98C6-4F47-BDD9-B6CAF3868A28 at me dot com> <5371CFD0 dot 7070708 at bothner dot com> <7D1A5D60-5997-4B7A-9176-8F6FA315F016 at me dot com> <ED4375FE-30EE-4ABC-A9DC-2C6C4D67A87A at me dot com> <54132084-D633-4AAA-B2A4-9008FF37F779 at me dot com> <5372CA25 dot 7050602 at bothner dot com> <B01E0129-CA46-46DF-B6F1-65C33CC5A0BC at me dot com> <5372E86B dot 9020600 at bothner dot com>
On May 13, 2014, at 10:52 PM, Per Bothner <per@bothner.com> wrote:
> 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)
Here's why I'm not doing that:
$ ant factest
Buildfile: /Users/mikel/Workshop/fabric/build.xml
fact:
[kawa] (compiling fact.scm to fact)
factest:
[kawa] (compiling factest.scm to factest)
[kawa] factest.scm:3:1: invalid specifier for 'require'
BUILD FAILED
> However, this may not work when importing into the REPL.
As you can see, it doesn't work for me when compiling, either.
> 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.
I'm not married to what I'm currently doing. I'm happy to do anything else that
1. actually works
2. enables me to build a jar containing the compiled code of the project
3. enables me to load (or require or import or inject or assimilate or devour or adjoin or intertwingle or whatever you want to call it) all of the project sources into an interactive session for further development and testing.
Just tell me what to do and I'm there.
> 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/