Next: mpg-ref-write_term, Previous: mpg-ref-write, Up: mpg-bpr [Contents][Index]
write_canonical/[1,2]
ISOwrite_canonical(+Stream, +Term)
write_canonical(+Term)
Writes Term on the standard output stream, quoting atoms,
in functional notation, without treating '$VAR'/1
terms specially.
stream_object, must be ground
A valid open Prolog stream, defaults to the current output stream.
term
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,[])))