[m-rev.] diff: remove obsolete predicates

Julien Fischer juliensf at csse.unimelb.edu.au
Wed Sep 27 17:26:47 AEST 2006


Estimated hours taken: 0.1
Branches: main

Delete library predicates that were marked as obsolete prior to the 0.12
release.

library/int.m:
library/integer.m:
library/rational.m:
library/rbtree.m:
 	Delete some obsolete predicates.

Julien.

Index: library/int.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/library/int.m,v
retrieving revision 1.114
diff -u -r1.114 int.m
--- library/int.m	19 Apr 2006 05:17:52 -0000	1.114
+++ library/int.m	26 Sep 2006 08:23:12 -0000
@@ -62,12 +62,6 @@
  :- func int.min(int, int) = int.
  :- pred int.min(int::in, int::in, int::out) is det.

-    % conversion of integer to floating point
-    % OBSOLETE: use float.float/1 instead.
-    %
-:- pragma obsolete(int.to_float/2).
-:- pred int.to_float(int::in, float::out) is det.
-
      % exponentiation
      % int.pow(X, Y, Z): Z is X raised to the Yth power
      % Throws a `math.domain_error' exception if Y is negative.
@@ -611,27 +605,6 @@

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

-:- pragma foreign_proc("C",
-    int.to_float(IntVal::in, FloatVal::out),
-    [will_not_call_mercury, promise_pure, thread_safe, will_not_modify_trail],
-"
-    FloatVal = IntVal;
-").
-:- pragma foreign_proc("C#",
-    int.to_float(IntVal::in, FloatVal::out),
-    [will_not_call_mercury, promise_pure, thread_safe],
-"
-    FloatVal = (double) IntVal;
-").
-:- pragma foreign_proc("Java",
-    int.to_float(IntVal::in, FloatVal::out),
-    [will_not_call_mercury, promise_pure, thread_safe],
-"
-    FloatVal = (double) IntVal;
-").
-
-%-----------------------------------------------------------------------------%
-
  :- pragma foreign_decl("C", "
      #include <limits.h>

Index: library/integer.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/library/integer.m,v
retrieving revision 1.25
diff -u -r1.25 integer.m
--- library/integer.m	27 Sep 2006 06:16:39 -0000	1.25
+++ library/integer.m	27 Sep 2006 06:36:54 -0000
@@ -81,8 +81,6 @@
  :- func integer.abs(integer) = integer.

  :- func integer.pow(integer, integer) = integer.
-:- pragma obsolete(integer.pow/3).
-:- pred integer.pow(integer::in, integer::in, integer::out) is det.

  :- func integer.float(integer) = float.
  :- func integer.int(integer) = int.
@@ -907,8 +905,6 @@
      C = pos_cmp(Xs, Ys),
      ( C = (>) ; C = (=) ).

-integer.pow(A, N, integer.pow(A, N)).
-
  integer.pow(A, N) = P :-
      ( big_isnegative(N) ->
          error("integer.pow: negative exponent")
Index: library/rational.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/library/rational.m,v
retrieving revision 1.12
diff -u -r1.12 rational.m
--- library/rational.m	19 Apr 2006 05:17:55 -0000	1.12
+++ library/rational.m	26 Sep 2006 08:21:35 -0000
@@ -41,10 +41,6 @@

  :- func rational.from_integers(integer, integer) = rational.

-    % New programs should use rational.from_integers/2.
-:- pragma obsolete(rational_from_integers/2).
-:- func rational.rational_from_integers(integer, integer) = rational.
-
  % :- func float(rational) = float.

  :- func '+'(rational) = rational.
@@ -121,8 +117,6 @@

  rational.from_integers(Num, Den) = rational_norm(Num, Den).

-rational_from_integers(Num, Den) = rational_norm(Num, Den).
-
  %% XXX: There are ways to do this in some cases even if the
  %% float conversions would overflow.
  % rational.float(r(Num, Den)) =
Index: library/rbtree.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/library/rbtree.m,v
retrieving revision 1.26
diff -u -r1.26 rbtree.m
--- library/rbtree.m	19 Apr 2006 05:17:55 -0000	1.26
+++ library/rbtree.m	26 Sep 2006 08:22:05 -0000
@@ -142,13 +142,6 @@
  :- pred rbtree.remove(rbtree(K, V)::in, K::in, V::out,
      rbtree(K, V)::out) is semidet.

-    % Same as above, except this version does not return the value
-    % corresponding to the key.  Its use is deprecated, but it is
-    % kept for compatibility with older versions of this library.
-    %
-:- pragma obsolete(rbtree.remove/3).
-:- pred rbtree.remove(rbtree(K, V)::in, K::in, rbtree(K, V)::out) is semidet.
-
      % Deletes the node with the minimum key from the tree,
      % and returns the key and value fields.
      %
@@ -886,9 +879,6 @@
  rbtree.remove(Tree0, K, V, Tree) :-
      rbtree.delete_2(Tree0, K, yes, yes(V), Tree).

-rbtree.remove(Tree0, K, Tree) :-
-    rbtree.remove(Tree0, K, _, Tree).
-
  rbtree.remove_largest(empty, _K, _V, _Tree) :-
      fail.
  rbtree.remove_largest(red(K0, V0, L, R), NewK, NewV, Tree) :-

--------------------------------------------------------------------------
mercury-reviews mailing list
Post messages to:       mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions:          mercury-reviews-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the reviews mailing list