In Version 3.0, read/[1,2] are non ISO-compliant in how they handle syntax errors or their behavior when encountering an end of file indicator.
Error Cases
In Version 3.0, read_canonical/[1,2] are non ISO-compliant in how they handle syntax errors or their behavior when encountering an end of file indicator.
Error Cases
Error Cases
Error Cases are the same as read_term/2, but with the additional errors that may arise in stream checking.
All proper HiLog terms (HiLog terms which are not also Prolog terms) are not written in their internal Prolog representation. Predicate write/1 always succeeds without producing an error.
HiLog (or Prolog) terms that are output by write/1 cannot in general be read back using read/1. This happens for two reasons:
Predicate write/1 treats terms of the form '$VAR'(N)
specially: it writes 'A' if N=0, 'B' if N=1,
, 'Z' if N=25, 'A1' if N=26,
etc. Terms of this form are generated by numbervars/[1,3]
described in the section Library Utilities in Volume 2.
'$VAR'(-1) is written as the anonymous variable '_'.
Error Cases are the same as read_term/2, but with the additional errors that may arise in stream checking.
'\VAR'(N) the same way as write/1, writing A if
N= 0, etc. In addition, output is in accordance with current
operator definitions. writeq/1 always succeeds without
producing an error.
Error Cases
Unlike writeq/1, write_canonical/1 does not treat terms
of the form '$VAR'(N) specially. It writes square bracket lists
using '.'/2 and [] (that is, [foo, bar] is written
as '.'(foo,'.'(bar,[]))).
Error Cases
From the following examples it can be seen that write_term/[2,3] can duplicate the behavior of a number of other I/O predicates such as write/[1,2], writeq/[1,2], write_canonical/[1,2], etc.
| ?- write_term(f(1+2,'A',"string",'$VAR'(3),'$VAR'('Temp'),(multifile foo)),[]).
f(1 + 2,A,"string",$VAR(3),$VAR(Temp),(multifile foo))
yes
| ?- write_term(f(1+2,'A',"string",'$VAR'(3),'$VAR'('Temp'),(multifile foo)),
[quoted(true)]).
f(1 + 2,'A',"string",'$VAR'(3),'$VAR'('Temp'),(multifile foo))
yes
| ?- write_term(f(1+2,'A',"string",'$VAR'(3),'$VAR'('Temp'),(multifile foo)),
[quoted(true),ignore_ops(true),numbervars(true)]).
f(+(1,2),'A','.'(115,'.'(116,'.'(114,'.'(105,'.'(110,'.'(103,[])))))),D,Temp,(multifile foo))
yes
| ?- write_term(f(1+2,'A',"string",'$VAR'(3),'$VAR'('Temp'),(multifile foo)),
[quoted(true),ignore_ops(true),numbervars(true),priority(1000)]).
f(+(1,2),'A','.'(115,'.'(116,'.'(114,'.'(105,'.'(110,'.'(103,[])))))),D,Temp,multifile(foo))
yes
Error Cases
Error Cases are the same as write_term/2 but with these additions.
Error Cases are the same as write_term/2 but with these additions.