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: Mon, 3 May 2021 01:26:41 -0300	[thread overview]
Message-ID: <20210503012641.38bf8149@aicha> (raw)
In-Reply-To: <20210312001738.32a82355@aicha>

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

Hello,

> ...
> (define-module (a)
>   #:use-module (srfi srfi-1))

> (eval-when (expand load eval)
>   (module-use! (module-public-interface (current-module))
>                (resolve-interface '(srfi srfi-1))))
> ...

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.

Here is a example, so one can reproduce and maybe give us some
hints:

;;; module (a) starts here
(define-module (foo)
  #:use-module (srfi srfi-1))

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

(for-each display '(1 2 3 4))
(newline)
;;; module (foo) ends here


;;; file bar.scm starts here - not a module, just a file
(use-modules (foo))

#;(eval-when (expand load eval)
  (default-duplicate-binding-handler
    '(replace last)))

(for-each display '(5 6 7 8))
(newline)

;; drop the two above module/file somwhere

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

;; you should see that there is no warning 'from (foo)', but two
;; warnings

	WARNING: (guile-user): imported module (a) overrides core
	binding `for-each'

;; 'from the bar.scm file (one when it compiles, one when it 'runs' ...
;; if you start a new session, then there should be one warning only ...

Now, if we uncomment the eval-when in bar.scm and try again, all is
fine

But i wish the module-use! interface/internals would be enhanced so
that it does the same thing for module-use! then what is done simply
using #:use-module... and allow us to keep warn-override-core and warn
in the default-duplicate-binding-handler list ... not sure i made
myself clear, but trying :)

David





















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

  reply	other threads:[~2021-05-03  4:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-12  3:17 bug#47084: Guile 3.0 - The module-use! 'target' functionality is broken David Pirotte
2021-05-03  4:26 ` David Pirotte [this message]
2021-05-04  4:37   ` David Pirotte

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=20210503012641.38bf8149@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).