ANSI Common Lisp 21 Streams 21.2 Dictionary of Streams
&optional input-stream eof-error-p
- Arguments and Values:
input-stream -- an input stream designator.
The default is standard input.
eof-error-p - a generalized boolean.
The default is true.
eof-value - an object.
The default is nil.
recursive-p - a generalized boolean.
The default is false.
char - a character or nil or the eof-value.
read-char-no-hang returns a character
from input-stream if such a character is available. If no character
is available, read-char-no-hang returns nil.
If recursive-p is true,
this call is expected to be embedded in a higher-level call to read
or a similar function used by the Lisp reader.
If an end of file2 occurs and eof-error-p is false,
eof-value is returned.
;; This code assumes an implementation in which a newline is not
;; required to terminate input from the console.
(defun test-it ()
;; Implementation A, where a Newline is not required to terminate
;; interactive input on the console.
(#\a NIL NIL)
;; Implementation B, where a Newline is required to terminate
;; interactive input on the console, and where that Newline remains
;; on the input stream.
(#\a #\Newline NIL)
- Affected By:
- Exceptional Situations:
If an end of file2 occurs
when eof-error-p is true,
an error of type end-of-file is signaled .
- See Also:
read-char-no-hang is exactly like read-char, except
that if it would be necessary to wait in order to get a character (as
from a keyboard), nil is immediately returned without waiting.
- Allegro CL Implementation Details: