From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Mikael Djurfeldt Newsgroups: gmane.lisp.guile.user,gmane.lisp.guile.bugs Subject: Re: export in syntax-rules Date: Mon, 27 Jan 2003 12:23:16 +0100 Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Message-ID: References: <87vg0bec9f.fsf@zip.com.au> Reply-To: djurfeldt@nada.kth.se NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1043666925 11037 80.91.224.249 (27 Jan 2003 11:28:45 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 27 Jan 2003 11:28:45 +0000 (UTC) Cc: guile-user@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 18d7RT-0002rt-00 for ; Mon, 27 Jan 2003 12:28:43 +0100 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 18d7Pa-00087z-06 for guile-user@m.gmane.org; Mon, 27 Jan 2003 06:26:46 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 18d7OI-00080F-00 for guile-user@gnu.org; Mon, 27 Jan 2003 06:25:26 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 18d7NR-0007n6-00 for guile-user@gnu.org; Mon, 27 Jan 2003 06:24:49 -0500 Original-Received: from kvast.blakulla.net ([213.212.20.77]) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18d7Mx-0007fq-00; Mon, 27 Jan 2003 06:24:03 -0500 Original-Received: from barbara.blakulla.net ([213.212.21.238] helo=linnaeus) by kvast.blakulla.net with esmtp (Exim 3.36 #1 (Debian)) id 18d7MS-0000nq-00; Mon, 27 Jan 2003 12:23:32 +0100 Original-Received: from mdj by linnaeus with local (Exim 3.36 #1 (Debian)) id 18d7MC-0008K7-00; Mon, 27 Jan 2003 12:23:16 +0100 Original-To: Kevin Ryde In-Reply-To: <87vg0bec9f.fsf@zip.com.au> (Kevin Ryde's message of "Mon, 27 Jan 2003 09:12:44 +1000") User-Agent: Gnus/5.090008 (Oort Gnus v0.08) Emacs/21.2 (i386-pc-linux-gnu) Original-cc: djurfeldt@nada.kth.se Original-cc: bug-guile@gnu.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:1578 gmane.lisp.guile.bugs:636 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.user:1578 Kevin Ryde writes: > In guile 1.6.1 on a recent i386 debian, I thought to use "export" > inside a syntax-rules in a module definition, for instance > > (define-module (abc def) > #:use-module (ice-9 syncase)) You might want to use #:use-syntax (ice-9 syncase) here instead, otherwise syntax-case expansion is only invoked when syntax-case macros are called in an s-expression. That disables singleton macros and can cause unexpected errors with regard to scope. > (define-syntax foo > (syntax-rules () > ((foo name) > (export name)))) > > (define x 123) > (foo x) > > But I got an error, > > ERROR: In procedure variable-ref: > ERROR: Wrong type argument in position 1 (expecting variable): #f > > Is this sort of thing meant to work, or have I made some basic error? > > (I was looking to make "-public" versions of some macros. I got the > effect I wanted with a procedure->macro, but just wondered if the > syntax-rules style was valid.) This is caused by a bug in syncase.scm. I've fixed this in CVS 1.7.0 and in the 1.6 branch. 1.6.2 will contain the fix. 2003-01-27 Mikael Djurfeldt * syncase.scm (guile-macro): Strip syntactic information from expression before trying to treat it as a Guile macro call. (Thanks to Kevin Ryde.) _______________________________________________ Guile-user mailing list Guile-user@gnu.org http://mail.gnu.org/mailman/listinfo/guile-user