* module/ice-9/boot-9.scm (define-module*): Process module imports after
module exports. Allows for an additional kind of circular module
imports (see https://bugs.gnu.org/15540).
* test-suite/tests/modules.test ("circular imports"): Add test.
* test-suite/tests/00-socket.test:
* test-suite/tests/alist.test:
* test-suite/tests/elisp.test:
* test-suite/tests/encoding-iso88591.test:
* test-suite/tests/encoding-iso88597.test:
* test-suite/tests/encoding-utf8.test:
* test-suite/tests/hash.test:
* test-suite/tests/i18n.test:
* test-suite/tests/modules.test:
* test-suite/tests/ports.test:
* test-suite/tests/srfi-35.test: Make tests use eqv? instead of eq? when
comparing numbers, characters. Checked also for similar uses of
assq[-ref].
* test-suite/tests/vlist.test ("vhash-delete honors HASH"): Change test
to use eqv-ness, not eq-ness, which should not impact its purpose as
these two are equivalent for strings.
* libguile/modules.c (resolve_duplicate_binding): Fix unbound -> #f
conversion for the imported bindings. Pass the existing entry in the
import obarray as the resolved var (7th arg), and properly pass #f as
the value (8th arg) if there is no such binding. Fixes
merge-generics; before, the <boolean> type test (indicating no
previous value) was not being triggered. This bug has been present
since 2007 at least, though it was not in 1.8.
* test-suite/tests/modules.test ("duplicate bindings"): Add a test that
the var and val are both #f. These types are used by GOOPS.
* module/ice-9/boot-9.scm (module-use-interfaces!): Fix up to prevent
duplication in the use list of multiple incoming interfaces.
* test-suite/tests/modules.test ("module-use"): Add tests.
* module/ice-9/boot-9.scm (the-scm-module): Make it its own public
interface.
* test-suite/tests/modules.test ("foundations")["the-root-module",
"the-scm-module"]: New tests.
* module/ice-9/boot-9.scm (resolve-module): Add #:ensure kwarg,
defaulting to true. If true we make an empty module if none was found
(the old behavior). Otherwise we return false.
* test-suite/tests/modules.test ("resolve-module"): Add tests for old
and new behavior.
* libguile/modules.c (scm_module_reverse_lookup): Type-check VARIABLE.
Don't traverse the `uses' list when MODULE is #f.
* test-suite/tests/modules.test ("foundations")["module-reverse-lookup
[pre-module-obarray]", "module-reverse-lookup [wrong-type-arg]"]: New
tests.
* module/ice-9/boot-9.scm (module-name): When making MOD non-anonymous,
bind it in the `(%app modules)' name space.
* test-suite/tests/compiler.test ("psyntax")["compile in current
module", "compile in fresh module"]: New tests.
* test-suite/tests/modules.test ("foundations")["modules don't remain
anonymous"]: New test.