for review: changes to library/map.m

Fergus Henderson fjh at cs.mu.OZ.AU
Wed Oct 21 05:45:02 AEST 1998


Hi,

Zoltan, can you please review these changes?

--------------------

Estimated Hours Taken: 0.5

library/map.m:
	Fix a cut-and-paste error in the comment for map__det_union where
	it was referring to map__insert instead map__union.
	Delete the error message argument from map__det_union
	and map__det_insert, for consistency with other det_* predicates,
	and to make them easier to use.

Index: library/map.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/map.m,v
retrieving revision 1.66
diff -u -r1.66 map.m
--- map.m	1998/10/20 02:02:05	1.66
+++ map.m	1998/10/20 19:39:33
@@ -212,12 +212,9 @@
 :- mode map__intersect(pred(in, in, out) is semidet, in, in, out) is semidet.
 :- mode map__intersect(pred(in, in, out) is det, in, in, out) is det.
 
-	% Calls map__intersect. Aborts (with the last argument as the message)
-	% if map__intersect fails.
-:- pred map__det_intersect(pred(V, V, V), map(K, V), map(K, V), map(K, V),
-	string).
-:- mode map__det_intersect(pred(in, in, out) is semidet, in, in, out, in)
-	is det.
+	% Calls map__intersect. Aborts if map__intersect fails.
+:- pred map__det_intersect(pred(V, V, V), map(K, V), map(K, V), map(K, V)).
+:- mode map__det_intersect(pred(in, in, out) is semidet, in, in, out) is det.
 
 	% Given two maps M1 and M2, create a third map M3 that all the keys
 	% that occur in either M1 and M2. For keys that occur in both M1
@@ -229,10 +226,9 @@
 :- mode map__union(pred(in, in, out) is semidet, in, in, out) is semidet.
 :- mode map__union(pred(in, in, out) is det, in, in, out) is det.
 
-	% Calls map__union. Aborts (with the last argument as the message)
-	% if map__intersect fails.
-:- pred map__det_union(pred(V, V, V), map(K, V), map(K, V), map(K, V), string).
-:- mode map__det_union(pred(in, in, out) is semidet, in, in, out, in) is det.
+	% Calls map__union. Aborts if map__union fails.
+:- pred map__det_union(pred(V, V, V), map(K, V), map(K, V), map(K, V)).
+:- mode map__det_union(pred(in, in, out) is semidet, in, in, out) is det.
 
 %-----------------------------------------------------------------------------%
 
@@ -532,11 +528,11 @@
 		)
 	).
 
-map__det_intersect(CommonPred, Map1, Map2, Common, Msg) :-
+map__det_intersect(CommonPred, Map1, Map2, Common) :-
 	( map__intersect(CommonPred, Map1, Map2, CommonPrime) ->
 		Common = CommonPrime
 	;
-		error(Msg)
+		error("map__det_intersect: map__intersect failed")
 	).
 
 %-----------------------------------------------------------------------------%
@@ -590,11 +586,11 @@
 		)
 	).
 
-map__det_union(CommonPred, Map1, Map2, Union, Msg) :-
+map__det_union(CommonPred, Map1, Map2, Union) :-
 	( map__union(CommonPred, Map1, Map2, UnionPrime) ->
 		Union = UnionPrime
 	;
-		error(Msg)
+		error("map__det_union: map__union failed")
 	).
 
 %-----------------------------------------------------------------------------%

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>  |  of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3        |     -- the last words of T. S. Garp.



More information about the developers mailing list