unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
From: tantalum <sph@posteo.eu>
To: 22076@debbugs.gnu.org
Subject: bug#22076: public-interface of r6rs-library exports import instead of new definition
Date: Wed, 2 Dec 2015 16:31:22 +0000	[thread overview]
Message-ID: <565F1CDA.9010907@posteo.eu> (raw)

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	other threads:[~2015-12-02 16:31 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=565F1CDA.9010907@posteo.eu \
    --to=sph@posteo.eu \
    --cc=22076@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).