On Tue, May 5, 2009 at 12:47 PM, Ramana Kumar <[email protected]> wrote:
> One straightforward interpretation of "import forms which are ignored
> by the compiler" could be "import specs for which you cannot tell
> whether they are present or absent from the behavior of the script."
> But then you can't define "unused libraries" that are imported into
> libraries: I think whether or not they are "unused" will depend on the
> top-level script.

Yes.

> However I think Michele also wanted to include cases where you can
> tell by observing, say, the printed output coming from an expression
> in a library body. So an alternative interpretation could be "import
> specs none of whose exports are referenced anywhere in the
> script/library body (at any time)". (In this case, (only (foo)) would
> always count as "unused" since it provides no opportunities for
> referencing an export.)

In Ikarus (only (foo)) counts as "unused", in all other implementations
counts as "used" instead, since I could tell the difference via
side effects:

(library (foo)
(export)
(import (rnrs))
(display "foo instantiated\n"))

$ cat x.ss
(import (only (foo)));; the message is printed in all implementations
except ikarus

I would like Ikarus to give a warning in this case, at least when
the switch --warnings is enabled; I would like more, but I realize that
I have no hope to convince Aziz to make Ikarus dumber.

Reply via email to