[m-dev.] list__merge_and_remove_dups
Fergus Henderson
fjh at cs.mu.oz.au
Mon Feb 10 14:05:19 AEDT 1997
Christopher Rodd SPEIRS, you wrote:
>
> I was looking through list.m, and noticed a bug in
> list__merge_and_remove_dups. I am not sure what the correct behaviour should
> be, but the current behaviour seems wrong.
>
> Currently, list__merge_and_remove_dups runs as follows:
> list__merge_and_remove_dups([1,1,1], [1,1,2], [1,1,2]).
> list__merge_and_remove_dups([1,1,2], [1,1,1], [1,1,1,2]).
I consider it a bug in the documentation. Here's my suggested fix.
Index: list.m
===================================================================
RCS file: /home/staff/zs/imp/mercury/library/list.m,v
retrieving revision 1.64
diff -u -r1.64 list.m
--- list.m 1996/10/24 05:57:42 1.64
+++ list.m 1997/02/10 02:59:09
@@ -92,7 +92,8 @@
% list__merge_and_remove_dups(L1, L2, L):
% L is the result of merging L1 and L2 and eliminating
% any duplicates.
- % L1 and L2 must be sorted.
+ % L1 and L2 must be sorted and must each not contain any
+ % duplicates.
:- pred list__merge_and_remove_dups(list(T), list(T), list(T)).
:- mode list__merge_and_remove_dups(in, in, out) is det.
--
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