From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andreas Rottmann Newsgroups: gmane.lisp.guile.bugs Subject: [bug #31472] Probable psyntax bug with multiple defininitions in the macro expansion Date: Tue, 26 Oct 2010 20:42:28 +0000 Message-ID: <20101026-224227.sv12227.22452@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 1288125827 20311 80.91.229.12 (26 Oct 2010 20:43:47 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 26 Oct 2010 20:43:47 +0000 (UTC) To: Andreas Rottmann , bug-guile@gnu.org Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Tue Oct 26 22:43:46 2010 Return-path: Envelope-to: guile-bugs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PAqMx-0002CP-Iq for guile-bugs@m.gmane.org; Tue, 26 Oct 2010 22:43:44 +0200 Original-Received: from localhost ([127.0.0.1]:56417 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PAqMw-0000bz-GH for guile-bugs@m.gmane.org; Tue, 26 Oct 2010 16:43:42 -0400 Original-Received: from [140.186.70.92] (port=43614 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PAqLl-0008OD-PZ for bug-guile@gnu.org; Tue, 26 Oct 2010 16:42:30 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PAqLk-0006rt-OG for bug-guile@gnu.org; Tue, 26 Oct 2010 16:42:29 -0400 Original-Received: from colonialone.fsf.org ([140.186.70.51]:34152 helo=internal.in.savannah.gnu.org) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PAqLk-0006rp-LY for bug-guile@gnu.org; Tue, 26 Oct 2010 16:42:28 -0400 Original-Received: from [10.1.0.103] (helo=frontend.in.savannah.gnu.org) by internal.in.savannah.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1PAqLk-0005zf-Fs; Tue, 26 Oct 2010 20:42:28 +0000 Original-Received: from www-data by frontend.in.savannah.gnu.org with local (Exim 4.69) (envelope-from ) id 1PAqLk-0002FL-E7; Tue, 26 Oct 2010 20:42:28 +0000 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 (X11; U; Linux x86_64; en-US; rv:1.9.2.8) Gecko/20100820 Iceweasel/3.6.8 (like Firefox/3.6.8) X-Apparently-From: 83.215.154.5 (Savane authenticated user rottmann) Original-References: In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-BeenThere: bug-guile@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Errors-To: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.bugs:4839 Archived-At: URL: Summary: Probable psyntax bug with multiple defininitions in the macro expansion Project: Guile Submitted by: rottmann Submitted on: Tue 26 Oct 2010 10:42:27 PM CEST Category: None Severity: 3 - Normal Item Group: None Status: None Privacy: Public Assigned to: None Open/Closed: Open Discussion Lock: Any _______________________________________________________ Details: Given the following library: (library (unbound-bug) (export define-foo) (import (rnrs)) (define-syntax define-foo (lambda (x) (syntax-case x () ((_ name) (identifier? #'name) #'(begin (define t '#(1 2 3)) (define (name) t))))))) I get this (what I deem faulty) behavior: scheme@(guile-user)> (import (unbound-bug)) scheme@(guile-user)> (define-foo bar) scheme@(guile-user)> (bar) :2:1: In procedure module-lookup: :2:1: Unbound variable: t Entering a new prompt. Type `,bt' for a backtrace or `,q' to continue. scheme@(guile-user) [1]> If one modifies the original macro slightly, it works as expected: (define-syntax define-foo (lambda (x) (syntax-case x () ((_ name) (identifier? #'name) (with-syntax ((t (datum->syntax #'name 't))) #'(begin (define t '#(1 2 3)) (define (name) t)))))))) scheme@(guile-user)> (define-foo bar) scheme@(guile-user)> (bar) $1 = #(1 2 3) Also (with the original macro), this works: scheme@(guile-user)> (let () (define-foo bar) (bar)) $1 = #(1 2 3) _______________________________________________________ Reply to this item at: _______________________________________________ Message sent via/by Savannah http://savannah.gnu.org/