From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Mark H Weaver Newsgroups: gmane.lisp.guile.bugs Subject: bug#18245: [master branch] Useless imported module cause strange problem Date: Mon, 11 Aug 2014 11:30:32 -0400 Message-ID: <874mxjqc13.fsf@yeeloong.lan> References: <1407748488.5167.7.camel@Renee-desktop.suse> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1407771164 23944 80.91.229.3 (11 Aug 2014 15:32:44 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 11 Aug 2014 15:32:44 +0000 (UTC) Cc: 18245@debbugs.gnu.org, request@debbugs.gnu.org To: Nala Ginrut Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Mon Aug 11 17:32:36 2014 Return-path: Envelope-to: guile-bugs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XGraE-0003KE-Jf for guile-bugs@m.gmane.org; Mon, 11 Aug 2014 17:32:26 +0200 Original-Received: from localhost ([::1]:36744 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XGraE-0008AZ-7g for guile-bugs@m.gmane.org; Mon, 11 Aug 2014 11:32:26 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57935) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XGra0-0007vi-Fc for bug-guile@gnu.org; Mon, 11 Aug 2014 11:32:19 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XGrZq-0007eA-AJ for bug-guile@gnu.org; Mon, 11 Aug 2014 11:32:12 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:60778) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XGrZq-0007e6-7n for bug-guile@gnu.org; Mon, 11 Aug 2014 11:32:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1XGrZp-0006CS-Tn for bug-guile@gnu.org; Mon, 11 Aug 2014 11:32:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Mark H Weaver Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Mon, 11 Aug 2014 15:32:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 18245 X-GNU-PR-Package: guile X-GNU-PR-Keywords: Original-Received: via spool by 18245-submit@debbugs.gnu.org id=B18245.140777110723806 (code B ref 18245); Mon, 11 Aug 2014 15:32:01 +0000 Original-Received: (at 18245) by debbugs.gnu.org; 11 Aug 2014 15:31:47 +0000 Original-Received: from localhost ([127.0.0.1]:39487 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XGrZW-0006Bk-Vw for submit@debbugs.gnu.org; Mon, 11 Aug 2014 11:31:47 -0400 Original-Received: from world.peace.net ([96.39.62.75]:41425 ident=hope2) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XGrZL-0006BL-NS; Mon, 11 Aug 2014 11:31:36 -0400 Original-Received: from c-24-62-95-23.hsd1.ma.comcast.net ([24.62.95.23] helo=yeeloong.lan) by world.peace.net with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.72) (envelope-from ) id 1XGrZB-0003RX-EZ; Mon, 11 Aug 2014 11:31:21 -0400 In-Reply-To: <1407748488.5167.7.camel@Renee-desktop.suse> (Nala Ginrut's message of "Mon, 11 Aug 2014 17:14:48 +0800") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-guile@gnu.org 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:7537 Archived-At: tags 18245 notabug close 18245 thanks Nala Ginrut writes: > I've imported srfi-1, but after some modifications, the program happens > not to use any srfi-1 symbols, then there's the problem that one of the > rule in syntax-rules can't be found and threw error. > It works when I removed useless srfi-1 from imported list. The problem is that srfi-1 exports a 'drop' procedure, and 'drop' is also used as a syntax-rules literal in your macros. Literals are matched as follows: if the literal identifier has the same name and the same binding where the macro is defined and where it is used, then there's a match. If the identifier is not bound in either place, then there's also a match. However, in this case 'drop' is not defined where the 'sql-alter' macro is defined, but it _is_ defined to a procedure in srfi-1 in your example module where it is used. Therefore, the macro does not consider the 'drop' to be a match for the literal it's looking for. This is similar to the issue that if you define 'else' to be something in a module (or import it from somewhere), then 'else' will no longer have its special meaning in a 'cond' form. Ditto for '=>'. There is some question about whether these rules for matches literals are the best ones, and the issue has been debated during the R7RS standardization process, but nonetheless the standards are clear on this matter. I recommend choosing literals that are not likely to be bound in modules that use your sql macros. I'm closing this. Regards, Mark