[m-rev.] diff: delete some obsolete procedures

Julien Fischer jfischer at opturion.com
Sun Feb 2 02:05:36 AEDT 2020


Delete some obsolete procedures.

Delete some procedures that have been marked as obsolete since before the 14.01
release.

library/hash_table.m:
library/version_array.m:
     As above.

NEWS:
     Announce the deletions.

tests/hard_coded/hash_table_delete.m:
     Replace a call to one of the deleted functions.

Julien.

diff --git a/NEWS b/NEWS
index b0184c6..47c566a 100644
--- a/NEWS
+++ b/NEWS
@@ -4,6 +4,13 @@ NEWS since Mercury 20.01.x
  Changes to the Mercury standard library
  ---------------------------------------

+### Changes to the `hash_table` module
+
+* The following obsolete functions have been removed:
+
+    - func `new/3`
+    - func `new_default/1`
+
  ### Changes to the `map` module

  * The following function and predicate have been added:
@@ -11,6 +18,12 @@ Changes to the Mercury standard library
      - func `keys_as_set/1`
      - pred `keys_as_set/2`

+### Changes to the `version_array` module
+
+* The following obsolete function has been removed:
+
+    - func `unsafe_new/2`
+
  NEWS for Mercury 20.01
  ======================

diff --git a/library/hash_table.m b/library/hash_table.m
index 2ce30b8..5b412cd 100644
--- a/library/hash_table.m
+++ b/library/hash_table.m
@@ -2,7 +2,7 @@
  % vim: ts=4 sw=4 et ft=mercury
  %---------------------------------------------------------------------------%
  % Copyright (C) 2001, 2003-2006, 2010-2012 The University of Melbourne
-% Copyright (C) 2013-2018 The Mercury team.
+% Copyright (C) 2013-2020 The Mercury team.
  % This file is distributed under the terms specified in COPYING.LIB.
  %---------------------------------------------------------------------------%
  %
@@ -72,24 +72,12 @@
  :- func init(hash_pred(K), int, float) = hash_table(K, V).
  :- mode init(in(hash_pred), in, in) = hash_table_uo is det.

-    % A synonym for the above.
-    %
-:- pragma obsolete(new/3).
-:- func new(hash_pred(K), int, float) = hash_table(K, V).
-:- mode new(in(hash_pred), in, in) = hash_table_uo is det.
-
      % init_default(HashFn) constructs a hash table with default size and
      % occupancy arguments.
      %
  :- func init_default(hash_pred(K)) = hash_table(K, V).
  :- mode init_default(in(hash_pred)) = hash_table_uo is det.

-    % A synonym for the above.
-    %
-:- pragma obsolete(new_default/1).
-:- func new_default(hash_pred(K)) = hash_table(K, V).
-:- mode new_default(in(hash_pred)) = hash_table_uo is det.
-
  %---------------------------------------------------------------------------%

      % Retrieve the hash_pred associated with a hash table.
@@ -346,14 +334,11 @@ init(HashPred, N, MaxOccupancy) = HT :-
          HT = ht(0, MaxOccupants, HashPred, Buckets)
      ).

-new(HashPred, N, MaxOccupancy) = init(HashPred, N, MaxOccupancy).
-
  %---------------------------------------------------------------------------%

      % These numbers are picked out of thin air.
      %
  init_default(HashPred) = init(HashPred, 7, 0.9).
-new_default(HashPred) = init(HashPred, 7, 0.9).

  %---------------------------------------------------------------------------%

diff --git a/library/version_array.m b/library/version_array.m
index d4af865..9fe5e91 100644
--- a/library/version_array.m
+++ b/library/version_array.m
@@ -2,7 +2,7 @@
  % vim: ts=4 sw=4 et ft=mercury
  %---------------------------------------------------------------------------%
  % Copyright (C) 2004-2012 The University of Melbourne.
-% Copyright (C) 2014-2018 The Mercury Team.
+% Copyright (C) 2014-2020 The Mercury Team.
  % This file is distributed under the terms specified in COPYING.LIB.
  %---------------------------------------------------------------------------%
  %
@@ -98,11 +98,6 @@
      %
  :- func unsafe_init(int, T) = version_array(T).

-    % An obsolete synonym for the above.
-    %
-:- pragma obsolete(unsafe_new/2).
-:- func unsafe_new(int, T) = version_array(T).
-
      % version_array(Xs) returns an array constructed from the items in the list
      % Xs.
      %
@@ -435,8 +430,6 @@
      VA = ML_uva.init(N, X);
  ").

-unsafe_new(N, X) = unsafe_init(N, X).
-
  %---------------------------------------------------------------------------%

  version_array([]) = version_array.empty.
diff --git a/tests/hard_coded/hash_table_delete.m b/tests/hard_coded/hash_table_delete.m
index b9fde4c..9e7d80a 100644
--- a/tests/hard_coded/hash_table_delete.m
+++ b/tests/hard_coded/hash_table_delete.m
@@ -22,7 +22,7 @@

  main(!IO) :-
      some [!HT] (
-        !:HT = hash_table.new_default(generic_hash),
+        !:HT = hash_table.init_default(generic_hash),
          myfoldl(fill, keys, !HT),
          myfoldl(hash_table.delete, keys, !HT),
          Residue = hash_table.to_assoc_list(!.HT),


More information about the reviews mailing list