[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: A few random I/O proposals
> There are other possibilities.
> One of them would be to include the pair of procedures
> make-string-output-port and string-output-port-content.
I would suggest adapting the idea of an output procedure used in Marc
Feeley's genwrite.scm from SLIB to make a more general make-output-
port procedure:
(make-output-port OUTPUT)
make-output-port returns an output port. When an object is
written to the output port, OUTPUT is called one or more times
with one string argument, the successive substrings of the
textual transformation of the object. OUTPUT may return #f to
stop the transformation.
This way you can write open-output-string, open-truncated-output-
string, or other procedures you want.
Andrew Wilcox
Department of Astronomy & Astrophysics, Pennsylvania State University
(awilcox@astro.psu.edu)