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 12:51:18 -0400 [thread overview]
Message-ID: <CAFGZJC5=jgdsmHi2KLAQdU4MV2i3Jj=YJxOagM02aBnuhtXhvg@mail.gmail.com> (raw)
In-Reply-To: <aa9c0dbf56dbbdb3b6f787350c93a66dd67502d8.camel@student.tugraz.at>
On 8/24/20, Leo Prikler <leo.prikler@student.tugraz.at> wrote:
> My solution for this problem would be to build on some of the module
> "intrinsics", which sadly are not all that well documented.
>
> (define-module (a))
>
> (let ((obs (module-obarray (resolve-interface '(srfi srfi-1))))
> (iface (module-public-interface (current-module))))
> (hash-fold
> (lambda (key value seed)
> (module-add! iface key value)
> seed)
> *unspecified*
> obs))
>
> If you want to make this a macro, you really only need to syntax-
> unquote a module into the (resolve-interface ...) portion of this
> snippet.
So with that in mind, how about something like this (currently no
error checking):
(define-syntax re-export-public-interface
(syntax-rules ()
((_ mod ...)
(let ((iface (module-public-interface (current-module))))
(module-for-each
(lambda (sym val)
(module-add! iface sym val)
(hashq-set! (module-replacements iface) sym #t))
(resolve-interface 'mod))
...))))
next prev parent reply other threads:[~2020-08-26 16:51 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 [this message]
2020-08-26 17:06 ` Leo Prikler
2020-08-27 2:21 ` Dale Smith
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='CAFGZJC5=jgdsmHi2KLAQdU4MV2i3Jj=YJxOagM02aBnuhtXhvg@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).