[r6rs-discuss] Stateful codecs and inefficient transcoding
I'm sorry, but I really goofed up the definition of composition
for transcoders, which should have been:
* If t1 and t2 are transcoders, then their composition
is defined by describing their composition in both
the input and output directions. In the input
direction, their composition is t1input followed by
t2output followed by t2input. For output, their
composition is t2output followed by t2input followed
by t1output.
I should also have mentioned that the composition affects
all future operations of the derived ports created by the
proposed transcoded-port procedure, but doesn't reach back
into the past to change characters that have already been
read or written at the Scheme level.
The rationale for this definition of composition is that
it adds a new layer of transcoding onto the existing layer,
instead of replacing the existing layer. That allows
some of the weirder, file-at-a-time transcodings.
For input, it means that characters that have already
been transcoded into a buffer using t1 do not have to be
flushed. Flushing would require ports to keep track of
correspondences between bytes and individual characters,
which is impossible in general and inefficient even for
common transcodings.
In practice, t1 will usually be the binary transcoder,
and t2output followed by t2input will be the identity
restricted to some subset of the Unicode characters.
Will
Received on Sat Nov 04 2006 - 13:07:29 UTC
This archive was generated by hypermail 2.3.0
: Wed Oct 23 2024 - 09:15:00 UTC