Common Lisp Package: MEL.GRAY-STREAM

README:

GENERIC-FUNCTION

Public

STREAM-CLEAR-INPUT (STREAM)

This is like CL:CLEAR-INPUT, but for Gray streams, returning NIL. The default method does nothing.

STREAM-CLEAR-OUTPUT (STREAM)

This is like CL:CLEAR-OUTPUT, but for Gray streams: clear the given output STREAM. The default method does nothing.

STREAM-ELEMENT-TYPE (STREAM)

Return a type specifier for the kind of object returned by the STREAM. The class FUNDAMENTAL-CHARACTER-STREAM provides a default method which returns CHARACTER.

STREAM-FINISH-OUTPUT (STREAM)

Attempts to ensure that all output sent to the Stream has reached its destination, and only then returns false. Implements FINISH-OUTPUT. The default method does nothing.

STREAM-FORCE-OUTPUT (STREAM)

Attempts to force any buffered output to be sent. Implements FORCE-OUTPUT. The default method does nothing.

STREAM-LINE-COLUMN (STREAM)

Return the column number where the next character will be written, or NIL if that is not meaningful for this stream. The first column on a line is numbered 0. This function is used in the implementation of PPRINT and the FORMAT ~T directive. For every character output stream class that is defined, a method must be defined for this function, although it is permissible for it to always return NIL.

STREAM-LISTEN (STREAM)

This is used by LISTEN. It returns true or false. The default method uses STREAM-READ-CHAR-NO-HANG and STREAM-UNREAD-CHAR. Most streams should define their own method since it will usually be trivial and will always be more efficient than the default method.

STREAM-READ-BYTE (STREAM)

Used by READ-BYTE; returns either an integer, or the symbol :EOF if the stream is at end-of-file.

STREAM-READ-CHAR (STREAM)

Read one character from the stream. Return either a character object, or the symbol :EOF if the stream is at end-of-file. Every subclass of FUNDAMENTAL-CHARACTER-INPUT-STREAM must define a method for this function.

STREAM-READ-CHAR-NO-HANG (STREAM)

This is used to implement READ-CHAR-NO-HANG. It returns either a character, or NIL if no input is currently available, or :EOF if end-of-file is reached. The default method provided by FUNDAMENTAL-CHARACTER-INPUT-STREAM simply calls STREAM-READ-CHAR; this is sufficient for file streams, but interactive streams should define their own method.

STREAM-READ-LINE (STREAM)

This is used by READ-LINE. A string is returned as the first value. The second value is true if the string was terminated by end-of-file instead of the end of a line. The default method uses repeated calls to STREAM-READ-CHAR.

STREAM-READ-SEQUENCE (STREAM SEQ &OPTIONAL START END)

This is like CL:READ-SEQUENCE, but for Gray streams.

STREAM-UNREAD-CHAR (STREAM CHARACTER)

Un-do the last call to STREAM-READ-CHAR, as in UNREAD-CHAR. Return NIL. Every subclass of FUNDAMENTAL-CHARACTER-INPUT-STREAM must define a method for this function.

STREAM-WRITE-BYTE (STREAM INTEGER)

Implements WRITE-BYTE; writes the integer to the stream and returns the integer as the result.

STREAM-WRITE-CHAR (STREAM CHARACTER)

Write CHARACTER to STREAM and return CHARACTER. Every subclass of FUNDAMENTAL-CHARACTER-OUTPUT-STREAM must have a method defined for this function.

STREAM-WRITE-SEQUENCE (STREAM SEQ &OPTIONAL START END)

This is like CL:WRITE-SEQUENCE, but for Gray streams.

STREAM-WRITE-STRING (STREAM STRING &OPTIONAL START END)

This is used by WRITE-STRING. It writes the string to the stream, optionally delimited by start and end, which default to 0 and NIL. The string argument is returned. The default method provided by FUNDAMENTAL-CHARACTER-OUTPUT-STREAM uses repeated calls to STREAM-WRITE-CHAR.

Private

STREAM-PEEK-CHAR (STREAM)

This is used to implement PEEK-CHAR; this corresponds to PEEK-TYPE of NIL. It returns either a character or :EOF. The default method calls STREAM-READ-CHAR and STREAM-UNREAD-CHAR.

CLASS

Public

FUNDAMENTAL-BINARY-INPUT-STREAM

a superclass of all Gray input streams whose element-type is a subtype of unsigned-byte or signed-byte

FUNDAMENTAL-BINARY-OUTPUT-STREAM

a superclass of all Gray output streams whose element-type is a subtype of unsigned-byte or signed-byte

FUNDAMENTAL-CHARACTER-INPUT-STREAM

a superclass of all Gray input streams whose element-type is a subtype of character

FUNDAMENTAL-CHARACTER-OUTPUT-STREAM

a superclass of all Gray output streams whose element-type is a subtype of character