Page 347 Table of Contents Index Page 349
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 C

Common Lisp Streams

CLIM performs all of its character-based input and output operations on objects called streams.
Streams are divided into two layers, the basic stream protocol, which is character-based and
compatible with existing Common Lisp programs, and the extended stream protocol, which
introduces extended gestures such as pointer gestures and synchronous window-manager com-
munication.

This appendix describes the basic stream-based input and output protocol used by CLIM. The
protocol is taken from the STREAM-DEFINITION-BY-USER proposal to the X3J13 committee, made
by David Gray of TI. This proposal was not accepted by the X3J13 committee as part of the
ANSI Common Lisp language definition, but many Lisp implementations do support it. For
those implementations that do not support it, it is implemented as part of CLIM.

C.1 Stream Classes

The following classes must be used as superclasses of user-defined stream classes. They are not
intended to be directly instantiated; they just provide places to hang default methods.

=> fundamental-stream [Class]
This class is the base class for all CLIM streams. It is a subclass of stream and of standard-
object
.

=> streamp object [Generic Function]
Returns true if object is a member of the class fundamental-stream. It may return true for
other objects that are not members of the fundamental-stream class, but claim to serve as
streams. (It is not sufficient to implement streamp as (typep object 'fundamental-stream),
because implementations may have additional ways of defining streams.)

=> fundamental-input-stream [Class]


Page 347 Table of Contents Index Page 349
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