This is just a quick note of an interface idea: I've no implementation,
and am not planning to work on one, but thought that people working on
streams might want to tear this apart. As alluded to briefly on #lisp:
Instead of (SETF STREAM-ELEMENT-TYPE) which as Rudi notes in his blog will
lead to a great deal of UNWIND-PROTECTING, or bivalent streams which
seem vaguely unsanitary we might have parallel streams:
MAKE-PARALLEL-STREAM stream &key element-type external-format
would return a new stream attached to the same source/sink as STREAM.
Reads ans writes to one stream would move the "cursor" in all parallel
streams attached to the same source/sink. At an implementation level
buffers could/should probably be shared between these streams.
This way one could easily write alternating binary and character data in
various encodings to a single sink, which is something people seem to
want. I've no idea how "easy" this would be for us to provide, but hey...
-- Nikodemus Schemer: "Buddha is small, clean, and serious."
Lispnik: "Buddha is big, has hairy armpits, and laughs."