Use module identity to filter for existing modules
authorAndreas Rottmann <a.rottmann@gmx.at>
Thu, 3 Mar 2011 10:09:54 +0000 (11:09 +0100)
committerAndy Wingo <wingo@pobox.com>
Thu, 3 Mar 2011 10:09:54 +0000 (11:09 +0100)
commit51c0fd808683fdea689a91fb13b367fd98998c7a
treee4bb57d6cdb87b5cbd28f88ef49c4bd98481238c
parent9c3fa20a561e6693314fda9ad713ce70a80b88de
Use module identity to filter for existing modules

This fixes a problem with R6RS's `import' in particuliar: when importing
a subset of a library/module, the interface created for that purpose
inherits the name of the module it is derived from.  The low-level
primitives that are used for importing would then disregard earlier
imports from the same module.

An example for this bug can be seen with the following library
definition:

(library (test-guile2)
  (export foo)
  (import (only (rnrs base) define)
          (only (rnrs base) error))

  (define (foo . args)
    #t))

In the above, the import of `define' would be disregarded when `error'
is imported, thus leading to a syntax error, since `(foo . args)' is
treated as an application, since the binding of `define' would be not
present.

* module/ice-9/boot-9.scm (module-use!): Remove the filtering of the
  existing imports of the module by name; a check for identity is
  already done beforehand.
  (module-use-interfaces!): Filter the existing imports by identity
  instead of filtering them by their names.
module/ice-9/boot-9.scm