From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Barry Schwartz Newsgroups: gmane.lisp.guile.user Subject: Re: Weird module behaviour Date: Thu, 25 Sep 2014 11:31:34 -0500 Message-ID: <20140925163134.GA9572@crud> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1411677784 2546 80.91.229.3 (25 Sep 2014 20:43:04 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 25 Sep 2014 20:43:04 +0000 (UTC) Cc: "guile-user@gnu.org" To: Panicz Maciej Godek Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Thu Sep 25 22:42:58 2014 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XXFsP-0003KC-9m for guile-user@m.gmane.org; Thu, 25 Sep 2014 22:42:57 +0200 Original-Received: from localhost ([::1]:42787 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XXFsO-00020B-Va for guile-user@m.gmane.org; Thu, 25 Sep 2014 16:42:56 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34290) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XXBxV-000257-80 for guile-user@gnu.org; Thu, 25 Sep 2014 12:32:03 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XXBxO-00074S-IP for guile-user@gnu.org; Thu, 25 Sep 2014 12:31:57 -0400 Original-Received: from resqmta-po-04v.sys.comcast.net ([96.114.154.163]:47192) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XXBxO-00073E-DE for guile-user@gnu.org; Thu, 25 Sep 2014 12:31:50 -0400 Original-Received: from resomta-po-16v.sys.comcast.net ([96.114.154.240]) by resqmta-po-04v.sys.comcast.net with comcast id vUXT1o00B5BUCh401UXcvZ; Thu, 25 Sep 2014 16:31:36 +0000 Original-Received: from crud.chemoelectric.org ([66.41.30.59]) by resomta-po-16v.sys.comcast.net with comcast id vUXa1o00b1GXozm01UXb3T; Thu, 25 Sep 2014 16:31:35 +0000 Original-Received: by crud.chemoelectric.org (Postfix, from userid 1501) id 8AB781460CD2; Thu, 25 Sep 2014 11:31:34 -0500 (CDT) Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.22 (2013-10-16) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=q20140121; t=1411662696; bh=DVONHw3Gww0QDrF7zLbOnhDY2AGyia9gyw6OXpVacMM=; h=Received:Received:Received:Date:From:To:Subject:Message-ID: MIME-Version:Content-Type; b=ffQDSn90dSYlfISKPMlSqUBammXD0YWGuGYFnjqSrCIOw+dRXUWhmVf5QHX+sWN8q doO3PHvIQNU8zmvv/lE89CW69jKiDLWMf1e/oIiFCoZnl+078O/U9akeSQJvi1ELaL zxSqo7cBL2JJvnVgNTUZZ18K85uur+I175lNWrOUMsaLEF7T6oKMK+ZMmuEBzNJ1Fy mefu5jgWe6z+aKMyl4o6M+pXAIAJDCJPtM4s0utzPgbFzX3iazcJ3wn6pS1v372KcG wiNeuLMBZt9UHIWSsN1J5UR46D2L7pvzA7hhO2GoqXoL6+ZEyoHlR9aBQDHFjS+v9D g/HF3+VbuXMew== X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 96.114.154.163 X-Mailman-Approved-At: Thu, 25 Sep 2014 16:42:45 -0400 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Original-Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.user:11554 Archived-At: Panicz Maciej Godek 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.