read_term/[2,3]
read_term
+Options, -Term)]
read_term
+Stream, +-Options, -Term)]
Read a term from the current input stream or from Stream, optionally returning extra information about the term.
syntax_errors(
Val)
quiet
read_term/[2,3]
fails
dec10
read_term/[2,3]
tries to read the next term (this
is compatible with DEC-10 Prolog and previous versions
of Quintus Prolog)
fail
read_term/[2,3]
fails
The default value if this option is not specified is the
current value of the syntax_errors
prolog flag. The default
value for this flag is dec10
. See
prolog_flag/2
for more information on these
flags.
variable_names(
Names)
_
, are not included in this list.
singletons(
Singletons)
term_position(
Position)
stream_position/2
. Any white space and comments before
the actual term are not reflected by the position. To find
the position of the end of the term, you need only call
stream_position/2
; it will give you the position of the
first character after the period ending the term.
subterm_positions(
PositionTerm)
stream_position/2
.
list_position(
Start,
End,
Elts,
Tail)
[a,list]
). Elts is a list of
position terms for each proper element of the list.
Tail is the position of the tail of the list (the
part following the |
), or the atom none
if the list
has no tail part.
string_position(
Start,
End)
"a string"
). The positions specified
include the quote characters.
brace_term_position(
Start,
End,
Arg)
term_position(
Start,
End,
FStart,
FEnd,
Args)
syntax_error
permission_error
domain_error
instantiation_error
syntax_errors
option is unbound
type_error
syntax_errors
option is not an atom
| ?- read_term([variable_names(L)], T). |: append([U|X],Y,[U|Z]) :- append(X,Y,Z). L = ['U'=_1988,'X'=_2003,'Y'=_2020,'Z'=_2046], T = (append([_1988|_2003],_2020,[_1988|_2046]):- append(_2003,_2020,_2046))
| ?- read_term([subterm_positions(P)], T). |: foo+bar+baz. P = term_position(1642,1653,1649,1650, [term_position(1642,1649,1645,1646, [1642-1645,1646-1649]), 1650-1653]), T = foo+bar+baz
read/[1,2]
, prompt/[2,3]
prolog_flag/[2,3]
ref-iou