GNU bug report logs - #47084
Guile 3.0 - The module-use! 'target' functionality is broken

Previous Next

Package: guile;

Reported by: David Pirotte <david <at> altosw.be>

Date: Fri, 12 Mar 2021 03:18:01 UTC

Severity: normal

Full log


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

From: David Pirotte <david <at> altosw.be>
To: 47084 <at> debbugs.gnu.org
Subject: Re: bug#47084: Guile 3.0 - The module-use! 'target' functionality
 is broken
Date: Tue, 4 May 2021 01:37:33 -0300
[Message part 1 (text/plain, inline)]
Hello,

> ...
> Commit 19f38a38fde7da5fbcf29d0ebc4574e993210110 fixes the
> bug, many thanks.

> Now, I have a question related to 'new' warnings though - I say 'new'
> because there are no warnings in 2.2 - for which I don't see how one
> can resolve those, unless mute them all by calling
> default-duplicate-binding-handler and remove warn-override-core
> and warn from the default list.

The proper way to stop these warnings is to add a
#:re-export-and-replace clause to the module definition of the module
that calls module-use! - I didn't think I had to do this because we
didn't have to using 2.2 (nor #:re-export nor #:replace, within the
context of module-use! that is, and the #:re-export-and-replace clause
is new to 3.0) - like this:

;;; module (a) starts here
(define-module (foo)
  #:use-module (srfi srfi-1))
  #:re-export-and-replace (for-each))

(eval-when (expand load eval)
  (module-use! (module-public-interface (current-module))
               (resolve-interface '(srfi srfi-1))))
;;; module (foo) ends here

Now the (bar) module or bar.scm file example file may skip the call to
default-duplicate-binding-handler:

;;; file bar.scm starts here
(use-modules (foo))
    
(for-each display '(5 6 7 8))
(newline)
;; file bar.scm stops here 

;; drop the two above module/file somwhere

;;; now, fire geiser and
(add-to-load-path "/your/path")
(load "/your/path/bar.scm")

;; you shouldn't see any warnings anymore...

David
[Message part 2 (application/pgp-signature, inline)]

This bug report was last modified 4 years and 42 days ago.

Previous Next


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