From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: tb@becket.net (Thomas Bushnell, BSG) Newsgroups: gmane.lisp.guile.devel Subject: Re: module trickery Date: 30 Aug 2002 16:02:34 -0700 Sender: guile-devel-admin@gnu.org Message-ID: <87ptw0ymph.fsf@becket.becket.net> References: <87elcibm29.fsf@becket.becket.net> <87y9apqtyt.fsf@zagadka.ping.de> NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1030748385 25379 127.0.0.1 (30 Aug 2002 22:59:45 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Fri, 30 Aug 2002 22:59:45 +0000 (UTC) Cc: guile-devel@gnu.org 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 17kujv-0006bC-00 for ; Sat, 31 Aug 2002 00:59:44 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10) id 17kulL-00017x-00; Fri, 30 Aug 2002 19:01:11 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10) id 17kul0-00017U-00 for guile-devel@gnu.org; Fri, 30 Aug 2002 19:00:50 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10) id 17kukx-00017I-00 for guile-devel@gnu.org; Fri, 30 Aug 2002 19:00:49 -0400 Original-Received: from vp190174.reshsg.uci.edu ([128.195.190.174] helo=becket.becket.net) by monty-python.gnu.org with esmtp (Exim 4.10) id 17kukx-00017E-00 for guile-devel@gnu.org; Fri, 30 Aug 2002 19:00:47 -0400 Original-Received: from tb by becket.becket.net with local (Exim 3.35 #1 (Debian)) id 17kumg-0002eP-00; Fri, 30 Aug 2002 16:02:34 -0700 Original-To: Marius Vollmer X-Reply-Permission: Posted or emailed replies to this message constitute permission for an emailed response. X-PGP-Fingerprint: 1F0A1E51 63 28 EB DA E6 44 E5 5E EC F3 04 26 4E BF 1A 92 X-Zippy-Says: I want a VEGETARIAN BURRITO to go.. with EXTRA MSG!! In-Reply-To: <87y9apqtyt.fsf@zagadka.ping.de> Original-Lines: 58 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Errors-To: guile-devel-admin@gnu.org X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Developers list for Guile, the GNU extensibility library List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.lisp.guile.devel:1208 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.devel:1208 Marius Vollmer writes: > tb@becket.net (Thomas Bushnell, BSG) writes: > > > (module-use! special-module (resolve-module '(python syntax))) > > > > The (python syntax) module creates syntax with define-syntax, and does > > nothing out of the ordinary. > > > > When I evaluate expressions in special-module which use the syntax > > defined in (python syntax), things go into an infinite loop. The > > macro I'm testing is blindingly simple and works fine in a normal > > environment. > > Please try what happens when you also do > > (use-modules (ice-9 syncase)) > (module-use! special-module (resolve-module '(ice-9 syncase))) > (set-module-transformer! special-module syncase) > > The 'module transformer' needs to be set up so that syntax-case > expansion can work. No discernable effect. Here is exactly what I have so far... The macros are defined inside (define-module (python syntax)). Then I want to incorporate those macros into my special module; which is set up as follows: (define python-toplevel (make-module)) (beautify-user-module! python-toplevel) (module-use! python-toplevel (resolve-module '(python syntax))) (module-use! python-toplevel (resolve-module '(ice-9 syncase))) (set-module-transformer! python-toplevel syncase) ;;; Insert the definitions of the (python __builtin__) module ;;; into python-toplevel. Note that this is not an import: we ;;; do *not* share bindings with the module. That's because we ;;; shouldn't allow sets here to blow them away. (module-for-each (lambda (name variable) (module-define! python-toplevel name (variable-ref variable))) (resolve-module '(python __builtin__))) Then I want to evaluate expressions inside this module with the following: (eval-in-module SEXP python-toplevel) I'm quite flexible here... anything that lets me set up the relevant module and do eval-in-module will be fine by me. Switching from Guile 1.4 to the latest 1.5 test release is not unacceptible, if it will really work. Thomas _______________________________________________ Guile-devel mailing list Guile-devel@gnu.org http://mail.gnu.org/mailman/listinfo/guile-devel