bug-guile
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#22076: public-interface of r6rs-library exports import instead of ne


From: tantalum
Subject: bug#22076: public-interface of r6rs-library exports import instead of new definition
Date: Wed, 2 Dec 2015 16:31:22 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0

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)





reply via email to

[Prev in Thread] Current Thread [Next in Thread]