GNU bug report logs - #43025
re-export-public-interface fails on Guile 3

Previous Next

Package: guile;

Reported by: Dale Smith <dalepsmith <at> gmail.com>

Date: Mon, 24 Aug 2020 16:12:01 UTC

Severity: normal

Done: Dale Smith <dalepsmith <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #17 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Dale Smith <dalepsmith <at> gmail.com>
To: Leo Prikler <leo.prikler <at> student.tugraz.at>
Cc: bug-guile <at> gnu.org
Subject: Re: re-export-public-interface fails on Guile 3
Date: Wed, 26 Aug 2020 22:21:04 -0400
This seems to  work for guile-2.2 and guile-3.
Would be nice if it checked that module names look like lists.

One step closer to g-golf working on guile-3!

(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) ...)}."
    ((_ mod mods ...)
     (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 'mod)
       (r-e-p-i 'mods)
       ...))))




This bug report was last modified 4 years and 157 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.