From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Mikael Djurfeldt Newsgroups: gmane.lisp.guile.devel Subject: Re: Precedence for reader extensions Date: Fri, 22 Feb 2013 10:36:27 +0100 Message-ID: References: <87mwv1nqns.fsf@tines.lan> <87a9r0gvld.fsf@tines.lan> <87k3q183gg.fsf@tines.lan> Reply-To: mikael@djurfeldt.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1361525809 21894 80.91.229.3 (22 Feb 2013 09:36:49 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 22 Feb 2013 09:36:49 +0000 (UTC) Cc: guile-devel To: Mark H Weaver Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Fri Feb 22 10:37:12 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 1U8p42-0001oG-E2 for guile-devel@m.gmane.org; Fri, 22 Feb 2013 10:37:10 +0100 Original-Received: from localhost ([::1]:54907 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U8p3i-0005Pb-2M for guile-devel@m.gmane.org; Fri, 22 Feb 2013 04:36:50 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:38909) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U8p3X-0005P5-Bu for guile-devel@gnu.org; Fri, 22 Feb 2013 04:36:48 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U8p3N-0002D7-OK for guile-devel@gnu.org; Fri, 22 Feb 2013 04:36:39 -0500 Original-Received: from mail-ea0-f171.google.com ([209.85.215.171]:58827) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U8p3N-0002CV-FB for guile-devel@gnu.org; Fri, 22 Feb 2013 04:36:29 -0500 Original-Received: by mail-ea0-f171.google.com with SMTP id c13so184423eaa.2 for ; Fri, 22 Feb 2013 01:36:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:reply-to:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=tLamZDwu6dB7xqRmXciN5lsF9IoYWDq5Wosj2VjjDkY=; b=MfzrSQiPtxUt+dvHmLLL1/590L9c5wN75QOyrT7rWOxQRyGHy7fmwiHLpw8NGi87MK ne1MFUjcRJiI5RCxWINjFt2I+3jq7QTet/1qhWTyqx7rQ8oOGbyJrmnKIwnxV4fVRz/I YDkVB4JLUUuJj3Jmxp2qmc148GbWQf8TWs1b4A3G75Ggo9BNGyXwLt2XVQvuDwKmvYi7 l6CqX8RjT9bceeMCkefKXEZ59PILkQi1EjG8P934R/fJFnvSOpcy97OItE+ZbPicMifg o6JK7Crnyrr1/cnLaR+h8NUD7Rz2TUO7eHsJaajOBBHtgE/KNJ++rQTaK51MOLQIoXyT z+Uw== X-Received: by 10.14.3.133 with SMTP id 5mr4379866eeh.43.1361525787934; Fri, 22 Feb 2013 01:36:27 -0800 (PST) Original-Received: by 10.14.225.2 with HTTP; Fri, 22 Feb 2013 01:36:27 -0800 (PST) In-Reply-To: <87k3q183gg.fsf@tines.lan> X-Google-Sender-Auth: jEExiyAt3_h38SSmrz6QMjRF9Ss X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 209.85.215.171 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:15798 Archived-At: Thanks, Mark. This all sounds very sensible to me, and I will continue working on the scmutils port while waiting for your patch. On Fri, Feb 22, 2013 at 3:52 AM, Mark H Weaver wrote: > Mikael Djurfeldt writes: >> The API you suggest would compose much easier, but to me it feels like >> just another specialized solution. What we would really need is >> something like Ludovic's guile-reader. > > I agree that we should ideally have a much more general way of defining > customized readers. In the meantime, my primary concern is to find a > solution to your problem without committing us to supporting an overly > general mechanism that fails to provide basic guarantees to other users > of 'read'. > > As you pointed out, the current code *almost* supports overriding > standard syntax for things like "#!". However, it has been broken for > a long time. The same bug is in Guile 1.8, and I haven't seen anyone > complaining about it. Therefore, I'm more inclined to remove this > broken functionality than to fix it. > > Mikael Djurfeldt writes: >> But I won't be stubborn regarding this. If someone else wants to >> implement another way of supporting #!optional and #!rest that is fine >> by me. > > Thanks. I hope to cook up a patch in the next few days. > > Ludovic Court=E8s 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. > > Ludovic Court=E8s 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=92m not sure Guile-Reader=92s API is the right >> approach. It=92s an improvement, because it addresses this need; but it= s >> API is not ideal: =93token readers=94 with different delimiter syntax do= n=92t >> compose well, for instance. > > I'd be very interested to hear your current thoughts on what a better > API should look like. > > Regards, > Mark