[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: %default-port-conversion-strategy and string ports
From: |
Mark H Weaver |
Subject: |
Re: %default-port-conversion-strategy and string ports |
Date: |
Thu, 31 May 2012 17:25:24 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.0.92 (gnu/linux) |
address@hidden (Ludovic Courtès) writes:
> David Kastrup <address@hidden> skribis:
>
>> Shouldn't strings be in "internal encoding" anyway? The whole point of
>> a string is to be an array of characters. Not an array of arbitrarily
>> encoded bytes.
>
> Yes, but I was referring to “string ports”, which may actually be fed
> arbitrary binary data, not just characters.
For the record, I agree with David. String ports should be textual
ports, not binary ports. In particular, you should be able to
write/read _any_ character to/from a string port, regardless of what the
current default port encoding happens to be.
SRFI-6 (string ports) says nothing about port encodings, and yet
portable code written for SRFI-6 will fail on Guile 2.0 unless the
string is constrained to whatever the default port encoding happens to
be. This is not just a theoretical issue; it has caused trouble in
practice, e.g.:
http://bugs.gnu.org/11197
Unfortunately, we are now in an awkward situation. The current behavior
of Guile 2.0 is conceptually broken and breaks portable SRFI-6 code, and
yet it is possible that some users have grown to depend on our current
behavior.
Mark