diff: merge_and_remove_dups.

Tyson Dowd trd at cs.mu.OZ.AU
Mon Sep 21 23:11:11 AEST 1998


Hi,

Here's a bug fix for merge_and_remove_dups.

===================================================================


Estimated hours taken: 0.5

general/Mmakefile:
general/merge_and_remove_dups.exp:
general/merge_and_remove_dups.m:
hard_coded/Mmakefile:
hard_coded/merge_and_remove_dups.exp:
hard_coded/merge_and_remove_dups.m:
	Move merge_and_remove_dups from general to hard_coded, because
	NU-Prolog thinks the list of ints is a list of ASCII characters,
	and so outputs a different result.


Index: general/Mmakefile
===================================================================
RCS file: /home/mercury1/repository/tests/general/Mmakefile,v
retrieving revision 1.22
diff -u -r1.22 Mmakefile
--- Mmakefile	1998/09/15 07:49:42	1.22
+++ Mmakefile	1998/09/21 12:48:46
@@ -37,7 +37,6 @@
 		interpreter \
 		liveness \
 		liveness2 \
-		merge_and_remove_dups \
 		mode_inf \
 		mode_inf_bug \
 		mu \
Index: general/merge_and_remove_dups.exp
===================================================================
RCS file: merge_and_remove_dups.exp
diff -N merge_and_remove_dups.exp
--- /tmp/cvs25207baa	Mon Sep 21 23:05:43 1998
+++ /dev/null	Wed May 28 10:49:58 1997
@@ -1,3 +0,0 @@
-List1: [1, 2, 3]
-List2: [3, 4, 5]
-List3: [1, 2, 3, 4, 5]
Index: general/merge_and_remove_dups.m
===================================================================
RCS file: merge_and_remove_dups.m
diff -N merge_and_remove_dups.m
--- /tmp/cvs25207caa	Mon Sep 21 23:05:44 1998
+++ /dev/null	Wed May 28 10:49:58 1997
@@ -1,39 +0,0 @@
-%
-% A regression test.  Make sure list__merge_and_remove_dups works.
-%
-% The Mercury library of September 15th, 1998 failed this test.
-%
-% Peter Herkenrath <aik01 at rrz.uni-koeln.de> sent this one in.
-
-:- module merge_and_remove_dups.
-
-:- interface.
-
-:- pred main(io:state::di, io:state::uo) is det.
-
-:- implementation.
-
-:- import_module list, io.
-
-main -->
-        { List1 = [1,2,3],
-          List2 = [3,4,5],
-          P = lambda([I1::in,I2::in,R::out] is det,
-                         (compare(R,I1,I2)) ),
-          list__merge_and_remove_dups(P,List1,List2,List3) },
-        io__write_string("List1: "),
-        io__print(List1),
-        io__write_string("\nList2: "),
-        io__print(List2),
-        io__write_string("\nList3: "),
-        io__print(List3),
-        io__write_string("\n").
-
-%Output:
-%List1: [1, 2, 3]
-%List2: [3, 4, 5]
-%List3: [1, 2, 3, 3, 4, 5]
-%              !  !
-
-
-
Index: hard_coded/Mmakefile
===================================================================
RCS file: /home/mercury1/repository/tests/hard_coded/Mmakefile,v
retrieving revision 1.39
diff -u -r1.39 Mmakefile
--- Mmakefile	1998/08/26 07:51:56	1.39
+++ Mmakefile	1998/09/21 12:49:05
@@ -50,6 +50,7 @@
 	ho_univ_to_type \
 	impossible_unify \
 	integer_test \
+	merge_and_remove_dups \
 	minint_bug \
 	mode_choice \
 	name_mangling \
Index: hard_coded/merge_and_remove_dups.exp
===================================================================
RCS file: merge_and_remove_dups.exp
diff -N merge_and_remove_dups.exp
--- /dev/null	Wed May 28 10:49:58 1997
+++ merge_and_remove_dups.exp	Tue Sep 15 16:58:55 1998
@@ -0,0 +1,3 @@
+List1: [1, 2, 3]
+List2: [3, 4, 5]
+List3: [1, 2, 3, 4, 5]
Index: hard_coded/merge_and_remove_dups.m
===================================================================
RCS file: merge_and_remove_dups.m
diff -N merge_and_remove_dups.m
--- /dev/null	Wed May 28 10:49:58 1997
+++ merge_and_remove_dups.m	Tue Sep 15 16:57:17 1998
@@ -0,0 +1,39 @@
+%
+% A regression test.  Make sure list__merge_and_remove_dups works.
+%
+% The Mercury library of September 15th, 1998 failed this test.
+%
+% Peter Herkenrath <aik01 at rrz.uni-koeln.de> sent this one in.
+
+:- module merge_and_remove_dups.
+
+:- interface.
+
+:- pred main(io:state::di, io:state::uo) is det.
+
+:- implementation.
+
+:- import_module list, io.
+
+main -->
+        { List1 = [1,2,3],
+          List2 = [3,4,5],
+          P = lambda([I1::in,I2::in,R::out] is det,
+                         (compare(R,I1,I2)) ),
+          list__merge_and_remove_dups(P,List1,List2,List3) },
+        io__write_string("List1: "),
+        io__print(List1),
+        io__write_string("\nList2: "),
+        io__print(List2),
+        io__write_string("\nList3: "),
+        io__print(List3),
+        io__write_string("\n").
+
+%Output:
+%List1: [1, 2, 3]
+%List2: [3, 4, 5]
+%List3: [1, 2, 3, 3, 4, 5]
+%              !  !
+
+
+


-- 
       Tyson Dowd           # There isn't any reason why Linux can't be
                            # implemented as an enterprise computing solution.
     trd at cs.mu.oz.au        # Find out what you've been missing while you've
http://www.cs.mu.oz.au/~trd # been rebooting Windows NT. -- InfoWorld, 1998.



More information about the developers mailing list