From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: ludo@gnu.org (Ludovic =?iso-8859-1?Q?Court=E8s?=) Newsgroups: gmane.lisp.guile.devel Subject: Re: pending branch: lexical-literals Date: Fri, 06 May 2011 14:17:22 +0200 Message-ID: <871v0cja5p.fsf@gnu.org> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: dough.gmane.org 1304684269 23926 80.91.229.12 (6 May 2011 12:17:49 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 6 May 2011 12:17:49 +0000 (UTC) To: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Fri May 06 14:17:45 2011 Return-path: Envelope-to: guile-devel@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 1QIJya-0007d3-Op for guile-devel@m.gmane.org; Fri, 06 May 2011 14:17:44 +0200 Original-Received: from localhost ([::1]:49102 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QIJya-0005WL-9D for guile-devel@m.gmane.org; Fri, 06 May 2011 08:17:44 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:58535) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QIJyX-0005W2-Jx for guile-devel@gnu.org; Fri, 06 May 2011 08:17:42 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QIJyW-0007Ab-DR for guile-devel@gnu.org; Fri, 06 May 2011 08:17:41 -0400 Original-Received: from lo.gmane.org ([80.91.229.12]:34128) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QIJyW-0007AX-3r for guile-devel@gnu.org; Fri, 06 May 2011 08:17:40 -0400 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1QIJyU-0007a1-Hu for guile-devel@gnu.org; Fri, 06 May 2011 14:17:38 +0200 Original-Received: from 193.50.110.208 ([193.50.110.208]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 06 May 2011 14:17:38 +0200 Original-Received: from ludo by 193.50.110.208 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 06 May 2011 14:17:38 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 68 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: 193.50.110.208 X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 17 =?iso-8859-1?Q?Flor=E9al?= an 219 de la =?iso-8859-1?Q?R=E9volution?= X-PGP-Key-ID: 0xEA52ECF4 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 83C4 F8E5 10A3 3B4C 5BEA D15D 77DD 95E2 EA52 ECF4 X-OS: x86_64-unknown-linux-gnu User-Agent: Gnus/5.110017 (No Gnus v0.17) Emacs/24.0.50 (gnu/linux) Cancel-Lock: sha1:/Ftyinx3RN+gc/TaO388oWLY2Oo= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 80.91.229.12 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:12442 Archived-At: Hi Andy, Sorry for the late reply. Andy Wingo writes: > I have a branch that fixes literal matching to actually compare toplevel > bindings, as the RNRS suggest, rather than simply assuming that a > literal that is not lexically bound can be compared symbolically. > > (Recall that literals are things like `else' and `=>' in `cond'.) I think I don’t fully understand the implications yet, partly because it goes against my idea of what a “literal” is: to me, a literal in ‘syntax-rules’ and ‘syntax-case’ is a symbol, not a binding. I read the R7RS thread and André Van Tonder does seem to have compelling arguments, but again, that’s still a bit too disruptive to me. :-) > I send this note because this change increases the coupling between a > macro's definition and the definition of the literals that it > references. > > For example, in the past: > > scheme@(guile-user)> (cond (else #t)) > $1 = #t > > Here the `else' is unbound both in the definition of `cond' and at the > use-site, so the literal should match in any case. > > scheme@(guile-user)> (define else #f) > scheme@(guile-user)> (cond (else #t)) > $2 = #t > > Here the `else' is bound at the site of use, but the comparison still > succeeded, because `else' was matched by name (symbolically), not by > binding (lexically). > > But now, with this change: > > scheme@(guile-user)> (cond (else #t)) > $1 = #t > scheme@(guile-user)> (define else #f) > scheme@(guile-user)> (cond (else #t)) > scheme@(guile-user)> > > `else' did not match, because it was a different binding. > > This case has not changed, however: > > scheme@(guile-user)> (let ((else #f)) (cond (else #t))) > scheme@(guile-user)> > > So whereas before, including something in a literals list did not > specify anything about the toplevel binding, now it does; which > increases the coupling between your macro and your literals. OK. So, with this change, no top-level binding of ‘else’ is /required/, but /when/ there is one, it prevails over the literal, correct? But then I don’t understand how the story that you could import/rename ‘else’ fits into this. Thanks, Ludo’.