Next: , Previous: , Up: Streams   [Contents][Index]


5.24.3 Input Functions

Function: read-char stream

Read and return the next character from the input stream stream. If the end of the stream is reached false is returned.

Function: peek-char stream

returns the next character from the input-stream stream, without removing that character from the head of the stream. if no more characters are available returns nil.

Function: read-chars stream count

read upto count characters from the input stream stream, returning a string containing the characters. If EOF is read before reading count characters, the returned string will contain the characters read up to that point. If no characters are read, nil will be returned.

Function: read-line stream

This function reads one line of text from the input stream stream, a string containing the line (including the newline character which terminates the line).

If the end of stream is reached before any characters can be read false is returned, if the end of stream is reached but some characters have been read (but not the newline) these characters are made into a string and returned.

Note that unlike the Common Lisp function of the same name, the newline character is not removed from the returned string.

Function: read stream

This function is the function which encapsulates the Lisp reader (see The Lisp Reader). It reads as many characters from the input stream stream as required to form the read syntax of a single Lisp object (see Read Syntax), this object is then returned.

Function: read-from-string string #!optional start

Reads one Lisp object from the string string, the first character is read from position start (or position zero).

(read-from-string string start)
≡
(read (make-string-input-stream string start))

Next: , Previous: , Up: Streams   [Contents][Index]