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: Mon, 08 Jun 2015 14:35:36 +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-07 17:21:11+0200]
>> Dmitry Bogatov <address@hidden> skribis:
>> 
>> >> OK.  If it’s optional, that’s probably more reasonable.
>> >
>> > It is all great, but is it reasonable for you to specify order of TR
>> > application?
>> 
>> The thing is, it’s not a problem or ordering.  It’s just that only one
>> TR is supposed to claim a given character.
>> 
>> Looking at the code, it’s not actually clear which one wins anyway,
>> because there are two cases: the ‘eightbit_char_to_tr_map’ mapping, and
>> the other case (see ‘scm_call_reader’.)  I think we cannot really
>> document an ordering without exposing too many implementation details
>> and without limiting future changes.
>
> Okay, what about providing means to create symbol readers?
> I mean provide procedure (make-symbol-token-reader
> first-char-predicate). This way it would be possible to 
> replace default one with TR, that does not accept $symbols.

What about something like this:

--8<---------------cut here---------------start------------->8---
scheme@(guile-user)> (standard-token-reader 'r6rs-symbol-misc-chars)
$6 = #<token-reader 2d75f80>
scheme@(guile-user)> (token-reader-specification $6)
$7 = (#\{ #\} #\~ #\^ #\: #\/ #\* #\% #\& #\@ #\_ #\< #\> #\! #\= #\? #\$)
scheme@(guile-user)> (make-token-reader (delq #\$ (token-reader-specification 
$6))
                                        (token-reader-procedure $6))
$8 = #<token-reader 2d75f40>
--8<---------------cut here---------------end--------------->8---

HTH,
Ludo’.



reply via email to

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