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 #8 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: Mon, 3 May 2021 01:26:41 -0300
[Message part 1 (text/plain, inline)]
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




















[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.