Author(s): First versions from SICStus 0.6 code; additional changes and documentation by Daniel Cabeza and Manuel Carro.
Version: 1.8 (2002/5/16, 21:20:27 CEST)
Version of last change: 1.7#196 (2002/4/17, 20:0:32 CEST)
read
)read
)
read(Term)
Like read(Stream,Term)
with Stream
associated to the current input stream.
Usage: read(+Stream,?Term)
* ISO *
.
followed by either a space or a control character), is read from Stream
and is unified with Term
. The syntax of the term must agree with current operator declarations. If the end of Stream
has been reached, Term
is unified with the term end_of_file
. Further calls to read/2
for the same stream will then cause an error, unless the stream is connected to the terminal (in which case a prompt is opened on the terminal).
+Stream
is an open stream.
(streams_basic:stream/1
)
?Term
is any term.
(basic_props:term/1
)
Usage: read_term(?Term,+Options)
* ISO *
Usage: read_term(+Stream,?Term,+Options)
* ISO *
Term
from Stream
with the ISO-Prolog Options
. These options can control the behavior of read term (see
read_option/1
).
+Stream
is an open stream.
(streams_basic:stream/1
)
?Term
is any term.
(basic_props:term/1
)
+Options
is a list of read_option
s.
(basic_props:list/2
)
No further documentation available for this predicate.
Usage: second_prompt(?Old,?New)
read/2
and friends to New
, and returns the current one in Old
.
?Old
is currently instantiated to an atom.
(term_typing:atom/1
)
?New
is currently instantiated to an atom.
(term_typing:atom/1
)
read
)Defines flags as follows:
define_flag(read_hiord,[on,off],off).
(See section Changing system behaviour and various flags).
If flag is on
(it is off
by default), a variable followed by a parenthesized lists of arguments is read as a
call/N
term, except if the variable is anonymous, in which case it is read as an anonymous predicate abstraction head. For example, P(X)
is read as call(P,X)
and _(X,Y)
as "(X,Y)
.
The predicate is multifile.
read
)
Usage: read_option(Option)
Option
is an allowed
read_term/[2,3]
option. These options are:
read_option(variables(_V)). read_option(variable_names(_N)). read_option(singletons(_S)). read_option(lines(_StartLine,_EndLine)). read_option(dictionary(_Dict)).They can be used to return the singleton variables in the term, a list of variables, etc.
Option
is currently instantiated to an atom.
(term_typing:atom/1
)
Go to the first, previous, next, last section, table of contents.