On Tue, May 5, 2009 at 11:38 AM, Abdulaziz Ghuloum <[email protected]> wrote:
>
> On May 5, 2009, at 12:18 PM, Michele Simionato wrote:
>
>> Ok, so let me formulate a single feature requests: a compiler switch
>>
>>  $ ikarus --warnings x.xx
>>
>> such that, when explicitly invoked, I get info about unused libraries
>> (and possibly other things). Seems reasonable, no?
>
> Let's leave the "possibly other things" out for now and focus on just
> one.  Yes, sounds reasonable in principle, so, I can't say no.
>
> 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.

I would keep a global registry of all import forms, storing the names of
all the imported modules, directly or indirectly via dependencies.
Then I would keep a global registry of all visited modules.
Finally, I would keep a global registry of all instantiated modules.
If the set of instantiated modules is smaller then the set of imported
modules, I would print a warning listing the names of the modules
imported but not instantiated.
Only for imported modules exporting macros which are not actually used
and therefore not visited,I would print another different warning (maybe
this behaviour could be turned on only with a verbose option).

Reply via email to