bug#43025: re-export-public-interface fails on Guile 3

Dale Smith <[email protected]>
Newsgroups gmane.lisp.guile.bugs
Message-ID <CAFGZJC4LuaAEPEaJLqQe36qeMuAJ3SVJtKW4OGaWdH2dKgeSdA@mail.gmail.com>
And now using a more standard error reporting function.
I think it's done now.

(define-syntax re-export-public-interface
  (syntax-rules ()
    "Re-export the public interface of a module or modules. Invoked as
@code{(re-export-public-interface (mod1) (mod2) ...)}."
    ((_ (m0 m0* ...) (mn mn* ...) ...)
     (let ((iface (module-public-interface (current-module))))
       (define (r-e-p-i module)
	 (cond-expand
	  (guile-3
	   (module-for-each
	    (lambda (sym val)
	      (hashq-set! (module-replacements iface) sym #t)
	      (module-add! iface sym val))
	    (resolve-interface module)))
	  (else
	   (module-use! iface (resolve-interface module)))))
       (r-e-p-i '(m0 m0* ...))
       (r-e-p-i '(mn mn* ...))
       ...))
    ((_)
     (syntax-error "must provide one or more module names"))
    ((_ m m* ...)
     (syntax-error "module names must look like lists"))))
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.