GNU bug report logs - #53244
Guile 3.0.7.14-118ee re-export bug

Previous Next

Package: guile;

Reported by: zacnix <at> tuta.io

Date: Fri, 14 Jan 2022 03:52:02 UTC

Severity: normal

To reply to this bug, email your comments to 53244 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-guile <at> gnu.org:
bug#53244; Package guile. (Fri, 14 Jan 2022 03:52:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to zacnix <at> tuta.io:
New bug report received and forwarded. Copy sent to bug-guile <at> gnu.org. (Fri, 14 Jan 2022 03:52:03 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: zacnix <at> tuta.io
To: bug-guile <at> gnu.org
Subject: Guile 3.0.7.14-118ee re-export bug
Date: Fri, 14 Jan 2022 02:35:41 +0100 (CET)
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)))
!#





This bug report was last modified 2 years and 74 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.