Re: SRFI 207: String-notated bytevectors
Marc Nieper-Wißkirchen 20 Aug 2020 06:33 UTC
Am Do., 20. Aug. 2020 um 08:09 Uhr schrieb Shiro Kawai <xxxxxx@gmail.com>:
>
> Hmm, so John is for \y proposal? I'm not sure I'm following the discussion.
>
> If we adopt \y proposal, simply adding #u8 prefix (or vice versa) surely causes the parse error, so that prevents careless mistakes and is a good thing.
>
> I still prefer #u8(...) and not allowing \xHH; in the double quotes inside it, so that the two (string literals and bytevector literals) look more different, less chance of mistakes.
The advantage of #u8(...) is that it allows Schemes to reuse their
string lexer even in the case when they don't allow ASCII NUL in
strings.
The disadvantage of #u8(...), which I see now, is that it will be a
singular notation as for later addition of UTF-8 encoded
bytevectors/bytestrings, we will surely want the utf8"..." notation.
This can be remedied by allowing both:
#u8"..." where "..." is just a string of ASCII-encodable characters
and the more general literal #u8(...).