unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
From: David Pirotte <david@altosw.be>
To: 47084@debbugs.gnu.org
Subject: bug#47084: Guile 3.0 - The module-use! 'target' functionality is broken
Date: Tue, 4 May 2021 01:37:33 -0300	[thread overview]
Message-ID: <20210504013733.7a430349@aicha> (raw)
In-Reply-To: <20210503012641.38bf8149@aicha>

[-- Attachment #1: Type: text/plain, Size: 1493 bytes --]

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

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

      reply	other threads:[~2021-05-04  4:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-12  3:17 David Pirotte
2021-05-03  4:26 ` David Pirotte
2021-05-04  4:37   ` David Pirotte [this message]

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=20210504013733.7a430349@aicha \
    --to=david@altosw.be \
    --cc=47084@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).