From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Lynn Winebarger Newsgroups: gmane.lisp.guile.devel Subject: Re: syntax-case Date: Mon, 19 Aug 2002 10:22:08 -0500 Sender: guile-devel-admin@gnu.org Message-ID: <0208191022080A.19624@locke.free-expression.org> References: <02081909573609.19624@locke.free-expression.org> NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit X-Trace: main.gmane.org 1029770715 25529 127.0.0.1 (19 Aug 2002 15:25:15 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 19 Aug 2002 15:25:15 +0000 (UTC) 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 17goP1-0006dH-00 for ; Mon, 19 Aug 2002 17:25:12 +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 17goQ2-0001IM-00; Mon, 19 Aug 2002 11:26:14 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10) id 17goPf-00012d-00 for guile-devel@gnu.org; Mon, 19 Aug 2002 11:25:51 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10) id 17goPa-00010d-00 for guile-devel@gnu.org; Mon, 19 Aug 2002 11:25:47 -0400 Original-Received: from julesburg.uits.indiana.edu ([129.79.1.75]) by monty-python.gnu.org with esmtp (Exim 4.10) id 17goPZ-0000zY-00 for guile-devel@gnu.org; Mon, 19 Aug 2002 11:25:45 -0400 Original-Received: from stjoseph.uits.indiana.edu (stjoseph.uits.indiana.edu [129.79.1.78]) by julesburg.uits.indiana.edu (8.12.1/8.12.1/IUPO) with ESMTP id g7JFPg6B011962 for ; Mon, 19 Aug 2002 10:25:42 -0500 (EST) Original-Received: from locke.free-expression.org (dial-122-15.dial.indiana.edu [156.56.122.15]) by stjoseph.uits.indiana.edu (8.12.1/8.12.1/IUPO) with SMTP id g7JFPg6I002728 for ; Mon, 19 Aug 2002 10:25:43 -0500 (EST) Original-To: guile-devel@gnu.org X-Mailer: KMail [version 1.2] In-Reply-To: <02081909573609.19624@locke.free-expression.org> 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:1120 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.devel:1120 On Monday 19 August 2002 09:57, Lynn Winebarger wrote: > Does anyone else see the following behaviour (from a Petite Chez > session) as inconsistent? > I was trying to figure out how you can eagerly expand macros without > worrying about this sort of thing, and this sort of thing means the dependence of a macro expansion on a variable binding that could change. And apparently, plain lexical variable bindings are not in scope in a let(rec)-syntax, but global variable bindings are. The last email didn't include an example of the global binding working in a let-syntax (just in define-syntax), so here's one (again from Chez): > (define x 5) > (let-syntax ((foo (lambda (exp) (syntax-case exp () ((_ y) (with-syntax ((z (datum->syntax-object (syntax _) x))) (syntax (quote (z y))))))))) (foo 'bar)) (5 'bar) > I had thought this behaviour was part of syntax-case, but now I see it's actually part of let(rec)-syntax. If the lexical variables were in scope in a let(rec)-syntax, macros would have to be re-expanded every time an expression that contained them got executed. I'm not sure why the same criticism doesn't hold for global variable bindings, though. Lynn _______________________________________________ Guile-devel mailing list Guile-devel@gnu.org http://mail.gnu.org/mailman/listinfo/guile-devel