On Tue, 2009-05-05 at 14:31 +0200, Michele Simionato wrote:
> I find more intuitive and natural the
> semantics such that all imported modules are instantiated
> (say once and only once per OS process).
To accomplish implicit phasing, Ikarus determines when instantiation is
needed based on at what phases references to imported bindings occur.
The on-demand semantics is a result of Ikarus's implicit phasing. E.g.,
for the below, do you think (macro-helper) should always be
instantiated? It's imported...
(library (foo)
(export x)
(import (rnrs) (macro-helper))
(define-syntax s
(lambda (stx) (helper stx)))
(define x (s)))
When (foo) is separately compiled, (macro-helper) needs to be
instantiated for phase 1, but when pre-compiled (foo) is separately
used, (macro-helper) does not need to be instantiated. Since it doesn't
need to be instantiated, why should it be? The phase when
(macro-helper) is instantiated is implicit.
Extrapolate this example to an import set (including all its transitive
imports) with multiple libraries utilized only at (> phase 0) -- do you
really want those libraries instantiated and consuming memory at
run-time even though that's totally unnecessary?
On Tue, 2009-05-05 at 12:27 +0200, Michele Simionato wrote:
On Tue, May 5, 2009 at 12:16 PM, Abdulaziz Ghuloum <[email protected]> wrote:
> >
> > On May 5, 2009, at 12:55 PM, Michele Simionato wrote:
> >
> >>> Can you state what you mean by "unused libraries" exactly and precisely?
> >>
> >> I do not know how Ikarus works exactly, but this is how I would do it.
> >
> > Michele,
> >
> > I asked about *what* you mean, not how you'd do it. The operation
> > you describe may not match what you mean.
>
> What I mean is that I would like to be warned if in my code there are
> import forms
> which are ignored by the compiler. More than that, I don't know what to say..
Import forms will never be ignored. If there are name conflicts, it
will always error about that.
I think what you actually want is a warning about imports with not one
referenced binding. E.g.:
(library (bar)
(export ---)
(import --- (nothing-referenced-from-me) ---)
---
#;no-longer-used ;; Don't use this anymore.
---)
You'd like a warning saying nothing from the import is referenced,
right?
--
: Derick
----------------------------------------------------------------