guile-reader-devel
[Top][All Lists]
Advanced

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

Re: [guile-reader-devel] Guile-Bash reader extensions


From: Ludovic Courtès
Subject: Re: [guile-reader-devel] Guile-Bash reader extensions
Date: Sat, 06 Jun 2015 15:58:01 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

Dmitry Bogatov <address@hidden> skribis:

> * Ludovic Courtès <address@hidden> [2015-06-05 14:18:37+0200]
>> Dmitry Bogatov <address@hidden> skribis:
>> 
>> > My use-case is Guile interface to Bash, and I would like to get `$foo'
>> > be read as (variable-ref 'foo) but just `foo' as symbol.
>> 
>> Sorry to spoil the party ;-), but I think you should avoid that.
>> 
>> The problem with reader extensions is that they do not compose well.  If
>> a program uses guile-bash, or if a module is loaded from guile-bash,
>> then suddenly it gets the reader extension, and that extension could
>> break it, for instance because it uses $ identifiers (this is not
>> uncommon; one example is (system base lalr).)
>
> I am not sure the problem you are describing is actually possible.
> Somewhere I heard `load dynamic extend` expression. I mean, any
> assignment to fluid in loaded file will be lost in master one.
> Not tested.

Well, if the reader is changed in an (eval-when (compile) ...) form, and
if the file is always pre-compiled, then indeed, there’s no problem.

However, in practice you may want the reader change to take effect even
when the file is interpreted or loaded.  In practice, that means that
the syntax change is pervasive in the whole process.

> So, my intention is export `$-token-reader' for advanced composition and
> `(enable-$-reader-extension)' for common folk.

OK.  If it’s optional, that’s probably more reasonable.

Ludo’.



reply via email to

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