On Mar 26, 11:55 pm, Abdulaziz Ghuloum <[email protected]> wrote:
> What forces us is the desire to be able to fully expand
> and compile each library without having to also evaluate it.

There is another point I forgot to mention. The fact that libraries
are compiled without being evaluated is not without disadvantages.
Consider for instance this example:

$ more test.sls
(library (test)
(export x)
(import (rnrs))
(define x (/ 1 0)))

The test library here is buggy, because of a division-by-zero error.
However
compiling it will not reveal any error :-(

$ ikarus --compile-dependencies x.ss
Serializing "./test.sls.ikarus-fasl" ...

The error will be visibile only when the library is used (too late!)

$ more x.ss
(import (rnrs) (test))
(display x)

$ ikarus x.ss
Unhandled exception:
 Condition components:
   1. &assertion
   2. &who: /
   3. &message: "division by 0"
   4. &irritants: ()

So there is a class of errors that could
be recognized at compile time if the definitions
were evaluated by the compiler. I see pros and
contras (the contras are possible confusions
between runtime/compile time for definitions
depending on the time) but not an obvious argument why
not evaluating definitions at compile time is certainly
better.

Reply via email to