[m-rev.] trivial diff: bug fix in extras

Mark Brown mark at cs.mu.OZ.AU
Tue Dec 13 01:01:02 AEDT 2005


Estimated hours taken: 0.1
Branches: main

extras/solver_types/library/any_list.m:
	Fix a bug in the implementation of any_list.index0/3.

Index: extras/solver_types/library/any_list.m
===================================================================
RCS file: /home/mercury1/repository/mercury/extras/solver_types/library/any_list.m,v
retrieving revision 1.3
diff -u -r1.3 any_list.m
--- extras/solver_types/library/any_list.m	15 Nov 2005 03:37:57 -0000	1.3
+++ extras/solver_types/library/any_list.m	12 Dec 2005 13:56:30 -0000
@@ -750,7 +750,7 @@
 :- pred index0(any_list(T)::ia, int::in, T::oa) is semidet.
 
 index0([X | Xs], N, Y) :-
-    ( if N = 0 then Y = X else index0(Xs, N, Y) ).
+    ( if N = 0 then Y = X else index0(Xs, N - 1, Y) ).
 
 index1_det(List, N) = index0_det(List, N - 1).
 
--------------------------------------------------------------------------
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