|
From: | Helmut Eller |
Subject: | [Bug-kawa] [bug #35533] Unhygienic expansion |
Date: | Wed, 15 Feb 2012 11:59:46 +0000 |
User-agent: | Opera/9.80 (X11; Linux i686; U; en) Presto/2.10.229 Version/11.61 |
URL: <http://savannah.gnu.org/bugs/?35533> Summary: Unhygienic expansion Project: Kawa Submitted by: ellerh Submitted on: Wed 15 Feb 2012 11:59:45 AM GMT Category: None Severity: 3 - Normal Item Group: None Status: None Privacy: Public Assigned to: None Open/Closed: Open Discussion Lock: Any _______________________________________________________ Details: Unhygienic expansion In this example def-foo is no expanded correctly. foo-aux should be a fresh identifier for each use of def-foo. (define-syntax def-foo (syntax-rules () ((def-foo name) (begin (define (foo-aux obj) (eq? obj 'name)) (define (name obj) (foo-aux obj)))))) (def-foo bar) (def-foo baz) (when (or (not (bar 'bar)) (not (baz 'baz)) (bar 'baz) (baz 'bar)) (error "bug")) This is the output of the compiler: shell> kawa --version -C y.scm Kawa 1.12 (revision 7169M) Copyright (C) 2011 Per Bothner (compiling y.scm) y.scm:10:16: duplicate declaration of 'foo-aux' y.scm:10:16: (this is the previous declaration of 'foo-aux') [Exit 1] _______________________________________________________ Reply to this item at: <http://savannah.gnu.org/bugs/?35533> _______________________________________________ Message sent via/by Savannah http://savannah.gnu.org/
[Prev in Thread] | Current Thread | [Next in Thread] |