Next Previous Up Top Contents Index

5.11 The STREAMS module

write-element

Open generic function

Summary

Writes an element to an output stream.

Signature

write-element output-stream element => ()

Arguments

output-stream
An instance of <stream>.

element
An instance of <object>.

Values

None.

Library

io

Module

streams

Description

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.

Example

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);

See also

read-element, page 44

write, page 111

write-line, page 113


System and I/O Reference - 31 MAR 2000

Next Previous Up Top Contents Index