5.6.3 Writing to streams
This section describes the basic functions for writing to streams.
write-element
Open generic function
write-element output-stream element => ()
- Writes element to output-stream at the stream's current position. It is an error if the type of element is inappropriate for the stream's underlying aggregate.
- If the stream is positionable, and it is not positioned at its end,
write-element overwrites the element at the current position and then advance the stream position.
write
Open generic function
write output-stream sequence #key start end => ()
- Writes the elements of sequence to output-stream, starting at the stream's current position.
- If supplied, start and end delimit the portion of sequence to write to the stream. The value of start is inclusive and that of end is exclusive. If start and end are not supplied, the whole sequence is written.
- For positionable streams, if the initial position of the stream is such that writing sequence will flow past the current end of the stream, then the stream is extended to accommodate the extra elements. Once the write operation has finished, the stream is positioned one place past the last element written.
See force-output, page 71, synchronize-output, page 103, and discard-output, page 66.