Page 353 Table of Contents Index Page 355
Chapters
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30
A, B, C, D, E





Appendix D

Encapsulating Streams

An encapsulating stream is a special kind of stream that "closes over" another stream, handling
some of the usual stream protocol operations itself, and delegating the remaining operations to
the "encapsulated" stream. Encapsulating streams may be used by some CLIM implementations
in order to facilitate the implementation of features that require the dynamic modification of a
stream's state and operations. For example, accepting-values dialogs can be implemented by
using an encapsulating stream that tailors calls to accept and prompt-for-accept in such a
way that the output is captured and formatted into a dialog that contains prompts and fields
that can be clicked on and modified by the user. Input editing can also be implemented using
an encapsulating stream that manages the interaction between read-gesture and the input
editing commands and rescanning. The form filling-output can be implemented by having
an encapsulating stream that buffers output and inserts line breaks appropriately.

CLIM implementations need not use encapsulating streams at all. If encapsulating streams are
used, they must adhere to the following protocols. Encapsulating streams are not part of CLIM's
API.

D.1 Encapsulating Stream Classes

=> encapsulating-stream [Protocol Class]
The protocol class that corresponds to an encapsulating stream. If you want to create a new class
that behaves like an encapsulating stream, it should be a subclass of encapsulating-stream.
Subclasses of encapsulating-stream must obey the encapsulating stream protocol. Members
of this class are mutable.

=> encapsulating-stream-p object [Function]
Returns true if object is an encapsulating stream, otherwise returns false.

=> :stream [Init Arg]


Page 353 Table of Contents Index Page 355
Chapters
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30
A, B, C, D, E