[r6rs-discuss] [Formal] Improve port i/o.

From: Michael Sperber <sperber>
Date: Wed Nov 22 11:53:22 2006

John Cowan <cowan_at_ccil.org> writes:

> Michael Sperber scripsit:
>
>> The design of the (r6rs ports) library in the current draft, despite
>> its numerous flaws, has the nice property that binary and textual I/O
>> can be interleaved arbitrarily on the same port. While some may argue
>> that it is not particularly important, I disagree. It is certainly
>> useful in a number of circumstances,
>
> Can you mention the circumstances in question?

Any number of files contain both text and binary data---most image
file formats, mp3 files, etc. Moreover, one way to view looking at an
XML file would be:

- Start off in binary, identifying whether it's UTF-16, UTF-32 or one
  of the 8-bit encodings.

- Switch to ASCII in the latter case for reading the encoding tag.

- Switch to the correct encoding afterwards.

The proposal, as far as I understand it, doesn't let you do that.

> Au contraire: we would be in a position of providing an interface
> to something (interleaved text and binary) which will malfunction
> in arbitrary ways depending on the current encoding, which may not
> even be known to the program.

I wasn't suggesting that it should fail in arbitrary ways, rather that
the way it fails in might render mixing intrinsically useless. I
expect that to be the case in increasingly unimportant corner cases
only.

-- 
Cheers =8-} Mike
Friede, V?lkerverst?ndigung und ?berhaupt blabla
Received on Wed Nov 22 2006 - 11:53:11 UTC

This archive was generated by hypermail 2.3.0 : Wed Oct 23 2024 - 09:15:00 UTC