William D Clinger
will at ccs.neu.edu
Tue Jul 18 13:46:35 EDT 2006
> Is XML (where a tag somewhere in the first line indicates the
> encoding) a common situation by that definition?
I see your point. Ouch.
Why not move the side effect from the port to the transcoder?
Then ports won't be slowed down to accomodate the relatively
unlikely possibility that they will be side effected. E.g.
get rid of transcode-input-port! and replace it with
(mutable-transcoder (codec codec) (eol-style eol-style)) (syntax)
(update-transcoder! old (codec codec) (eol-style eol-style)) (syntax)
where old must be a transcoder created by mutable-transcoder.
If you insist, you could also change the default transcoder
from none to mutable none, in which case we would also have
to add a procedure that returns the none transcoder.
By the way, in addition to
we need utf-16bom-codec and utf-32bom-codec that interpret a
byte order mark if one is present, defaulting in the standard
way if one is not.
More information about the R6RS