unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: ludo@gnu.org (Ludovic Courtès)
To: guile-devel@gnu.org
Subject: Re: Precedence for reader extensions
Date: Fri, 22 Feb 2013 16:54:47 +0100	[thread overview]
Message-ID: <87bobcibso.fsf@gnu.org> (raw)
In-Reply-To: 87k3q183gg.fsf@tines.lan

Mark H Weaver <mhw@netris.org> skribis:

> 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.

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 <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.

Probably parser combinators, like
<http://planet.racket-lang.org/display.ss?package=combinator-parser.plt&owner=plt>.

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’.




  parent reply	other threads:[~2013-02-22 15:54 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
2013-02-22  9:36             ` Mikael Djurfeldt
2013-02-22 15:45               ` Ludovic Courtès
2013-02-22 15:54             ` Ludovic Courtès [this message]
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=87bobcibso.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=guile-devel@gnu.org \
    /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).