guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Needed: per-port reader options


From: Ludovic Courtès
Subject: Re: Needed: per-port reader options
Date: Tue, 16 Oct 2012 17:52:08 +0200
User-agent: Gnus/5.130005 (Ma Gnus v0.5) Emacs/24.2 (gnu/linux)

Hi,

Mark H Weaver <address@hidden> 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 via email to

[Prev in Thread] Current Thread [Next in Thread]