bug#47084: Guile 3.0 - The module-use! 'target' functionality is broken
David Pirotte <[email protected]>
| Newsgroups | gmane.lisp.guile.bugs |
|---|---|
| Message-ID | <20210504013733.7a430349@aicha> |
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
signature.asc
(application/pgp-signature, 488 B)
-----BEGIN PGP SIGNATURE----- iQEzBAEBCgAdFiEEhCJlRZtBM3furJHe83T9k6MFetcFAmCQz40ACgkQ83T9k6MF etcpRAgAj/SKV/YeVKJARCAiOTJ0hvEaT4rDUaZG3l/gnVWLdNu6JBbkkEggqdQ3 J+WMI4PfgeNTVwx+uqx6WSX6/10R19v+Qgpkb0EPcXrlBgPj1mybcgUO6kW97t8l X9aAVu3+7/ffxDjw8LMM+yIyhFk3zksDX56vqx6eFJ0aGp6c9ek0ApgtFLsK0txE Y+Fh9Hkk+cIlqPl9Nn0cHkpfJBbxW7A03cV0tO5G0wDz16HzxEV+cIBSlZsIYIQf 0zK9oceptBQPvjeJc3HqfMlkuQ1+M96V+G5eBtpUOOBpLSqqv9JhaRFkBAbFmp7G KTHXZS4bLeaUQDYWPnJCd27KuWQT8g== =Lroi -----END PGP SIGNATURE-----