[m-rev.] diff: Clarify behaviour of list.find_index_of_match.

Peter Wang novalazy at gmail.com
Fri Jun 16 14:57:19 AEST 2017


Not sure why the user can't just add Index0 but anyway.

---

library/list.m:
    Clarify meaning of Index0 parameter in list.find_index_of_match.

diff --git a/library/list.m b/library/list.m
index 8209442..e696564 100644
--- a/library/list.m
+++ b/library/list.m
@@ -782,8 +782,9 @@
 
     % find_index_of_match(Match, List, Index0, Index)
     %
-    % Find the index of an item in the list for which Match is true where the
-    % first element in the list has the index Index0.
+    % Find the index of the first item in List for which Match is true,
+    % where the first element in the list has the index Index0.
+    % (Index0 is *not* the number of items to skip at the head of List.)
     %
 :- pred find_index_of_match(pred(T), list(T), int, int).
 :- mode find_index_of_match(pred(in) is semidet, in, in, out) is semidet.
-- 
2.9.0



More information about the reviews mailing list