unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Mark H Weaver <mhw@netris.org>
To: mikael@djurfeldt.com
Cc: guile-devel <guile-devel@gnu.org>
Subject: Re: Precedence for reader extensions
Date: Thu, 21 Feb 2013 21:52:47 -0500	[thread overview]
Message-ID: <87k3q183gg.fsf@tines.lan> (raw)
In-Reply-To: <CAA2XvwKm6c_nXbJEYRq0J7=nDFkE=FJGoQ67aqX5OJo44GN9VA@mail.gmail.com> (Mikael Djurfeldt's message of "Tue, 19 Feb 2013 17:58:14 +0100")

Mikael Djurfeldt <mikael@djurfeldt.com> 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 <mikael@djurfeldt.com> 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ès <ludo@gnu.org> 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ès <ludo@gnu.org> 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.

     Regards,
       Mark



  parent reply	other threads:[~2013-02-22  2:52 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-18 21:05 Precedence for reader extensions Mikael Djurfeldt
2013-02-18 21:07 ` Mikael Djurfeldt
2013-02-18 21:26 ` Mikael Djurfeldt
2013-02-18 21:42   ` Mikael Djurfeldt
2013-02-18 23:33 ` Mark H Weaver
2013-02-19 10:14   ` Mikael Djurfeldt
2013-02-19 15:41     ` Mark H Weaver
2013-02-19 16:42       ` Mikael Djurfeldt
2013-02-19 16:58         ` Mikael Djurfeldt
2013-02-20 14:21           ` Ludovic Courtès
2013-02-22  2:52           ` Mark H Weaver [this message]
2013-02-22  9:36             ` Mikael Djurfeldt
2013-02-22 15:45               ` Ludovic Courtès
2013-02-22 15:54             ` Ludovic Courtès
2013-02-19 23:51         ` Mikael Djurfeldt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87k3q183gg.fsf@tines.lan \
    --to=mhw@netris.org \
    --cc=guile-devel@gnu.org \
    --cc=mikael@djurfeldt.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).