CLIM defined
Generic Function STREAM-LISTEN, STREAM-READ-CHAR-NO-HANG

Syntax:

stream-listen stream => result

stream-read-char-no-hang stream => char

Arguments and Values:

stream---a character input stream.

result---a a generalized boolean

char---a a character or the symbol :EOF.

Description:

Stream-listen is used by the ANSI defined function listen and returns true if there is any input pending on stream, otherwise it returns false.

Stream-read-char-no-hang is used by the ANSI defined function read-char-no-hang and returns either a character, or the symbol :EOF if stream is at end of file.

Methods:

Primary Method stream-listen (stream fundamental-character-input-stream)
Calls stream-read-char-no-hang and stream-unread-char.

Primary Method stream-read-char-no-hang (stream fundamental-character-input-stream)
Calls stream-read-char

Primary Method stream-listen (stream encapsulating-stream)
Primary Method stream-read-char-no-hang (stream encapsulating-stream)
Calls the same generic-function on the encapsulating-stream-stream of stream.

Side Effects: None.

Affected By: None.

Exceptional Situations: None.

See Also:

"Extensions to Common Lisp", CLIM Stream Classes, Eclipse Stream Classes, stream-read-char, stream-unread-char. stream-peek-char.

Notes:

The default method for stream-read-char-no-hang (on fundamental-character-input-stream) is sufficient for file streams, but interactive streams should define their own method.

Most user-defined streams should define their own methods for steam-listen since it will usually be trivial and will generally be more efficient than the default method (on fundamental-character-input-stream).


[Previous] [Next] [Up] [Documentation Contents] [Eclipse Home Page]