Add io.write_line_cc/4.

library/io.m:
    Add a version of io.write_line_cc that takes an explicit stream argument.

NEWS:
    Announce the addition.

browser/interactive_query.m:
    Use the new predicate.
This commit is contained in:
Zoltan Somogyi
2021-03-06 22:09:22 +11:00
parent 5d1b995302
commit dadf30718d
3 changed files with 10 additions and 2 deletions

3
NEWS
View File

@@ -124,6 +124,9 @@ Changes to the Mercury standard library
### Changes to the `io` module
* The following predicate has been added to this module:
- pred `write_line_cc/4`
* The following obsolete predicates have been removed:
- pred `make_temp/3` (replacement: `make_temp_file/3`)

View File

@@ -940,8 +940,7 @@ write_binding(OutputStream, Bindings, Output, !IO) :-
report_exception(OutputStream, Excp, !IO) :-
io.write_string(OutputStream, "*** caught exception: ", !IO),
io.write_cc(OutputStream, Excp, !IO),
io.nl(OutputStream, !IO).
io.write_line_cc(OutputStream, Excp, !IO).
%---------------------------------------------------------------------------%
%

View File

@@ -1183,6 +1183,8 @@
:- mode write_line(in, in, in, di, uo) is cc_multi.
:- pred write_line_cc(T::in, io::di, io::uo) is cc_multi.
:- pred write_line_cc(io.text_output_stream::in, T::in, io::di, io::uo)
is cc_multi.
% Writes a binary representation of a term to the current binary output
% stream or to the specified stream, in a format suitable for reading in
@@ -8848,6 +8850,10 @@ write_line_cc(X, !IO) :-
io.write_cc(X, !IO),
io.nl(!IO).
write_line_cc(Stream, X, !IO) :-
io.write_cc(Stream, X, !IO),
io.nl(Stream, !IO).
%---------------------%
write_binary(Term, !IO) :-