This library provides different predicates for term output, additional to the kernel predicates display/1-display/2 and displayq/1-displayq/2. All the predicates defined in ISO-Prolog are included, plus other traditionally provided by Prolog Implementations. Output predicates are provided in two versions: one that uses the current output stream and another in which the stream is specified explicitly, as an additional first argument.
Usage:ISOwrite_term(Stream,Term,OptList)
Outputs the term Term to the stream Stream, with the list of write-options OptList. See write_option/1 type for default options.
Usage:ISOwrite_term(Term,OptList)
Behaves like current_output(S), write_term(S,Term,OptList).
Usage:write_option(Opt)
Opt is a valid write option.
Usage:ISOwrite(Stream,Term)
Behaves like write_term(Stream, Term, [numbervars(true)]).
Usage:ISOwrite(Term)
Behaves like current_output(S), write(S,Term).
Usage:ISOwriteq(Stream,Term)
Behaves like write_term(Stream, Term, [quoted(true), numbervars(true)]).
Usage:ISOwriteq(Term)
Behaves like current_output(S), writeq(S,Term).
Usage:ISOwrite_canonical(Stream,Term)
Behaves like write_term(Stream, Term, [quoted(true), ignore_ops(true)]). The output of this predicate can always be parsed by read_term/2 even if the term contains special characters or if operator declarations have changed.
Usage:ISOwrite_canonical(Term)
Behaves like current_output(S), write_canonical(S,Term).
Usage:print(Stream,Term)
Behaves like write_term(Stream, Term, [numbervars(true), portrayed(true)]).
Usage:print(Term)
Behaves like current_output(S), print(S,Term).
Usage:printq(Stream,Term)
Behaves like write_term(Stream, Term, [quoted(true), numbervars(true), portrayed(true)]).
Usage:printq(Term)
Behaves like current_output(S), printq(S,Term).
Usage:portray_clause(Stream,Clause)
Outputs the clause Clause onto Stream, pretty printing its variables and using indentation, including a period at the end. This predicate is used by listing/0.
Usage:portray_clause(Clause)
Behaves like current_output(S), portray_clause(S,Term).
Usage:numbervars(Term,N,M)
Unifies each of the variables in term Term with a term of the form '$VAR'(I) where I is an integer from N onwards. M is unified with the last integer used plus 1. If the resulting term is output with a write option numbervars(true), in the place of the variables in the original term will be printed a variable name consisting of a capital letter possibly followed by an integer. When N is 0 you will get the variable names A, B, ..., Z, A1, B1, etc.
Usage:prettyvars(Term)
Similar to numbervars(Term,0,_), except that singleton variables in Term are unified with '$VAR'('_'), so that when the resulting term is output with a write option numbervars(true), in the place of singleton variables _ is written. This predicate is used by portray_clause/2.
Usage:printable_char(Char)
Char is the code of a character which can be printed.
define_flag(write_strings,[on,off],off).(See Runtime system control and flags).
If flag is on, lists which may be written as strings are.
Usage:define_flag(Flag,FlagValues,Default)
Usage:portray_attribute(Attr,Var)
A user defined predicate. When an attributed variable Var is about to be printed, this predicate receives the variable and its attribute Attr. The predicate should either print something based on Attr or Var, or do nothing and fail. In the latter case, the default printer (write/1) will print the attributed variable like an unbound variable, e.g. _673.
Usage:portray(T)
A user defined predicate. This should either print the Term and succeed, or do nothing and fail. In the latter case, the default printer (write/1) will print the Term.