bug#47084: Guile 3.0 - The module-use! 'target' functionality is broken

David Pirotte <[email protected]>
Newsgroups gmane.lisp.guile.bugs
Message-ID <20210503012641.38bf8149@aicha>
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
signature.asc (application/pgp-signature, 488 B)
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCgAdFiEEhCJlRZtBM3furJHe83T9k6MFetcFAmCPe4EACgkQ83T9k6MF
etfs+QgAo+HZNZ1t/yJmVVMXp1KY6ZLAzNNcyGZUDW3v5MJ+SlmcP8ZygwZqujBo
su0TmB0TbsfmLaPF54tEamDHS4nibH8rBOB0/XZ1gUzFjXBhoeb8jZyPHrJ3Xsts
49kESpU5tOktphVjC5i/sgBkMGgFc95MhTItc1Ff2JNZxWCEvi6SBAr3GDjvUggr
+i2SKUKMJzk/IUmlrZB0u/30CBRMTH2fzcOQ0i73b0EmWoLaLW0kUViP/Py9cyjh
B10s+tDyFSc1IY+h4FW29dOHw1zthG4xW48UBJyuI571NbzfjJ4QoISl9YodRTvN
B3T+A3g3RvUh9gv1yk5jU2krCIPWUw==
=zVa7
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.