Open generic function
Writes an element to an output stream.
write-element output-stream element => ()
<stream>.
<object>.
io
streams
Writes element to output-stream at the stream's current position. The output-stream must be either #"output" or #"input-output". 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 advances the stream position.
The following forms bind stream to an output stream over an empty string and create the string "I see!", using the function stream-contents to access all of the stream's elements.
let stream = make(<byte-string-stream>,
direction: #"output");
write-element(stream, 'I');
write-element(stream, ' ');
write-element(stream, 'd');
write-element(stream, 'o');
stream-contents(stream);