From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Joris van der Hoeven Newsgroups: gmane.lisp.guile.user Subject: Re: Two questions about the guile module system Date: Sat, 5 Apr 2003 15:39:01 +0200 (CEST) Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Message-ID: References: <87znn5rxju.fsf@zagadka.ping.de> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Trace: main.gmane.org 1049561935 16396 80.91.224.249 (5 Apr 2003 16:58:55 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sat, 5 Apr 2003 16:58:55 +0000 (UTC) Cc: guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Sat Apr 05 18:58:53 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 191r0F-00043E-00 for ; Sat, 05 Apr 2003 18:58:53 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 191qnL-0006wv-00 for guile-user@m.gmane.org; Sat, 05 Apr 2003 11:45:31 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 191qmW-0006oR-00 for guile-user@gnu.org; Sat, 05 Apr 2003 11:44:40 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 191qm0-0006fT-00 for guile-user@gnu.org; Sat, 05 Apr 2003 11:44:39 -0500 Original-Received: from mathups.math.u-psud.fr ([129.175.52.4] helo=matups.math.u-psud.fr) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 191qli-0006MQ-00 for guile-user@gnu.org; Sat, 05 Apr 2003 11:43:51 -0500 Original-Received: from anh.math.u-psud.fr (sunanh.math.u-psud.fr [129.175.50.1]) h35Dd18W016774 ; Sat, 5 Apr 2003 15:39:01 +0200 (MEST) Original-Received: by anh.math.u-psud.fr (Postfix, from userid 8116) id 26E3EC00E; Sat, 5 Apr 2003 15:39:01 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by anh.math.u-psud.fr (Postfix) with ESMTP id 1E4ED58D6; Sat, 5 Apr 2003 15:39:01 +0200 (CEST) X-X-Sender: Original-To: Marius Vollmer In-Reply-To: <87znn5rxju.fsf@zagadka.ping.de> Original-cc: contact@texmacs.org X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: General Guile related discussions List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: main.gmane.org gmane.lisp.guile.user:1767 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.user:1767 > > I now notice that my solution from yesterday does not work with more > > recent versions of guile. > > I have tested it with guile-1.6.3 and recent CVS HEAD; both work fine. > What version are you talking about and what goes wrong? The code does indeed re-export all symbols from an imported module, but it does not solve my original problem. In guile 1.3.4, I could put the following in my main initialization file: (use-modules (boot-stuff)) ; defines export-from (use-modules (std-lib-1) ... (std-lib-n)) (export-from (std-lib-1) ... (std-lib-n)) ... (use-modules (appl-mod-1) ... (appl-mod-k)) ... When doing this, I can use all variables exported by the standard libraries std-lib-1, ..., std-lib-n inside appl-mod-1, ..., appl-mod-k. Unfortunately, this mechanism breaks in guile-1.6.3. The point is that, during the importation of appl-mod-1, ..., appl-mod-k, the outer context is lost. It seems that only a very minimal context is visible inside the application modules. Nevertheless, before the actual (define-module (appl-mod-i)) definition is issues, the original context *is* visible. So if one defines a 'define-my-module' macro, then that macro can be used, although this might be unsafe. > (Btw, there is also module-map which might be more natural to use in > place of module-for-each.) What does that routine do? > > This makes it impossible to enhance the root environment > > with even a single macro like 'define-my-module'. > > I find this not to be true, but it is indeed tricky to reason about > the context in which modules are loaded. So how can I make things such that whenever I declare a new module, then all symbols which are visible in the initial context are available by default? This important, since I also noticed that even the C++ routines which I glued to Guile are not available inside my modules! _______________________________________________ Guile-user mailing list Guile-user@gnu.org http://mail.gnu.org/mailman/listinfo/guile-user