18.3 Input Functions

This section describes the Lisp functions and variables that pertain
to reading.

In the functions below, stream stands for an input stream (see
the previous section). If stream is nil or omitted, it
defaults to the value of standard-input.

An end-of-file error is signaled if reading encounters an
unterminated list, vector, or string.

— Function: read &optional stream

This function reads one textual Lisp expression from stream,
returning it as a Lisp object. This is the basic Lisp input function.

— Function: read-from-string string &optional start end

This function reads the first textual Lisp expression from the text in
string. It returns a cons cell whose car is that expression,
and whose cdr is an integer giving the position of the next
remaining character in the string (i.e., the first one not read).

If start is supplied, then reading begins at index start in
the string (where the first character is at index 0). If you specify
end, then reading is forced to stop just before that index, as if
the rest of the string were not there.