unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
From: zacnix--- via "Bug reports for GUILE, GNU's Ubiquitous Extension Language" <bug-guile@gnu.org>
To: 53244@debbugs.gnu.org
Subject: bug#53244: Guile 3.0.7.14-118ee re-export bug
Date: Fri, 14 Jan 2022 02:35:41 +0100 (CET)	[thread overview]
Message-ID: <MtLDSu---3-2@tuta.io> (raw)

There's a difference in exports depending on if you use use-modules vs resolve-module.

If a module re-exports a function and the module is imported using use-modules the re-export seems to work as one would expect as the documentation says, the cdr of the pair is the member of the public interface. 

If you use a resolve-module and then try to pull out the cdr using module-ref it fails with a "No variable named...." If you try module-variable you simply get a #f. If you try doing the module-ref with the original name then it pulls it through just fine.

Is this the expected behavior? As the user I would've expected no difference between use modules and the resolve-module method. Thank you.

#! guiles/main.scm
(add-to-load-path "$LOC")
;(use-modules (guiles two))

(define m (resolve-module '(guiles two)))
(define no-print (module-ref m 'no-print))
(display m)
(display "\n")
(display no-print)
!#

#! guiles/one.scm
(define-module (guiles one)
  #:export (print))

(define (print str)
  (display str))
!#

#! guiles/two.scm
(define-module (guiles two)
  #:use-module (guiles one)
  #:re-export ((print . no-print)))
!#






                 reply	other threads:[~2022-01-14  1:35 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=MtLDSu---3-2@tuta.io \
    --to=bug-guile@gnu.org \
    --cc=53244@debbugs.gnu.org \
    --cc=zacnix@tuta.io \
    /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).