ToC DocOverview CGDoc RelNotes Index PermutedIndex
Allegro CL version 7.0
Home Previous Up Next Table of Contents Index
  ANSI Common Lisp   21 Streams   21.2 Dictionary of Streams

21.2.34 listen Function

Syntax:
listen &optional input-stream    generalized-boolean

Arguments and Values:
input-stream - an input stream designator. The default is standard input.

generalized-boolean - a generalized boolean.

Description:
Returns true if there is a character immediately available from input-stream; otherwise, returns false. On a non-interactive input-stream, listen returns true except when at end of file1. If an end of file is encountered, listen returns false. listen is intended to be used when input-stream obtains characters from an interactive device such as a keyboard.

Examples:
 (progn (unread-char (read-char)) (list (listen) (read-char)))
1
 (T #\1)
 (progn (clear-input) (listen))
  NIL ;Unless you're a very fast typist!

Affected By:
*standard-input*

See Also:
interactive-stream-p, read-char-no-hang

Allegro CL Implementation Details:
None.

Home Previous Up Next Table of Contents Index
© Franz Inc. 1998-2002 - File last updated 6-21-2002