From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Newsgroups: gmane.lisp.guile.devel Subject: Re: [PATCH] psyntax: custom ellipses using 'with-ellipsis' or R7RS syntax-rules Date: Fri, 10 Jan 2014 14:02:09 +0100 Message-ID: <87bnzkour2.fsf@gnu.org> References: <87bo0del31.fsf@netris.org> <871u0i8zvx.fsf@gnu.org> <8761puxmim.fsf@netris.org> <87ppo2w5zb.fsf@gnu.org> <87fvowwy8r.fsf@netris.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1389359246 10089 80.91.229.3 (10 Jan 2014 13:07:26 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 10 Jan 2014 13:07:26 +0000 (UTC) Cc: guile-devel@gnu.org To: Mark H Weaver Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Fri Jan 10 14:07:29 2014 Return-path: Envelope-to: guile-devel@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 1W1bo8-00074M-4D for guile-devel@m.gmane.org; Fri, 10 Jan 2014 14:07:28 +0100 Original-Received: from localhost ([::1]:56840 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W1bo7-0004N4-GT for guile-devel@m.gmane.org; Fri, 10 Jan 2014 08:07:27 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56797) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W1bny-0004Mt-1U for guile-devel@gnu.org; Fri, 10 Jan 2014 08:07:23 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W1bns-0007ix-Ni for guile-devel@gnu.org; Fri, 10 Jan 2014 08:07:17 -0500 Original-Received: from hera.aquilenet.fr ([141.255.128.1]:44676) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W1bns-0007iq-Gq for guile-devel@gnu.org; Fri, 10 Jan 2014 08:07:12 -0500 Original-Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id 20C078CA; Fri, 10 Jan 2014 14:02:10 +0100 (CET) Original-Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id piSOwR3Rb4DN; Fri, 10 Jan 2014 14:02:10 +0100 (CET) Original-Received: from pluto (unknown [193.50.110.94]) by hera.aquilenet.fr (Postfix) with ESMTPSA id E33684A7; Fri, 10 Jan 2014 14:02:09 +0100 (CET) X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 21 =?utf-8?Q?Niv=C3=B4se?= an 222 de la =?utf-8?Q?R?= =?utf-8?Q?=C3=A9volution?= 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 In-Reply-To: <87fvowwy8r.fsf@netris.org> (Mark H. Weaver's message of "Thu, 09 Jan 2014 18:07:16 -0500") User-Agent: Gnus/5.130007 (Ma Gnus v0.7) Emacs/24.3 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x [fuzzy] X-Received-From: 141.255.128.1 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:16796 Archived-At: Mark H Weaver skribis: > ludo@gnu.org (Ludovic Court=C3=A8s) writes: [...] >> Actually my question was more about the ellipsis escaping form >> (... ...). It is affected by =E2=80=98with-ellipsis=E2=80=99, right? > > Yes, so the following works: > > (define-syntax define-inline > (with-ellipsis --- > (syntax-rules () > ((_ (name parms ---) exp ---) > (define-syntax name > (with-ellipsis (--- ---) > (syntax-rules () > ((_ args (--- ---)) > ((lambda (parms ---) exp ---) > args (--- ---)))))))))) Sorry I wasn=E2=80=99t clear. Does this work: (define-syntax define-inline (with-ellipsis --- (syntax-rules () ((_ (name parms ---) exp ---) (define-syntax name (with-ellipsis --- ; <- note here! (syntax-rules () ((_ args (--- ---)) ((lambda (parms ---) exp ---) args (--- ---)))))))))) IOW, does the escaping syntax adjust to the current ellipsis? > Needless to say, the whole point of custom ellipses is to avoid having > to ever escape ellipses, but you can still do it. Yes of course; that=E2=80=99s an academic question to satisfy my curiosity. >>> Note that as currently implemented, the effect of 'with-ellipsis' >>> also does not propagate into nested syntax definition forms such as >>> 'let-syntax', 'letrec-syntax', and 'define-syntax'. We could go either >>> way on this. >> >> Well, I think it=E2=80=99s fine this way, but then again I=E2=80=99ve be= en living in >> world without that feature. ;-) >> >> How does R7RS syntax-rules behave in that respect? I guess we should >> just follow suit. > > In R7RS, custom ellipsis is not part of the lexical environment, and > thus does not propagate at all. A custom ellipsis affects only the > patterns and templates of the 'syntax-rules' macro it is passed to. > > I ended up making the effect of 'with-ellipsis' propagate into syntax > definition forms, since the semantics seem simpler to me. OK. So does that mean that in the example above the second =E2=80=98with-ellips= is=E2=80=99 can now be omitted, or is it limited to =E2=80=98let...-syntax=E2=80=99? > I pushed this and the 'syntax-error' patch to stable-2.0. Great, thank you! Ludo=E2=80=99.