[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Reduce (use-module... to minimally required set
From: |
Maxim Cournoyer |
Subject: |
Re: Reduce (use-module... to minimally required set |
Date: |
Sun, 27 Feb 2022 20:47:14 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) |
Hello Mortimer,
Mortimer Cladwell <mbcladwell@gmail.com> writes:
> Hi,
> I have taken the Artanis packaging recipe from guile-xyz.scm and modified
> it to suit my needs. For the (use-module... section I simply copied all
> the modules required by guile-xyz.scm. I suspect Artanis requires a much
> smaller subset. Is there a way to report modules actually used so I can
> reduce the (use-module... statement to the bare minimum?
There are some warnings you can get via 'guild compile'; e.g.:
--8<---------------cut here---------------start------------->8---
$ guild compile -Whelp
The available warning types are:
`unsupported-warning' warn about unknown warning types
`unused-variable' report unused variables
`unused-toplevel' report unused local top-level variables
`shadowed-toplevel' report shadowed top-level variables
`unbound-variable' report possibly unbound variables
`macro-use-before-definition' report possibly mis-use of macros before they
are defined
`use-before-definition' report uses of top-levels before they are defined
`non-idempotent-definition' report names that can refer to imports on first
load, but module definitions on second load
`arity-mismatch' report procedure arity mismatches (wrong number of
arguments)
`duplicate-case-datum' report a duplicate datum in a case expression
`bad-case-datum' report a case datum that cannot be meaningfully
compared using `eqv?'
`format' report wrong number of arguments to `format'
--8<---------------cut here---------------end--------------->8---
'unused-toplevel' is close but seems limited to variables, which modules
aren't apparently. It'd be a very useful thing to add, indeed!
Maxim