[R6RS] Changing the transcoding mid-stream

dyb at cs.indiana.edu dyb at cs.indiana.edu
Wed Aug 23 14:27:29 EDT 2006


> > Mike, if this wasn't an oversight that should simply be fixed by replacing
> > call-with-whatever-output-port with open-whatever-output-port, can you
> > explain the rationale?  Assuming there is a rationale, why doesn't it
> > apply to the input versions?  Why doesn't it it apply to the file opener?
> > Is there some reason that call-with-port won't suffice to handle all
> > "call-with" situations?
>
> Yes.  How do you get at the accumulated output?

Oh, sorry.  I didn't read the descriptions carefully.  I just assumed
there were separate extraction procedures, and these procedures
essentially duplicated the call-with-port functionality, but of course
that isn't the case.

I guess these procedures capture a common usage pattern and are worth
keeping, but they would work for only about half of my uses of
open-output-string, judging from a quick look at the Chez Scheme source
code.  Also, these procedures effectively give all string and bytes ports
dynamic extent (I know the ports may survive indefinitely, but they're
useless) which would be unique among Scheme objects.

Therefore, I would like to include as well the procedures
open-string-output-port, open-bytes-output-port, get-output-string, and
get-output-bytes, with the obvious interfaces and semantics.

Kent



More information about the R6RS mailing list