guile-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] Per-module reader, take #3


From: Ludovic Courtès
Subject: Re: [PATCH] Per-module reader, take #3
Date: Mon, 21 Nov 2005 13:55:30 +0100
User-agent: Gnus/5.110004 (No Gnus v0.4) Emacs/21.4 (gnu/linux)

Hi Marius,

Marius Vollmer <address@hidden> writes:

> Hmm.  Your approach make 'load' configurable so that it can use
> different 'read' procedures.  Wouldn't it be more natural to make
> 'read' configurable to parse different syntaxes?

[...]

> However, making the read procedure used by 'load' configurable can't
> hurt, I think.

Indeed.  In fact, this change is two-fold:

1.  Have `primitive-load' refer to the `*current-reader*'[*] fluid
    instead of hard-wiring calls to `scm_read ()'.  This way, a Scheme
    file being loaded can change its reader on-the-fly by doing:

      (fluid-set! *current-reader* ...)

    This allows a module to use a different syntax variant, for
    instance.

2.  There are several functions that build upon `primitive-load'.  Neil
    identified them and proposed a way to cleanly integrate them with
    our modified `primitive-load' while still keeping the
    "primitiveness" or `primitive-load':

      http://lists.gnu.org/archive/html/guile-devel/2005-10/msg00116.html

    Since those `load' procedures are written in Scheme, we can
    harmlessly have them take an optional `read' argument.


Hope this helps,
Ludovic.

[*] It occurred to me that Neil named the fluid `current-reader' but I
    think it should really be `*current-reader*' in order to stick to
    the conventions.




reply via email to

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