Next Previous Up Top Contents Index

5.5.1 Creating streams

5.5.1.3 Sequence streams

There are make methods on the following stream classes:

Rather than creating direct instances of <sequence-stream> or <string-stream>, the make methods for those classes might create an instance of a subclass determined by type-for-sequence-stream.

make sequence-stream-class

G.f. method

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

Creates and opens a stream over a sequence, and 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 an input stream, and as the initial storage for an output stream. If contents is a stretchy sequence (such as an instance of <stretchy-vector>), then it is the only storage used by the stream.
The direction: init-keyword specifies the direction of the stream. It must be one of #"input", #"output", or #"input-output"; the default is #"input".
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: start: is by default 0, and end: is contents.size.
make string-stream-class

G.f. method

make <string-stream> #key contents direction start end 
=> string-stream-instance 

Creates and opens a stream over a string, and returns an instance of <string-stream>.
If supplied, contents: must be an instance of <string>. The direction:, start:, and end: init-keywords are as for make on <sequence-stream>.
make byte-string-stream-class

G.f. method

make <byte-string-stream #key contents direction start end 
=> byte-string-stream-instance 

Creates and opens a stream over a byte string, and returns a new instance of <byte-string-stream>.
If supplied, contents: must be an instance of <string>. The direction:, start:, and end: init-keywords are as for make on <sequence-stream>.
make unicode-string-stream-class

G.f. method

make <unicode-string-stream> #key contents direction start end 
=> unicode-string-stream-instance 

Creates and opens a stream over a Unicode string, and returns a new instance of <unicode-string-stream>.
If supplied, contents: must be an instance of <string>. The direction:, start:, and end: init-keywords are as for make on <sequence-stream>.

System and I/O Reference - 31 MAR 2000

Next Previous Up Top Contents Index