guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: %default-port-conversion-strategy and string ports


From: David Kastrup
Subject: Re: %default-port-conversion-strategy and string ports
Date: Fri, 01 Jun 2012 17:57:06 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (gnu/linux)

address@hidden (Ludovic Courtès) writes:

> Hi!
>
> Mark H Weaver <address@hidden> skribis:
>
>> 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
>
> Hey, there’s a patch for SRFI-6 there.  Could we resume the discussion
> in that bug?
>
> Guile ports are mixed textual/binary ports.  Whether this or separate
> binary/textual ports as in R6 is best is an interesting question, but as
> you note, we cannot really change that currently.

I don't understand this distinction.  A port transfers characters, like
strings contain characters.  The relation is 1:1.  The question of
encoding only concerns ports connected to a file, or a terminal, and
then textual/binary is a question of encoding/decoding.  A port that
stays within Guile has no business being concerned with encoding.  It
has to reproduce the characters from its input to its output without
change.

Things are complicated enough talking to the outside.  There is no point
in Guile being confused even when talking to itself.

-- 
David Kastrup




reply via email to

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