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: Precedence for reader extensions Date: Fri, 22 Feb 2013 16:54:47 +0100 Message-ID: <87bobcibso.fsf@gnu.org> References: <87mwv1nqns.fsf@tines.lan> <87a9r0gvld.fsf@tines.lan> <87k3q183gg.fsf@tines.lan> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1361548519 17657 80.91.229.3 (22 Feb 2013 15:55:19 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 22 Feb 2013 15:55:19 +0000 (UTC) To: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Fri Feb 22 16:55:40 2013 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 1U8uyH-0006o2-LB for guile-devel@m.gmane.org; Fri, 22 Feb 2013 16:55:37 +0100 Original-Received: from localhost ([::1]:43149 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U8uxx-00058y-6n for guile-devel@m.gmane.org; Fri, 22 Feb 2013 10:55:17 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:42678) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U8uxn-00055Z-31 for guile-devel@gnu.org; Fri, 22 Feb 2013 10:55:15 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U8uxg-00006M-RJ for guile-devel@gnu.org; Fri, 22 Feb 2013 10:55:07 -0500 Original-Received: from plane.gmane.org ([80.91.229.3]:43569) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U8uxg-000062-Js for guile-devel@gnu.org; Fri, 22 Feb 2013 10:55:00 -0500 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1U8uxx-0006QB-58 for guile-devel@gnu.org; Fri, 22 Feb 2013 16:55:17 +0100 Original-Received: from 193.50.110.200 ([193.50.110.200]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 22 Feb 2013 16:55:17 +0100 Original-Received: from ludo by 193.50.110.200 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 22 Feb 2013 16:55:17 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 39 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 193.50.110.200 X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 4 =?utf-8?Q?Vent=C3=B4se?= an 221 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 User-Agent: Gnus/5.130005 (Ma Gnus v0.5) Emacs/24.2 (gnu/linux) Cancel-Lock: sha1:v8KwquwlHkVNkODaLnIHmtGMCEg= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 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:15800 Archived-At: Mark H Weaver skribis: > Ludovic Courtès writes: >> This is basically DSSSL keyword syntax. What about adding a new keyword >> style to read.c? Sounds like the easiest solution for this particular >> problem. > > This is a tempting solution, but I see a problem with this proposal: > We'd have to make exceptions for things like #!fold-case and > #!curly-infix, as well as for things like #!/usr/bin/guile. Also, it > could potentially turn existing scsh-style block comments into syntax > errors. The DSSSL option could be documented as incompatible with those other reader options, and perhaps an error could be raised when an attempt to use incompatible options is made. WDYT? Admittedly, this would increase reader complexity. > Ludovic Courtès writes: >> In general, I think it should be easy to create new readers that derive >> from the standard syntax without having to write them from scratch. >> >> However, in hindsight, I’m not sure Guile-Reader’s API is the right >> approach. It’s an improvement, because it addresses this need; but its >> API is not ideal: “token readers” with different delimiter syntax don’t >> compose well, for instance. > > I'd be very interested to hear your current thoughts on what a better > API should look like. Probably parser combinators, like . In Guile we have the extra restriction that we need to keep ‘read’ in C for bootstrapping, so that would probably mean having two reader implementations. Ludo’.