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: more syntax silliness Date: Mon, 19 Aug 2002 10:54:57 -0500 Sender: guile-devel-admin@gnu.org Message-ID: <0208191054570B.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 1029772875 30169 127.0.0.1 (19 Aug 2002 16:01:15 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 19 Aug 2002 16:01: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 17goxs-0007py-00 for ; Mon, 19 Aug 2002 18:01:13 +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 17goyv-0007cn-00; Mon, 19 Aug 2002 12:02:17 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10) id 17gowX-0007Pt-00 for guile-devel@gnu.org; Mon, 19 Aug 2002 11:59:49 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10) id 17gowV-0007PO-00 for guile-devel@gnu.org; Mon, 19 Aug 2002 11:59:49 -0400 Original-Received: from julesburg.uits.indiana.edu ([129.79.1.75]) by monty-python.gnu.org with esmtp (Exim 4.10) id 17gowV-0007PH-00 for guile-devel@gnu.org; Mon, 19 Aug 2002 11:59:47 -0400 Original-Received: from logchain.uits.indiana.edu (logchain.uits.indiana.edu [129.79.1.77]) by julesburg.uits.indiana.edu (8.12.1/8.12.1/IUPO) with ESMTP id g7JFxh6B019950 for ; Mon, 19 Aug 2002 10:59:43 -0500 (EST) Original-Received: from locke.free-expression.org (dial-124-21.dial.indiana.edu [156.56.124.21]) by logchain.uits.indiana.edu (8.12.1/8.12.1/IUPO) with SMTP id g7JFxiDH005370 for ; Mon, 19 Aug 2002 10:59:44 -0500 (EST) Original-To: guile-devel@gnu.org X-Mailer: KMail [version 1.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:1121 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.devel:1121 You can still get dynamic redefinition of syntax: (define tmp (let ((x 5)) (list (lambda (y) (set! x y)) (lambda () x) (lambda (exp) (syntax-case exp () ((_ z) (with-syntax ((x2 (datum->syntax-object (syntax _) x))) (syntax '(z x2))))))))) (define setx (car tmp)) (define getx (cadr tmp)) (define-syntax foo (caddr tmp)) > (foo bar) (bar 8) > (setx 3) > (let-syntax ((baz (caddr tmp))) (display (baz bar)) (newline) (setx 'different) (display (baz bar)) (newline) (display (foo bar)) (newline)) (bar 3) (bar 3) (bar 3) > (foo bar) (bar different) Now here's the fun part: > (setx 2) > (let-syntax ((baz (caddr tmp))) (display (baz bar)) (newline) (let-syntax ((foo (let () (setx 3) (caddr tmp)))) (display (baz bar)) (newline) (display (foo bar)) (newline)) (display (baz bar)) (newline)) (bar 2) (bar 2) (bar 3) (bar 3) > (setx 2) > (let-syntax ((baz (caddr tmp))) (display (baz bar)) (newline) (let-syntax ((foo (let () (setx 3) (caddr tmp)))) (display (foo bar)) (newline) (display (baz bar)) (newline)) (display (baz bar)) (newline)) (bar 2) (bar 3) (bar 3) (bar 3) > I don't know why the first and the second don't have the same output. That is, it appears the inner foo's definition doesn't get evaluated until that foo is actually used. This seems to me a mistake in Chez, but I could be wrong. Lynn _______________________________________________ Guile-devel mailing list Guile-devel@gnu.org http://mail.gnu.org/mailman/listinfo/guile-devel