[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-users] compilation question
From: |
Peter Keller |
Subject: |
Re: [Chicken-users] compilation question |
Date: |
Mon, 16 Dec 2002 03:29:56 -0600 |
User-agent: |
Mutt/1.4i |
On Mon, Dec 16, 2002 at 10:04:56AM +0100, Felix Winkelmann wrote:
> You will get one copy for each "include": include copies the source file
> directly into the compiled code. A better way would be to put
> make-counter and countN into a separate library unit and declare
> that as used:
Hmm... nuts.
See, I tried this out, and as far as I could tell, I only got one copy.
The counters seemed to behave the way I expected them to behave across the
compilation units. Now, I might have gotten more than one copy of the
function, but only one seemed to have been invoked at any time. Was I
just lucky?
> Yeah, that's true. We can put any support code into a separate
> library unit and link it the libchicken (or libstuffed-chicken).
> The test-infrastructure.scm could then simply declare that
> support unit as used.
This is depressing. It basically means that you can't do separate compilation
when using my test code. Since I want this code highly portable, I can't
make small additions into the chicken libraries.
Basically, people are going to have to do:
file top.scm:
(include "test-infrastructure.scm") ;; 3000 lines of code
(include "test0.scm") ;; 400 lines of code
(include "test1.scm") ;; 900 lines of code
(include "test2.scm") ;; 1400 lines of code
(include "test3.scm") ;; 2800 lines of code
(include "test4.scm") ;; 4000 lines of code
(include "run-tests.scm") ;; 10 lines of code
(run-tests)
And _wait_ while chicken and gcc try to compile a 12,510(before macro
expansion!) line scheme file. It already takes more than two minutes
to compile my GNU MP interface and that is only 2600 lines of code.
Am I going to have to split the testing infrastructure file into two
files, one pure macros and functions, and the other toplevel defines? You
can include one is all of your test code, but the other one only once?
Thanks.
-pete