Next: Character output stream methods, Previous: Binary stream methods, Up: Gray Streams
These generic functions are used to implement subclasses of fundamental-input-stream:
This is used to implement
peek-char; this corresponds topeek-typeofnil. It returns either a character or:eof. The default method callsstream-read-charandstream-unread-char.
This is used to implement
read-char-no-hang. It returns either a character, ornilif no input is currently available, or:eofif end-of-file is reached. The default method provided byfundamental-character-input-streamsimply callsstream-read-char; this is sufficient for file streams, but interactive streams should define their own method.
Read one character from the stream. Return either a character object, or the symbol
:eofif the stream is at end-of-file. Every subclass offundamental-character-input-streammust define a method for this function.
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 tostream-read-char.
This is used by
listen. It returns true or false. The default method usesstream-read-char-no-hangandstream-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.