Section "term"
Term input/output occupies the greatest part of the loader file,
since we have written these routines in Prolog itself. This
approach spares us from producing contrived host language code.
The Dogelog player provides the general term input/output
predicates read_term/[2,3] and write_term/[2,3], together with its
specializations as defined in the ISO core standard.
The following input/output predicates are provided:
- write(T): [ISO 8.14.2]
- write(S, T): [ISO 8.14.2]
- The predicate succeeds. As a side effect, the term T is
written. The binary predicate allows specifying an output stream
S.
- writeq(T): [ISO 8.14.2]
- writeq(S, T): [ISO 8.14.2]
- The predicate succeeds. As a side effect, the term T is
written with quoted strings. The binary predicate allows
specifying an output stream S.
- write_canonical(T): [ISO 8.14.2]
- write_canonical(S, T): [ISO 8.14.2]
- The predicate succeeds. As a side effect, the term T is
written with quoted strings and ignored operators. The binary
predicate allows specifying an output stream S.
- write_term(T, O): [ISO 8.14.2]
- write_term(S, T, O): [ISO 8.14.2]
- The predicate succeeds. As a side effect, the term T is
written with options O. The ternary predicate allows specifying
an output stream S. The available write options are:
variable_names(N): The variable names N, default is [].
quoted(B): The quoted strings flag B, default is false.
ignore_ops(B): The ignore operators flag B, default is false.
- priority(L): The operator priority L, default is 1200.
- numbervars(B): The number vars flag B, default is false.
- format(B): The pretty print flag B, default is false.
- read(E): [ISO 8.14.1]
- read(S, E): [ISO 8.14.1]
- The predicate succeeds in E with the read term or end_of_file.
As a side effect, the input position is advanced. The binary
predicate allows specifying an input stream.
- read_term(E, O): [ISO 8.14.1]
- read_term(S, E, O): [ISO 8.14.1]
- The predicate succeeds in E with the read term or end_of_file
and in O with the options. As a side effect, the input position
is advanced. The ternary predicate allows specifying an input
stream. The available read options are:
variable_names(N): The variable names N.
singletons(A): The singleton variable names A.
- priority(L): The operator priority L.
end_of_term(E): The end of term delimiter E.
- code_type(C, T):
- The predicate succeeds in T with the code type of C.
- code_category(C, V):
- The predicate succeeds in V with the Unicode code numeric
value of C, in case it is inte-ger and between 0 and 35.
Otherwise, the predicate succeeds in V With -1.
Kommentare