| Allegro CL version 9.0 Unrevised from 8.2 to 9.0. 8.2 version |
This kind of stream allows for the moving and possible translation of characters.
One subclass of string-simple-stream
, composing-stream
, allows composing of
external-formats and ligatures using Java-style encapsulations.
Other subclasses of
string-simple-stream
have a single buffer
which is in fact a string. It is available as an optimization to allow
read and format at a high level to be used on strings. For resourcing,
the string for the stream may be specified by a
:string
option to make-instance,
which is then passed to device-open as an options flag, or the string
for a string-output-simple-stream may be reused if it already exists
in the stream.
A string stream that is not a composing-stream
incorporates a major
exception in the CL requirements for the streams system: there is no
external connection; everything that lisp is reading from or writing
to the stream is within the lisp heap, and thus there are no reconnect
or shutdown problems with these streams; they continue to work across
a dumped lisp image that has been restarted.
string-input-simple-stream
and string-output-simple-stream
and
perhaps further subclasses), but not bidirectional, it is not
necessary to implement mode switching internally for the single string buffer. Implementations are free to define such a bidirectional string
stream (or to emulate such a stream - see note just below). Note: something similar to string streams could be implemented, with less efficient operation, by simulating an external-connection at the device level of either a single-channel or dual-channel stream. The "final destination" (or source) of the device would in that case be a string, and the extra octet buffering would require extra copying at the device level when transferring data out (or in). This technique would allow external-format processing on the strings either during input or output.
Copyright (c) 1998-2019, Franz Inc. Oakland, CA., USA. All rights reserved.
This page was not revised from the 8.2 page.
Created 2012.5.30.
| Allegro CL version 9.0 Unrevised from 8.2 to 9.0. 8.2 version |