From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?UTF-8?B?R8O2cmFu?= Weinholt Newsgroups: gmane.lisp.guile.bugs Subject: [bug #31472] Probable psyntax bug with multiple defininitions in the macro expansion Date: Sat, 21 May 2011 13:46:44 +0000 Message-ID: <20110521-154644.sv2373.44958@savannah.gnu.org> References: <20101026-224227.sv12227.22452@savannah.gnu.org> <20110227-123349.sv20118.5365@savannah.gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain;charset=UTF-8 X-Trace: dough.gmane.org 1305985124 11505 80.91.229.12 (21 May 2011 13:38:44 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 21 May 2011 13:38:44 +0000 (UTC) To: Andreas Rottmann , Andy Wingo , =?UTF-8?B?R8O2cmFu?= Weinholt , bug-guile@gnu.org Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Sat May 21 15:38:39 2011 Return-path: Envelope-to: guile-bugs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QNmO6-0004UB-1y for guile-bugs@m.gmane.org; Sat, 21 May 2011 15:38:38 +0200 Original-Received: from localhost ([::1]:39419 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QNmO5-00078h-7B for guile-bugs@m.gmane.org; Sat, 21 May 2011 09:38:37 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:40453) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QNmO2-00078Z-2T for bug-guile@gnu.org; Sat, 21 May 2011 09:38:35 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QNmO0-000119-Tz for bug-guile@gnu.org; Sat, 21 May 2011 09:38:33 -0400 Original-Received: from colonialone.fsf.org ([140.186.70.51]:53846 helo=frontend.in.savannah.gnu.org) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QNmO0-000112-SB for bug-guile@gnu.org; Sat, 21 May 2011 09:38:32 -0400 Original-Received: from www-data by frontend.in.savannah.gnu.org with local (Exim 4.72) (envelope-from ) id 1QNmVw-0003Pq-HU; Sat, 21 May 2011 13:46:44 +0000 X-PHP-Originating-Script: 0:sendmail.php X-Savane-Server: savannah.gnu.org:443 [10.1.0.103] X-Savane-Project: guile X-Savane-Tracker: bugs X-Savane-Item-ID: 31472 User-Agent: Mozilla/5.0 X-Apparently-From: 95.80.32.5 (Savane authenticated user weinholt) In-Reply-To: <20110227-123349.sv20118.5365@savannah.gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.51 X-BeenThere: bug-guile@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Original-Sender: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.bugs:5601 Archived-At: Follow-up Comment #2, bug #31472 (project guile): Hello guilers, I want to note some problems that I suspect are caused by this bug. In this example it looks like (define-foo foo1) and (define-foo foo2) use the same identifier for `t' (the latter definition overrides the first): GNU Guile 2.0.1.79-a02a Copyright (C) 1995-2011 Free Software Foundation, Inc. Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'. This program is free software, and you are welcome to redistribute it under certain conditions; type `,show c' for details. Enter `,help' for help. scheme@(guile-user)> (library (temporaries-bug) (export foo1 foo2) (import (rnrs)) (define-syntax define-foo (lambda (x) (syntax-case x () ((_ name) (identifier? #'name) #'(begin (define t '(foo name)) (define (name) t)))))) (define-foo foo1) (define-foo foo2)) scheme@(temporaries-bug)> ,m (guile-user) scheme@(guile-user)> (import (temporaries-bug)) scheme@(guile-user)> (foo1) $1 = (foo foo2) scheme@(guile-user)> (foo2) $2 = (foo foo2) One can workaround this issue by using generate-temporaries. But that doesn't work when (name) is syntax. Here I expect the library to export syntax that can be used as (foo3), which would evaluate to the list (foo foo3): scheme@(guile-user)> (library (temporaries2-bug) (export foo3 foo4) (import (rnrs)) (define-syntax define-foo (lambda (x) (syntax-case x () ((_ name) (identifier? #'name) (with-syntax (((t) (generate-temporaries #'(name)))) #'(begin (define t '(foo name)) (define-syntax name (lambda (x) (syntax-case x () ((_) #'t)))))))))) (define-foo foo3) (define-foo foo4)) scheme@(temporaries2-bug)> ,m (guile-user) scheme@(guile-user)> (import (temporaries2-bug)) scheme@(guile-user)> (foo3) ;;; :7:0: warning: possibly unbound variable `#{ g238}#' :6:0: In procedure #:7:0 ()>: :6:0: In procedure module-lookup: Unbound variable: #{ g238}# Entering a new prompt. Type `,bt' for a backtrace or `,q' to continue. scheme@(guile-user) [1]> _______________________________________________________ Reply to this item at: _______________________________________________ Message sent via/by Savannah http://savannah.gnu.org/