[m-rev.] For review: library/sparse_bitset cleanup

Fergus Henderson fjh at cs.mu.OZ.AU
Thu Jan 15 16:17:22 AEDT 2004


On 15-Jan-2004, James Goddard <goddardjames at yahoo.com> wrote:
> 
> Removed a function declaration from the sparse_bitset implementation.
> 
> library/sparse_bitset.m:
> 	Removed the function declaration for sparse_bitset.foldr_2/3 from the
> 	implementation, since the function is not called by anything and
> 	causes a compile warning.

I am going to commit a slightly different patch:

Estimated hours taken: 0.25
Branches: main

library/sparse_bitset.m:
	Delete declaration for unimplemented function foldr_2/3.
	Use pragma type_spec declarations for predicate foldr_2/4
	rather than function foldr_2/3.

Index: sparse_bitset.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/sparse_bitset.m,v
retrieving revision 1.18
diff -u -d -u -r1.18 sparse_bitset.m
--- sparse_bitset.m	22 Dec 2003 11:21:48 -0000	1.18
+++ sparse_bitset.m	14 Jan 2004 06:03:55 -0000
@@ -412,10 +412,6 @@
 			Acc2 = F(E, Acc1)
 		), Set, Acc0, Acc).
 
-:- func foldr_2(func(T, U) = U, bitset_impl, U) = U <= enum(T).
-:- pragma type_spec(foldr_2/3, T = int).
-:- pragma type_spec(foldr_2/3, T = var(_)).
-
 :- pred foldr_2(pred(T, U, U), bitset_impl, U, U) <= enum(T).
 :- mode foldr_2(pred(in, in, out) is det, in, in, out) is det.
 :- mode foldr_2(pred(in, di, uo) is det, in, di, uo) is det.
@@ -423,6 +419,8 @@
 :- mode foldr_2(pred(in, in, out) is nondet, in, in, out) is nondet.
 :- mode foldr_2(pred(in, di, uo) is cc_multi, in, di, uo) is cc_multi.
 :- mode foldr_2(pred(in, in, out) is cc_multi, in, in, out) is cc_multi.
+:- pragma type_spec(foldr_2/4, T = int).
+:- pragma type_spec(foldr_2/4, T = var(_)).
 
 	% We don't just use list__foldr here because the
 	% overhead of allocating the closure for fold_bits

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
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