bytestring isn't a datatype, right? Shiro Kawai (07 Oct 2020 10:01 UTC)
Re: bytestring isn't a datatype, right? John Cowan (07 Oct 2020 15:15 UTC)
Re: bytestring isn't a datatype, right? Marc Nieper-Wißkirchen (07 Oct 2020 16:15 UTC)
Re: bytestring isn't a datatype, right? Wolfgang Corcoran-Mathe (07 Oct 2020 16:47 UTC)
Re: bytestring isn't a datatype, right? Wolfgang Corcoran-Mathe (07 Oct 2020 18:21 UTC)
Re: bytestring isn't a datatype, right? Shiro Kawai (07 Oct 2020 21:06 UTC)
Re: bytestring isn't a datatype, right? Lassi Kortela (08 Oct 2020 13:07 UTC)
Re: bytestring isn't a datatype, right? Shiro Kawai (08 Oct 2020 13:13 UTC)
Re: bytestring isn't a datatype, right? Marc Nieper-Wißkirchen (08 Oct 2020 13:24 UTC)
Re: bytestring isn't a datatype, right? John Cowan (10 Oct 2020 07:42 UTC)
Re: bytestring isn't a datatype, right? Shiro Kawai (10 Oct 2020 09:38 UTC)
Re: bytestring isn't a datatype, right? Wolfgang Corcoran-Mathe (10 Oct 2020 15:04 UTC)
Re: bytestring isn't a datatype, right? John Cowan (10 Oct 2020 20:40 UTC)
Re: bytestring isn't a datatype, right? Wolfgang Corcoran-Mathe (10 Oct 2020 23:08 UTC)
Re: bytestring isn't a datatype, right? John Cowan (11 Oct 2020 03:20 UTC)
Re: bytestring isn't a datatype, right? Marc Nieper-Wißkirchen (11 Oct 2020 08:26 UTC)
Re: bytestring isn't a datatype, right? Daphne Preston-Kendal (11 Oct 2020 08:39 UTC)
Re: bytestring isn't a datatype, right? John Cowan (11 Oct 2020 08:42 UTC)
Re: bytestring isn't a datatype, right? Marc Nieper-Wißkirchen (11 Oct 2020 09:10 UTC)
Optional features in SRFIs again, this time with syntax Lassi Kortela (11 Oct 2020 11:38 UTC)
Re: bytestring isn't a datatype, right? Wolfgang Corcoran-Mathe (11 Oct 2020 18:22 UTC)
Re: bytestring isn't a datatype, right? Marc Nieper-Wißkirchen (11 Oct 2020 18:31 UTC)
Re: bytestring isn't a datatype, right? Marc Nieper-Wißkirchen (11 Oct 2020 17:20 UTC)
Re: bytestring isn't a datatype, right? John Cowan (14 Oct 2020 15:20 UTC)
Comparing two vectors Lassi Kortela (08 Oct 2020 13:13 UTC)
Re: Comparing two vectors John Cowan (08 Oct 2020 15:01 UTC)
Re: Comparing two vectors Lassi Kortela (08 Oct 2020 20:42 UTC)

Re: bytestring isn't a datatype, right? Marc Nieper-Wißkirchen 11 Oct 2020 17:19 UTC

Am Sa., 10. Okt. 2020 um 09:42 Uhr schrieb John Cowan <xxxxxx@ccil.org>:
>
>
>
> On Wed, Oct 7, 2020 at 12:15 PM Marc Nieper-Wißkirchen <xxxxxx@nieper-wisskirchen.de> wrote:
>
>> I have to agree with Shiro that the "bytestring" prefix is a bit
>> confusing. For example, "bytevector-pad" makes as much sense as
>> "bytestring-pad".
>
>
> Strings may need to be padded or truncated.  Bytevectors generally do not.
>
>>
>> Actually (but this is a general critique about one direction of this
>> SRFI), I don't like that ASCII characters are given special treatment.
>> For legacy code, yes, but not for code that does not yet exist (i.e.
>> code that uses SRFI 207).
>
>
> That's something I should explain better in the SRFI, and I will.  The reason for giving the ASCII characters special treatment is their universality, not for representing text (at which they fail), but for representing binary values that have mnemonic properties.  As a very simple case, the first two bytes of a .zip file are 50 4B, or u8#"PK", the initials of the format's creator, Phil Katz.
>
> Four-character codes or 4CCs <https://en.wikipedia.org/wiki/FourCC> are likewise used to label binary data: they were used on the early Mac OS to label files with their types, and are now used to label the chunks out of which a PNG graphics file, an AIFF audio file, and various other binary formats are constructed.  For example, PNG uses #u8"PLTE" (palette), #u8"bKGD" (background color), and #u8"iTXt" (text) chunks among many others.  So as you can see, SRFI-207 can be used to construct binary information in formats that are already in use.
>
>> I would like to draw a much clearer line between bytes
>> and characters.
>
>
> That line is drawn: it is the line between strings and bytevectors.  It's when it's useful to blur the line that SRFI 207 comes into play.

For all these use cases, it seems farther-reaching to me to have a
separate "bytestring" data type that also knows about its encoding so
that, in particular, the user is aware of it. SRFI 207 would then be
about ASCII bytestrings.

Moreover, with such a type, we do not have to blur any line while all
the applications above are easy to accomplish.

(With the current design, u8"PLTE" is one thing, because it is, in
fact, binary data. But ci-lexicographic comparison treats raw ASCII as
text, although it should be binary.)