Re: New draft (#4) of SRFI 207: String-notated bytevectors
Wolfgang Corcoran-Mathe 05 Oct 2020 19:17 UTC
On 2020-10-05 20:05 +0200, Daphne Preston-Kendal wrote:
> On 5 Oct 2020, at 19:29, Wolfgang Corcoran-Mathe <xxxxxx@sigwinch.xyz> wrote:
>
> > * Having two different intepretations for strings is a kluge, so
> > `bytestring' should adopt the same interpretation of string
> > arguments that string->bytevector uses. (This might obviate the
> > need for string->bytevector in the first place.)
>
> I don't see your point here. string->bytevector parses the string it is
> given as input; bytestring does not (except in the most rudimentary
> possible sense of the word 'parse').
OK, I think I understand, now. It doesn't make sense for `bytestring'
to parse an external representation. I don't know what I why I was
thinking of both bytestring and string->bytestring as parsing functions.
But I'm wondering now if perhaps string->bytestring is a confusing
idea, at least in name. string->bytestring and bytestring->string are
basically read/write with string-port I/O, respectively. With a
reader/writer which recognizes the SNB external representation, we get
this for free. So perhaps the handling of the SNB representation
could be advantageously left to the reader/writer, entirely?
This would accord with the way Scheme handles other external
representations. There is, for example, no "string->string" procedure
for parsing the external representation of strings.
--
Wolfgang Corcoran-Mathe <xxxxxx@sigwinch.xyz>
"Searching for fulfillment in this compact subset of existence...
My life must have a convergent subsequence somewhere... out there..."
--Abstruse Goose