Noeud: Input and Output of Terms, Noeud « Next »: , Noeud « Previous »: Reading-in Programs, Noeud « Up »: Input / Output



Input and Output of Terms

read(?Term)
read(+Stream,?Term)
The next term, delimited by a full-stop (i.e. a ., possibly followed by layout text), is read from Stream and is unified with Term. The syntax of the term must agree with current operator declarations. If a call read(Stream,Term) causes the end of Stream to be reached, Term is unified with the term eof. Further calls to read/2 for the same stream will then fail, unless the stream is connected to the terminal.
read_term(?Term,+Vars)
read_term(+Stream,?Term,+Vars)
Same as read/1-2 with a third argument +Vars. This argument is unified with a list of Name=Var pairs, where each Name is an atom indicating the name of a non-anonymous variable in the term, and Var is the corresponding variable.
write(?Term)
write(+Stream,?Term)
The term Term is written onto Stream according to current operator declarations.
writeln(?Term)
writeln(+Stream,?Term)
Same as write/1-2 except that a newline is send,
display(?Term)
The term Term is displayed onto the standard output stream (which is not necessarily the current output stream) in standard parenthesized prefix notation.
writeq(?Term)
writeq(+Stream,?Term)
Similar to write(Stream,Term), but the names of atoms and functors are quoted where necessary to make the result acceptable as input to read/2, provided the same operator declarations are in effect.