GNU bug report logs - #22076
public-interface of r6rs-library exports import instead of new definition

Previous Next

Package: guile;

Reported by: tantalum <sph <at> posteo.eu>

Date: Wed, 2 Dec 2015 16:32:02 UTC

Severity: normal

To reply to this bug, email your comments to 22076 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-guile <at> gnu.org:
bug#22076; Package guile. (Wed, 02 Dec 2015 16:32:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to tantalum <sph <at> posteo.eu>:
New bug report received and forwarded. Copy sent to bug-guile <at> gnu.org. (Wed, 02 Dec 2015 16:32:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: tantalum <sph <at> posteo.eu>
To: bug-guile <at> gnu.org
Subject: public-interface of r6rs-library exports import instead of new
 definition
Date: Wed, 2 Dec 2015 16:31:22 +0000
when using resolve-interface to resolve a r6rs-library module, i found that when the r6rs-library defines and exports a procedure with the same name as a procedure that it imports, only the imported procedure will be available in the interface module.
this does not seem to happen with modules that are defined with "define-module".

example

file "test-module.scm" with the following content:

----
(library (test-module)
  (export
    zero?)
  (import
    (rnrs base))

  (define (zero? a) "defined in test-module"))
----

file "test.scm" with the following content:

----
(set! %load-path (list (getcwd)))
(define module (resolve-interface (quote (test-module))))
(define imported-zero? (module-ref module (quote zero?)))
(display (imported-zero? 0))
(newline)
----

when executing "guile test.scm", the following is written to the standard output:

----
#t
----

i would expect to see "defined in test-module" instead.
i do not suppose this is desired behaviour because the reference manual says r6rs-libraries and guile modules are equivalent.

the following in "test-module.scm" produces the expected result:

----
(define-module (test-module))
(define (zero? a) "defined in test-module")
(export zero?)
----

the tests were made with a recent guile 2.1.1 build (which by the way displays "Copyright (C) 2014" with "-v" and on the repl)




This bug report was last modified 9 years and 195 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.