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 21:36:40 +0100 Message-ID: <87ppnz7ew7.fsf@gnu.org> References: <87bo0del31.fsf@netris.org> <871u0i8zvx.fsf@gnu.org> <8761puxmim.fsf@netris.org> <87ppo2w5zb.fsf@gnu.org> <87fvowwy8r.fsf@netris.org> <87bnzkour2.fsf@gnu.org> <877ga7wyqo.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 1389386514 19213 80.91.229.3 (10 Jan 2014 20:41:54 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 10 Jan 2014 20:41:54 +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 21:42:02 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 1W1iu0-0000sb-Ir for guile-devel@m.gmane.org; Fri, 10 Jan 2014 21:42:00 +0100 Original-Received: from localhost ([::1]:58985 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W1iu0-0004bK-6t for guile-devel@m.gmane.org; Fri, 10 Jan 2014 15:42:00 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38454) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W1itr-0004YB-7E for guile-devel@gnu.org; Fri, 10 Jan 2014 15:41:56 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W1itl-0008CY-Kt for guile-devel@gnu.org; Fri, 10 Jan 2014 15:41:51 -0500 Original-Received: from hera.aquilenet.fr ([141.255.128.1]:45504) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W1itl-0008CP-Es for guile-devel@gnu.org; Fri, 10 Jan 2014 15:41:45 -0500 Original-Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id C629319D0; Fri, 10 Jan 2014 21:36:41 +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 YnLWMlSQ8bgy; Fri, 10 Jan 2014 21:36:41 +0100 (CET) Original-Received: from pluto (reverse-83.fdn.fr [80.67.176.83]) by hera.aquilenet.fr (Postfix) with ESMTPSA id 63454570; Fri, 10 Jan 2014 21:36:41 +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: <877ga7wyqo.fsf@netris.org> (Mark H. Weaver's message of "Fri, 10 Jan 2014 12:08:47 -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:16798 Archived-At: Mark H Weaver skribis: > ludo@gnu.org (Ludovic Court=C3=A8s) writes: > >> Mark H Weaver skribis: >> >>> ludo@gnu.org (Ludovic Court=C3=A8s) writes: [...] >> 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? [...] > Since you chose the same ellipsis identifier for both the inner and > outer macros, you need to escape the ellipsis passed to the inner > 'with-ellipsis', just as you need to escape any ellipsis that you want > to remain present in the generated code. Arf, right, my bad. That makes a lot of sense. [...] >>> 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-ell= ipsis=E2=80=99 >> can now be omitted, or is it limited to =E2=80=98let...-syntax=E2=80=99? > > No, it's not limited to 'let...-syntax'. The effect of 'with-ellipsis' > propagates into 'define-syntax' forms well. OK. > However, you still need the second 'with-ellipsis' in your example, > because the effect of 'with-ellipsis' does not affect the ellipsis of > the generated code. If you want one macro to generate another macro > definition that uses a custom ellipsis, you must include 'with-ellipsis' > in the generated code. Yes, understood. Thanks for explaining! Ludo=E2=80=99.