[m-rev.] diff: delete deprecated preds and fix library documentation

Julien Fischer juliensf at cs.mu.OZ.AU
Mon Nov 14 19:14:44 AEDT 2005


Estimated hours taken: 0.5
Branches: main

library/io.m:
	Delete pre-0.12 deprecated predicates.

library/list.m:
library/set_bbbtree.m:
library/ops.m:
	Fix some doubled-up words in the documentation.

library/term_to_xml.m:
	Delete the XXX comments about tabling some of the predicates
	in this module.  This is not going ahead.

	'..' is now an infix operator so it doesn't need to be quoted.

	Fix a doubled-up word.

Julien.

Index: library/io.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/io.m,v
retrieving revision 1.338
diff -u -r1.338 io.m
--- library/io.m	10 Nov 2005 06:24:57 -0000	1.338
+++ library/io.m	14 Nov 2005 07:52:21 -0000
@@ -1303,64 +1303,6 @@
 :- pred io__error_message(io__error::in, string::out) is det.

 %-----------------------------------------------------------------------------%
-%
-% Deprecated predicates.
-%
-
-% Do not use these in new programs!
-% They may be deleted in the next release.
-
-    % Use io__input_stream/3 instead -- it has identical semantics.
-:- pragma obsolete(io__current_input_stream/3).
-:- pred io__current_input_stream(io__input_stream::out, io::di, io::uo) is det.
-
-    % Use io__output_stream/3 instead -- it has identical semantics.
-:- pragma obsolete(io__current_output_stream/3).
-:- pred io__current_output_stream(io__output_stream::out, io::di, io::uo)
-    is det.
-
-    % Use io__binary_input_stream/3 instead -- it has identical semantics.
-:- pragma obsolete(io__current_binary_input_stream/3).
-:- pred io__current_binary_input_stream(io__binary_input_stream::out,
-    io::di, io::uo) is det.
-
-    % Use io__binary_output_stream/3 instead -- it has identical semantics.
-:- pragma obsolete(io__current_binary_output_stream/3).
-:- pred io__current_binary_output_stream(io__binary_output_stream::out,
-    io::di, io::uo) is det.
-
-    % io__tmpnam(Name, !IO) binds `Name' to a temporary file name
-    % which is different to the name of any existing file.
-    % It will reside in /tmp if the TMPDIR environment variable
-    % is not set, or in the directory specified by TMPDIR if it is set.
-    % Use of this predicate is deprecated, because it may
-    % result in race conditions.  Use io__make_temp/3 instead.
-    %
-:- pragma obsolete(io__tmpnam/3). % use io__make_temp/3 instead
-:- pred io__tmpnam(string::out, io::di, io::uo) is det.
-
-    % io__tmpnam(Dir, Prefix, Name, !IO) binds `Name' to a
-    % temporary file name which is different to the name of any
-    % existing file. It will reside in the directory specified by
-    % `Dir' and have a prefix using up to the first 5 characters
-    % of `Prefix'.
-    % Use of this predicate is deprecated, because it may
-    % result in race conditions.  Use io__make_temp/5 instead.
-    %
-:- pragma obsolete(io__tmpnam/5). % use io__make_temp/5 instead
-:- pred io__tmpnam(string::in, string::in, string::out, io::di, io::uo) is det.
-
-    % Write complete memory usage statistics to stderr,
-    % including information about all procedures and types.
-    % (You need to compile with memory profiling enabled.)
-    %
-    % OBSOLETE: call io__report_stats/3 instead, with the first argument
-    % specified as "full_memory_stats".
-    %
-:- pragma obsolete(io__report_full_memory_stats/2).
-:- pred io__report_full_memory_stats(io::di, io::uo) is det.
-
-%-----------------------------------------------------------------------------%
 %-----------------------------------------------------------------------------%

 :- implementation.
@@ -4764,9 +4706,6 @@
 io__report_stats(!IO) :-
     io__report_stats("standard", !IO).

-io__report_full_memory_stats(!IO) :-
-    io__report_stats("full_memory_stats", !IO).
-
 :- pragma promise_pure(io__report_stats/3).

 io__report_stats(Selector, !IO) :-
@@ -7041,15 +6980,6 @@
     MR_update_io(IO0, IO);
 }").

-current_input_stream(S, !IO) :-
-    input_stream(S, !IO).
-current_output_stream(S, !IO) :-
-    output_stream(S, !IO).
-current_binary_input_stream(S, !IO) :-
-    binary_input_stream(S, !IO).
-current_binary_output_stream(S, !IO) :-
-    binary_output_stream(S, !IO).
-
 :- pragma foreign_proc("C",
     io__set_input_stream(NewStream::in, OutStream::out, IO0::di, IO::uo),
     [will_not_call_mercury, promise_pure, tabled_for_io],
@@ -7950,17 +7880,7 @@
         ""io__putenv/1 not implemented for Java: "" + VarAndValue);
 ").

-/*---------------------------------------------------------------------------*/
-
-io__tmpnam(Name, !IO) :-
-    io__make_temp(Name, !IO),
-    io__remove_file(Name, _Result, !IO).
-
-io__tmpnam(Dir, Prefix, Name, !IO) :-
-    io__make_temp(Dir, Prefix, Name, !IO),
-    io__remove_file(Name, _Result, !IO).
-
-/*---------------------------------------------------------------------------*/
+%-----------------------------------------------------------------------------%

     % We need to do an explicit check of TMPDIR because not all
     % systems check TMPDIR for us (eg Linux #$%*@&).
Index: library/list.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/list.m,v
retrieving revision 1.142
diff -u -r1.142 list.m
--- library/list.m	17 Oct 2005 11:35:18 -0000	1.142
+++ library/list.m	14 Nov 2005 07:50:46 -0000
@@ -339,7 +339,7 @@
     % list__index*(List, Position, Elem):
     %
     % These predicates select an element in a list from it's position.
-    % The `index0' preds consider the first element element to be element
+    % The `index0' preds consider the first element to be element
     % number zero, whereas the `index1' preds consider the first element
     % to be element number one. The `_det' preds call error/1 if the index
     % is out of range, whereas the semidet preds fail if the index is out of
Index: library/ops.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/ops.m,v
retrieving revision 1.56
diff -u -r1.56 ops.m
--- library/ops.m	17 Oct 2005 11:35:18 -0000	1.56
+++ library/ops.m	14 Nov 2005 07:48:16 -0000
@@ -110,7 +110,7 @@
     % constructed with an operator are allowed to take.
     % `f' represents the operator and `x' and `y' represent arguments.
     % `x' represents an argument whose priority must be
-    % strictly lower that that of the operator.
+    % strictly lower than that of the operator.
     % `y' represents an argument whose priority is
     % lower or equal to that of the operator.
     % For example, `yfx' indicates a left-associative infix operator,
Index: library/set_bbbtree.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/set_bbbtree.m,v
retrieving revision 1.27
diff -u -r1.27 set_bbbtree.m
--- library/set_bbbtree.m	17 Oct 2005 11:35:20 -0000	1.27
+++ library/set_bbbtree.m	14 Nov 2005 07:47:50 -0000
@@ -176,7 +176,7 @@
 :- func set_bbbtree__from_sorted_list(list(T)) = set_bbbtree(T).

     % `set_bbbtree__sorted_list_to_set_len(List, Set, N)' is true iff
-    % `Set' is the set set containing only the members of `List' and `N'
+    % `Set' is the set containing only the members of `List' and `N'
     % is the length of the list. If the length of the list is already known
     % then a noticeable speed improvement can be expected over
     % `set_bbbtree__sorted_list_to_set' as a significant cost involved
@@ -591,7 +591,7 @@
 %------------------------------------------------------------------------------%

 % The tree is created by first determining it's length. All lists of length
-% N have the same structure. The root of of the tree is the N // 2 element
+% N have the same structure. The root of the tree is the N // 2 element
 % of the list. Elements 1 to N // 2 - 1 make up the left subtree and elements
 % N // 2 + 1 to N make up the right subtree. The structure, which is known
 % due to the length of the list, is just created inorder while passing the
@@ -1038,7 +1038,7 @@
     ;
         set_bbbtree__size(R, RSize),
         ( RSize = 0 ->
-            % Right tree empty so just just return the left tree.
+            % Right tree empty so just return the left tree.
             Set = L
         ;
             % If the left tree is the larger of the two then
Index: library/term_to_xml.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/term_to_xml.m,v
retrieving revision 1.9
diff -u -r1.9 term_to_xml.m
--- library/term_to_xml.m	17 Oct 2005 11:35:21 -0000	1.9
+++ library/term_to_xml.m	14 Nov 2005 07:55:36 -0000
@@ -413,7 +413,7 @@
 	% ElementMapping as the scheme to map functors to elements.
 	% MaybeStyleSheet and MaybeDTD specify whether or not a stylesheet
 	% reference and/or a DTD should be included.  Any non-canonical terms
-	% will be be written out in full.  If an embedded DTD is requested, but
+	% will be written out in full.  If an embedded DTD is requested, but
 	% it is not possible to generate a DTD for Term using ElementMapping,
 	% then a value other than `ok' is returned in DTDResult and nothing is
 	% written out.  See the dtd_generation_result type for a list of the
@@ -709,10 +709,6 @@
 :- pred make_unique_element(type_desc.type_desc::in, maybe_functor_info::in,
 	string::out, list(attr_from_source)::out) is det.

-% XXX This should be uncommented once memoing can be switched off for grades
-% which don't support it.
-% :- pragma memo(make_unique_element/4).
-
 make_unique_element(TypeDesc, du_functor(Functor, Arity), Element,
 		all_attr_sources) :-
 	(
@@ -747,10 +743,6 @@
 :- pred make_simple_element(type_desc.type_desc::in, maybe_functor_info::in,
 	string::out, list(attr_from_source)::out) is det.

-% XXX This should be uncommented once memoing can be switched off for grades
-% which don't support it.
-% :- pragma memo(make_simple_element/4).
-
 make_simple_element(_, du_functor(Functor, _), Element, all_attr_sources) :-
 	(
 		common_mercury_functor(Functor, ReservedElement)
@@ -902,16 +894,12 @@
 	list(maybe(int))::out, list(list(type_desc.pseudo_type_desc))::out,
 	list(list(attr_from_source))::out) is det.

-% XXX This should be uncommented once memoing can be switched off for grades
-% which don't support it.
-% :- pragma memo(get_elements_and_args/7).
-
 get_elements_and_args(MakeElement, TypeDesc, Elements, MaybeFunctors,
 		MaybeArities, ArgTypeLists, AttributeLists) :-
 	(
 		is_discriminated_union(TypeDesc, NumFunctors)
 	->
-		FunctorNums = 0 `..` (NumFunctors - 1),
+		FunctorNums = 0 .. (NumFunctors - 1),
 		(
 			list.map3(construct.get_functor(TypeDesc), FunctorNums,
 				Functors, Arities, ArgTypeLists0)
@@ -1157,15 +1145,11 @@
 :- func get_field_names(type_desc.type_desc, string, int)
 	= list(maybe(string)).

-% XXX This should be uncommented once memoing can be switched off for grades
-% which don't support it.
-% :- pragma memo(get_field_names/3).
-
 get_field_names(TypeDesc, Functor, Arity) = MaybeFields :-
 	(
 		is_discriminated_union(TypeDesc, NumFunctors)
 	->
-		FunctorNums = 0`..`(NumFunctors - 1),
+		FunctorNums = 0 .. (NumFunctors - 1),
 		(
 			find_field_names(TypeDesc, FunctorNums, Functor,
 				Arity, FoundMaybeFields)

--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list