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 #20941] Modules interact badly with macros Date: Fri, 31 Aug 2007 12:41:49 +0000 Message-ID: <20070831-144148.sv12227.6245@savannah.gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain;charset=UTF-8 X-Trace: sea.gmane.org 1188564120 18142 80.91.229.12 (31 Aug 2007 12:42:00 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 31 Aug 2007 12:42:00 +0000 (UTC) To: Andreas Rottmann , bug-guile@gnu.org Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Fri Aug 31 14:41:59 2007 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.50) id 1IR5ox-0006dq-Sd for guile-bugs@m.gmane.org; Fri, 31 Aug 2007 14:41:56 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IR5ox-0000o3-DJ for guile-bugs@m.gmane.org; Fri, 31 Aug 2007 08:41:55 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IR5ot-0000nq-OO for bug-guile@gnu.org; Fri, 31 Aug 2007 08:41:51 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IR5ot-0000ne-7K for bug-guile@gnu.org; Fri, 31 Aug 2007 08:41:51 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IR5ot-0000nb-2z for bug-guile@gnu.org; Fri, 31 Aug 2007 08:41:51 -0400 Original-Received: from savannah.gnu.org ([199.232.41.3] helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1IR5os-0003Se-Ot for bug-guile@gnu.org; Fri, 31 Aug 2007 08:41:50 -0400 Original-Received: from savannah.gnu.org ([199.232.41.3] helo=frontend) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1IR5os-0000cl-0Z; Fri, 31 Aug 2007 12:41:50 +0000 Original-Received: from www-data by frontend with local (Exim 4.63) (envelope-from ) id 1IR5or-0000ci-Qp; Fri, 31 Aug 2007 12:41:49 +0000 X-Savane-Server: savannah.gnu.org:443 [199.232.41.3] X-Savane-Project: guile X-Savane-Tracker: bugs X-Savane-Item-ID: 20941 User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.6) Gecko/20070723 Iceweasel/2.0.0.6 (Debian-2.0.0.6-1) X-Apparently-From: 84.112.165.172 (Savane authenticated user rottmann) Original-References: In-Reply-To: X-Detected-Kernel: Linux 2.6 (newer, 3) 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:3584 Archived-At: URL: Summary: Modules interact badly with macros Project: Guile Submitted by: rottmann Submitted on: Friday 08/31/2007 at 14:41 Category: None Severity: 3 - Normal Item Group: None Status: None Privacy: Public Assigned to: None Open/Closed: Open Discussion Lock: Any _______________________________________________________ Details: When a (syntax-rules) macro expands into the use of an internal procedure, the module the macro resides in must export that internal procedure, which should not be necessary. Example session: guile> (version) "1.8.2" guile> (define-module (test) #:export (test-macro) #:use-module (ice-9 syncase) # guile> (define (test-proc x) (write x) (newline)) guile> (define-syntax test-macro (syntax-rules () ((test-macro x) (test-proc (* x x))))) guile> (define-module (test-user) #:use-module (test)) # guile> test-macro # guile> (test-macro 5) Backtrace: In standard input: 9: 0* (test-macro 5) 9: 1 (test-proc (* 5 5)) standard input:9:1: In expression (test-proc (* 5 5)): standard input:9:1: Unbound variable: test-proc ABORT: (unbound-variable) guile> Here is a session with gauche, which gets this right: gosh> (define-module test (export test-macro) (define (test-proc x) (write x) (newline)) (define-syntax test-macro (syntax-rules () ((test-macro x) (test-proc (* x x)))))) gosh> (import test) # gosh> test-macro # gosh> (test-macro 5) 25 # gosh> _______________________________________________________ Reply to this item at: _______________________________________________ Message sent via/by Savannah http://savannah.gnu.org/ _______________________________________________ Bug-guile mailing list Bug-guile@gnu.org http://lists.gnu.org/mailman/listinfo/bug-guile