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: Needed: per-port reader options
Date: Tue, 16 Oct 2012 17:52:08 +0200	[thread overview]
Message-ID: <87ehkyza6v.fsf@gnu.org> (raw)
In-Reply-To: 87sj9ixl1j.fsf@tines.lan

Hi,

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

> I recently tried to implement reader directives, e.g.:
>
>   #!fold-case     (from R7RS)
>   #!no-fold-case  (from R7RS)
>   #!curly-infix   (from SRFI-105)
>
> However, I ran into a rather serious problem.  Guile's reader options
> are global to the entire process, but clearly these reader directives
> should affect only the port they are read from.  So we need to support
> per-port reader options.

I think we should instead be able to instantiate new readers–i.e., have
a higher-order ‘make-reader’ procedure (that’s how Guile-Reader started,
actually.)

That, combined with the ‘current-reader’ fluid, should provide good
flexibility.

As an example,
http://git.savannah.gnu.org/cgit/guile-reader.git/tree/modules/system/reader/confinement.scm
provides reader settings that are confined for each module.

Also, I think ports should remain reader-oblivious.  ‘read’ is
fundamentally at a higher level of abstraction, so I’d personally prefer
not to have ports fiddle with it.

WDYT?

Thanks,
Ludo’.




  reply	other threads:[~2012-10-16 15:52 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-13 18:51 Needed: per-port reader options Mark H Weaver
2012-10-16 15:52 ` Ludovic Courtès [this message]
2012-10-16 20:22   ` Mark H Weaver
2012-10-16 21:39     ` Ludovic Courtès
2012-10-16 21:57       ` Noah Lavine
2012-10-16 22:01         ` Ludovic Courtès
2012-10-17  3:34       ` Mark H Weaver
2012-10-18 16:20         ` Ludovic Courtès
2012-10-18 17:48           ` Mark H Weaver
2012-10-19  2:12             ` Mark H Weaver
2012-10-21 21:40               ` Ludovic Courtès

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=87ehkyza6v.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).