[Top][All Lists]

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

Re: Adding to guile curly-infix (SRFI 105), neoteric- & sweet-expression

From: Alan Manuel Gloria
Subject: Re: Adding to guile curly-infix (SRFI 105), neoteric- & sweet-expressions
Date: Tue, 28 Aug 2012 14:56:22 +0800

On Tue, Aug 28, 2012 at 10:57 AM, Noah Lavine <address@hidden> wrote:
> Hello,
> On Mon, Aug 27, 2012 at 12:30 AM, Alan Manuel Gloria <address@hidden> wrote:
>> However, it leads to an edge case in Guile 2.0 where disabling
>> autocompilation leads to the module-loading C code path going through
>> a direct C call to the C implementation of primitive-load, a path that
>> only triggers if autocompilation disabled (when autocompilation is
>> enabled, it goes through a hook in the language support for Scheme,
>> which uses the 'read function we've rebound).
> Hmm, interesting. That sounds like a bug, but I'd like one of the
> Guile maintainers to clarify that this isn't intended before I look at
> it more. Is this triggered when you're trying to load a module full of
> infix expressions?

Yes, with autocompilation off.

> If so, how do you tell Guile that the module is
> supposed to use infix expressions instead of s-expressions?

By re-binding (via set!) 'read and 'primitive-load.  On Guile 1.6 and 1.8,
IIRC the C code uses the binding for 'primitive-load to handle loading
module loading.  On Guile 2.0, the compilation hook for the Scheme
language uses the 'read Scheme binding (IIRC).  Replacing the 'read
and 'primitive-load bindings works for 1.6 and 1.8, and 2.0 with
autocompilation enabled.

With autocompilation off, Guile ends up calling the primitive-load
C implementation directly as a C call, instead of the old behavior
of calling 'primitive-load in the Scheme side.

Our strategy, basically, was to completely replace the reader, as
that had seemed to work in 1.6 and 1.8 at the REPL.  I modified
it later to replace 'primitive-load too, so that 'primitive-load uses
the Scheme binding for 'read, which made it work in 1.6 and 1.8
during module loading.


reply via email to

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