[R6RS] I/O

William D Clinger will at ccs.neu.edu
Tue Jul 18 13:46:35 EDT 2006


Mike wrote:
> 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

  latin-1-codec
  utf-16le-codec
  utf-16be-codec
  utf-32le-codec
  utf-32be-codec

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.

Will



More information about the R6RS mailing list