unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: Barry Schwartz <chemoelectric@chemoelectric.org>
To: Panicz Maciej Godek <godek.maciek@gmail.com>
Cc: "guile-user@gnu.org" <guile-user@gnu.org>
Subject: Re: Weird module behaviour
Date: Thu, 25 Sep 2014 11:31:34 -0500	[thread overview]
Message-ID: <20140925163134.GA9572@crud> (raw)
In-Reply-To: <CAMFYt2ZP+iBN=wFVNwPt_J_FKdNvMB_jHQA0UbmbPbUjaepacw@mail.gmail.com>

Panicz Maciej Godek <godek.maciek@gmail.com> skribis:
> I'm trying to use Aleix Conchillo's guile-redis module for my project,
> and it revealed a surprising use-case.
> Namely, guile-redis consists of several modules that are put together
> in one meta-module, which looks more or less like this:
> 
> (define-module (redis)
>   #:use-module (redis main)
>   #:use-module (redis commands connection)
>   #:use-module (redis commands hashes)
>   #:use-module (redis commands keys)
>   ...)
> 
> (define-syntax re-export-modules
>   (syntax-rules ()
>     ((_ (mod ...) ...)
>      (begin
>        (module-use! (module-public-interface (current-module))
>          (resolve-interface '(mod ...)))
>         ...))))
> 
> (re-export-modules
>   (redis main)
>   (redis commands connection)
>   (redis commands hashes)
>   (redis commands keys)
>   ...)
> 
> So basically the meta-module adds the interfaces of its child modules.
> This isn't particularly surprising, because another way of creating a
> meta-module would be to enumerat all bindings from its child modules,
> which is a lot of work that would create an opportunity for
> desynchronization.

As a side note, FYI I have some stuff called ‘generate-reexporter’ to
help deal with the desync problem, at

   https://bitbucket.org/sortsmill/sortsmill-core-guile

I almost always use R⁶RS-style modules but there is some support for
Guilish notation in the stuff that is being re-exported.



      parent reply	other threads:[~2014-09-25 16:31 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-25 14:04 Weird module behaviour Panicz Maciej Godek
2014-09-25 14:25 ` Taylan Ulrich Bayirli/Kammer
2014-09-25 14:57   ` Panicz Maciej Godek
2014-09-25 17:57     ` Taylan Ulrich Bayirli/Kammer
2014-09-25 16:31 ` Barry Schwartz [this message]

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=20140925163134.GA9572@crud \
    --to=chemoelectric@chemoelectric.org \
    --cc=godek.maciek@gmail.com \
    --cc=guile-user@gnu.org \
    /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).