write_canonical/[1,2]
[ISO]write_canonical(
+Stream,
+Term)
write_canonical(
+Term)
Writes Term on the standard output stream, quoting atoms,
without operator notation, without treating '$VAR'/1
terms specially.
A valid open Prolog stream, defaults to the current output stream.
This predicate is provided so that Term, if written to a
file, can be read back by read/[1,2]
regardless of special
characters in Term or prevailing operator declarations.
write_canonical(Term)
is equivalent to:
write_term(Term, [quoted(true),ignore_ops(true),quoted_charset(portable)])
Stream errors (see ref-iou-sfh-est).
To contrast write/[1,2]
and write_canonical/[1,2]
:
| ?- write({'A' + '$VAR'(0) + [a]}). {A+A+[a]} | ?- write_canonical({'A' + '$VAR'(0) + [a]}). {}(+(+('A','$VAR'(0)),.(a,[])))