[ ECLiPSe Term-based I/O built-in.|Group Index|
Full Index]
read(?Term)
Succeeds if the next term from the input stream is successfully read and
unified with Term.
- ?Term
- Prolog term.
Description
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.
Fail Conditions
Fails if Term does not unify with the next Prolog term read from input.
Resatisfiable
No.
Exceptions
- (190)
- End of file was encountered before reading any character.
- (198)
- Trying to read even after the error 190 was raised.
Examples
Equivalent to read(input, Term). (see read/2 for details).
See Also
read / 2