GNU bug report logs -
#22076
public-interface of r6rs-library exports import instead of new definition
Previous Next
Full log
View this message in rfc822 format
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 196 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.