Next Previous Up Top Contents Index

5.11 The STREAMS module

make sequence-stream-class

G.f. method

Summary

Creates and opens a stream over a sequence.

Signature

make sequence-stream-class #key contents direction start end 
=> sequence-stream-instance

Arguments

sequence-stream-class

The class <sequence-stream>.

contents
An instance of <sequence>.

direction
One of #"input", #"output", or #"input-output". Default value: #"input".

start
An instance of <integer>. Default value: 0.

end
An instance of <integer>. Default value: contents.size.

Values

sequence-stream-instance

An instance of <sequence-stream>.

Library

io

Module

streams

Description

Creates and opens a stream over a sequence.

This method returns a general instance of <sequence-stream>. To determine the concrete subclass to be instantiated, this method calls the generic function type-for-sequence-stream.

The contents init-keyword is a general instance of <sequence> which is used as the input for input streams, and as the initial storage for an output stream. If contents is a stretchy vector, then it is the only storage used by the stream.

The direction init-keyword specifies the direction of the stream.

The start and end init-keywords are only valid when direction is #"input". They specify the portion of the sequence to create the stream over: start is inclusive and end is exclusive. The default is to stream over the entire sequence.

Example

let sv = make(<stretchy-vector>);
let stream = make(<sequence-stream>, 
                  contents: sv, 
                  direction: #"output");
write(stream,#(1, 2, 3, 4, 5, 6, 7, 8, 9));
write(stream,"ABCDEF");
values(sv, stream-contents(stream));

See also

<sequence-stream>, page 91

type-for-sequence-stream, page 104


System and I/O Reference - 31 MAR 2000

Next Previous Up Top Contents Index