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: More PEG Date: Fri, 09 Sep 2011 22:51:04 +0200 Message-ID: <87aaadl9s7.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 1315601489 24918 80.91.229.12 (9 Sep 2011 20:51:29 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 9 Sep 2011 20:51:29 +0000 (UTC) To: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Fri Sep 09 22:51:23 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 1R282l-0007XA-Ll for guile-devel@m.gmane.org; Fri, 09 Sep 2011 22:51:23 +0200 Original-Received: from localhost ([::1]:50933 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R282l-0004Ll-9S for guile-devel@m.gmane.org; Fri, 09 Sep 2011 16:51:23 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:56609) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R282i-0004Lb-LJ for guile-devel@gnu.org; Fri, 09 Sep 2011 16:51:21 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R282h-0006bV-J1 for guile-devel@gnu.org; Fri, 09 Sep 2011 16:51:20 -0400 Original-Received: from lo.gmane.org ([80.91.229.12]:35380) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R282h-0006bM-3h for guile-devel@gnu.org; Fri, 09 Sep 2011 16:51:19 -0400 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1R282f-0007V2-U8 for guile-devel@gnu.org; Fri, 09 Sep 2011 22:51:17 +0200 Original-Received: from reverse-83.fdn.fr ([80.67.176.83]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 09 Sep 2011 22:51:17 +0200 Original-Received: from ludo by reverse-83.fdn.fr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 09 Sep 2011 22:51:17 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 31 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: reverse-83.fdn.fr X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 23 Fructidor an 219 de la =?iso-8859-1?Q?R=E9volutio?= =?iso-8859-1?Q?n?= 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.110018 (No Gnus v0.18) Emacs/24.0.50 (gnu/linux) Cancel-Lock: sha1:4v5goyjgmFuNP23SCmPLltd+bLU= 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:12753 Archived-At: Hi Noah, Noah Lavine skribis: > It looks to me like the last thing needed before the peg branch can be > used is to change some of the S-expression representations of the > components. Here are the five that I think need changing, taken from > the manual, with suggested replacements. This looks like interesting stuff! The syntactic changes you propose all make sense to me, FWIW. [...] > There's something I'm still a little unsure about, though. It's > possible to get deeply nested S-expressions, like '(+ (and (* "a") > "b")). Since +, * and ? only ever take one argument, it is possible to > shorten such a list by letting people merge those elements into the > next item, like this: '(+ and (* "a") "b"). I would rather keep it simple and avoid shortcuts that may end up being confusing. A more general question about PEG: how do you bind a variable to the result of a pattern? For instance, if you want the result of (* "a") to be bound to variable X–just like (match '(1 2 3) ((a _ ...) a)) binds A to 1. Thanks, Ludo’.