Term I/O

read(X)
read/1 (B) The next term, delimited by a full stop (i.e. a . followed by a carriage-return or a space), is read from the current input stream and unified with X. The syntax of the term must accord with current operator declarations. If a call read(X) causes the end of the current input stream to be reached, X is unified with the atom `end_of_file'. Further calls to read for the same stream will then cause an error failure.

write(X)
write/1 (L) The term X is written to the current output stream according to operator declarations in force.

display(X)
display/1 (L) The term X is displayed on the terminal.

writeq(Term)
writeq/1 (L) Similar to write(Term), but the names of atoms and functors are quoted where necessary to make the result acceptable as input to read.

print(Term)
print/1 (L) Prints out the term Term onto the current output stream. This predicate provides a handle for user-defined pretty-printing. If Term is a variable then it is written using write/1; otherwise, if a user-defined predicate portray/1 is defined, then a call is made to portray(Term); otherwise, print/1 is equivalent to write/1.

writename(Term)
writename/1 (B) If Term is an uninstantiated variable, its name, which looks a lot like an address in memory, is written out; otherwise, the principal functor of Term is written out.

writeqname(Term)
writeqname/1 (B) As for writename, but the names are quoted where necessary.

print_al(N, A)
print_al/2 (L) Prints A (which must be an atom or a number) left-aligned in a field of width N, with blanks padded to the right. If A's print name is longer than the field width N, then A is printed but with no right padding.

print_ar(N, A)
print_ar/2 (L) Prints A (which must be an atom or a number) right-aligned in a field of width N, with blanks padded to the left. If A's print name is longer than the field width N, then A is printed but with no left padding.

portray_term(Term)
portray_term/2 (L) Writes out the term Term on the current output stream. Variables are treated specially: an uninstantiated variable is printed out as Vn, where n is a number.

portray_clause(Term)
portray_clause/2 (L) Writes out the term Term, interpreted as a clause, on the current output stream. Variables are treated as in portray_term/1.