unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
From: Dale Smith <dalepsmith@gmail.com>
To: Leo Prikler <leo.prikler@student.tugraz.at>
Cc: 43025@debbugs.gnu.org
Subject: bug#43025: re-export-public-interface fails on Guile 3
Date: Wed, 26 Aug 2020 22:21:04 -0400	[thread overview]
Message-ID: <CAFGZJC7vAjNLJEU9L6FwdTdUb3+mXE2LTV4xFLeAix8ONP+2+w@mail.gmail.com> (raw)
In-Reply-To: <CAFGZJC5=jgdsmHi2KLAQdU4MV2i3Jj=YJxOagM02aBnuhtXhvg@mail.gmail.com>

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





  parent reply	other threads:[~2020-08-27  2:21 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-24 16:11 bug#43025: re-export-public-interface fails on Guile 3 Dale Smith
2020-08-24 19:50 ` Leo Prikler
2020-08-26 16:51   ` Dale Smith
2020-08-26 17:06     ` Leo Prikler
2020-08-27  2:21     ` Dale Smith [this message]
2020-08-28  0:12       ` Dale Smith
2020-08-28 19:22         ` Dale Smith
2021-03-12 14:12 ` Dale Smith

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAFGZJC7vAjNLJEU9L6FwdTdUb3+mXE2LTV4xFLeAix8ONP+2+w@mail.gmail.com \
    --to=dalepsmith@gmail.com \
    --cc=43025@debbugs.gnu.org \
    --cc=leo.prikler@student.tugraz.at \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).