[m-rev.] diff: Make pointer_equals/2 pure.

Paul Bone paul at bone.id.au
Tue May 28 11:26:31 AEST 2013


Make pointer_equals/2 pure.

library/version_hash_table.m:
    As above.
---
 library/version_hash_table.m | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/library/version_hash_table.m b/library/version_hash_table.m
index fdd0476..b2765c2 100644
--- a/library/version_hash_table.m
+++ b/library/version_hash_table.m
@@ -858,8 +858,7 @@ fold_p(P, List, !A) :-
 %-----------------------------------------------------------------------------%
 
 equals(A, B) :-
-    promise_pure
-    ( semipure pointer_equals(A, B) ->
+    ( pointer_equals(A, B) ->
         true
     ;
         % We cannot deconstruct a non-cononical type in this all-solutions
@@ -880,25 +879,25 @@ equals(A, B) :-
 compare_item(Table, K, V, unit, unit) :-
     search(Table, K, V).
 
-:- semipure pred pointer_equals(T::in, T::in) is semidet.
+:- pred pointer_equals(T::in, T::in) is semidet.
 :- pragma inline(pointer_equals/2).
 
 :- pragma foreign_proc("C", pointer_equals(A::in, B::in),
-    [promise_semipure, thread_safe, will_not_call_mercury,
+    [promise_pure, thread_safe, will_not_call_mercury,
         will_not_throw_exception, terminates],
 "
     SUCCESS_INDICATOR = (A == B);
 ").
 
 :- pragma foreign_proc("Java", pointer_equals(A::in, B::in),
-    [promise_semipure, thread_safe, will_not_call_mercury,
+    [promise_pure, thread_safe, will_not_call_mercury,
         will_not_throw_exception, terminates],
 "
     SUCCESS_INDICATOR = (A == B);
 ").
 
 :- pragma foreign_proc("C#", pointer_equals(A::in, B::in),
-    [promise_semipure, thread_safe, will_not_call_mercury,
+    [promise_pure, thread_safe, will_not_call_mercury,
         will_not_throw_exception, terminates],
 "
     SUCCESS_INDICATOR = System.Object.ReferenceEquals(A, B);
-- 
1.8.1.3




More information about the reviews mailing list