Panicz Maciej Godek <godek.mac...@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.