unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
* bug#22076: public-interface of r6rs-library exports import instead of new definition
@ 2015-12-02 16:31 tantalum
  0 siblings, 0 replies; only message in thread
From: tantalum @ 2015-12-02 16:31 UTC (permalink / raw)
  To: 22076

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)





^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-12-02 16:31 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-02 16:31 bug#22076: public-interface of r6rs-library exports import instead of new definition tantalum

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).