[ Term I/O | Reference Manual | Alphabetic Index ]


Succeeds if the next term from the input stream is successfully read and unified with Term.
Prolog term.


Used to read the next term from the input stream and unify it with Term. The term must be in Prolog term format i.e. terminated by fullstop (a period and a blank space character), neither of which are retained by Prolog.

End of file acts like fullstop. If only end of file is read, the event 190 is raised and the default handler unifies Term with the atom end_of_file.

The default action for syntax errors is to print a warning and fail.

Modes and Determinism


This predicate is sensitive to its module context (tool predicate, see @/2).

Fail Conditions

Fails if a syntax error was detected and no term could be read


(190) end of file reached
End of file was encountered before reading any character.
(198) reading past the file end
Trying to read even after the error 190 was raised.


   Equivalent to read(input, Term).  (see read/2 for details).

See Also

read / 2