From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Neil Jerram Newsgroups: gmane.lisp.guile.user Subject: Re: wrapping `define-syntax' Date: Mon, 13 Apr 2009 10:35:15 +0100 Message-ID: <8763h8rj58.fsf@arudy.ossau.uklinux.net> References: <2bc5f8210904121555v1090cb8ej6602f72beefa2f20@mail.gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1239615559 15552 80.91.229.12 (13 Apr 2009 09:39:19 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 13 Apr 2009 09:39:19 +0000 (UTC) Cc: Guile Users To: Julian Graham Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Mon Apr 13 11:40:38 2009 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1LtIea-0005G1-Mz for guile-user@m.gmane.org; Mon, 13 Apr 2009 11:40:36 +0200 Original-Received: from localhost ([127.0.0.1]:56437 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LtIdB-0006kp-LS for guile-user@m.gmane.org; Mon, 13 Apr 2009 05:39:09 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LtIZX-0005yh-9B for guile-user@gnu.org; Mon, 13 Apr 2009 05:35:23 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LtIZR-0005xZ-Vq for guile-user@gnu.org; Mon, 13 Apr 2009 05:35:21 -0400 Original-Received: from [199.232.76.173] (port=44351 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LtIZR-0005xI-Cb for guile-user@gnu.org; Mon, 13 Apr 2009 05:35:17 -0400 Original-Received: from mail3.uklinux.net ([80.84.72.33]:47401) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LtIZQ-0003HV-Ti for guile-user@gnu.org; Mon, 13 Apr 2009 05:35:17 -0400 Original-Received: from arudy (host86-145-49-20.range86-145.btcentralplus.com [86.145.49.20]) by mail3.uklinux.net (Postfix) with ESMTP id 1E0581F6DAE; Mon, 13 Apr 2009 10:35:16 +0100 (BST) Original-Received: from arudy.ossau.uklinux.net (arudy [127.0.0.1]) by arudy (Postfix) with ESMTP id 6C2513801E; Mon, 13 Apr 2009 10:35:15 +0100 (BST) In-Reply-To: <2bc5f8210904121555v1090cb8ej6602f72beefa2f20@mail.gmail.com> (Julian Graham's message of "Sun\, 12 Apr 2009 18\:55\:22 -0400") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.4-2.6 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.user:7209 Archived-At: Julian Graham writes: > Hi Guilers, Hi! > For the purpose of some experiments I've been doing with integrating > R6RS libraries, I've been trying to figure out ways to wrap > `define-syntax' so that I can do things like add bindings to a > module's eval closure before evaluating a macro definition. Can you give an example? > As part > of this mechanism, I need to be able to save the original transformer > for `define-syntax' so that I can delegate to it. When I run the > following code (either in master or Andy Wingo's "syncase" branch)... > > (use-modules (ice-9 syncase)) > (define canonical-define-syntax (@ (ice-9 syncase) define-syntax)) > (canonical-define-syntax foo (syntax-rules () ((_) 'foo))) > > ...I get: > > ERROR: In procedure vm-run: > ERROR: VM: Stack overflow Hmm. I don't really have much idea... but given that define-syntax is syntax, does (define-syntax canonical-define-syntax define-syntax) work any better? Also does it make any difference if you use use-syntax instead of use-modules ? Regards, Neil