[m-rev.] for review: fix construct__get_functor/6

Simon Taylor stayl at cs.mu.OZ.AU
Fri Nov 22 02:32:34 AEDT 2002


On 22-Nov-2002, Fergus Henderson <fjh at cs.mu.OZ.AU> wrote:
> That looks fine now.
> 
> > --- tests/hard_coded/construct_test.m	30 Jan 2002 05:09:09 -0000	1.1
> > +++ tests/hard_coded/construct_test.m	21 Nov 2002 08:20:59 -0000
> > @@ -26,8 +26,8 @@
> >  
> >  :- type enum	--->	one	;	two	;	three.
> >  
> > -:- type fruit	--->	apple(list(int))
> > -		;	banana(list(enum)).
> > +:- type fruit	--->	apple(apple_list :: list(int))
> > +		;	banana(banana_list :: list(enum)).
> 
> It might be worth also testing the case where some but not all of the
> fields have field names, if this is not tested already.

Estimated hours taken: 0.2
Branches: main, release

tests/hard_coded/construct_test.{m,exp}:
	Test the case where only some of the fields of a
	constructor are named.

Index: construct_test.exp
===================================================================
RCS file: /home/mercury1/repository/tests/hard_coded/construct_test.exp,v
retrieving revision 1.2
diff -u -u -r1.2 construct_test.exp
--- construct_test.exp	21 Nov 2002 15:14:44 -0000	1.2
+++ construct_test.exp	21 Nov 2002 15:29:16 -0000
@@ -101,21 +101,21 @@
 TESTING POLYMORPHISM
 4 functors in this type
 3 - poly_two/1 [_]
-2 - poly_three/3 [_, _, _]
+2 - poly_three/3 [_, poly3_field2, _]
 1 - poly_one/1 [_]
 0 - poly_four/2 [_, _]
 
 
 4 functors in this type
 3 - poly_two/1 [_]
-2 - poly_three/3 [_, _, _]
+2 - poly_three/3 [_, poly3_field2, _]
 1 - poly_one/1 [_]
 0 - poly_four/2 [_, _]
 
 
 4 functors in this type
 3 - poly_two/1 [_]
-2 - poly_three/3 [_, _, _]
+2 - poly_three/3 [_, poly3_field2, _]
 1 - poly_one/1 [_]
 0 - poly_four/2 [_, _]
 
Index: construct_test.m
===================================================================
RCS file: /home/mercury1/repository/tests/hard_coded/construct_test.m,v
retrieving revision 1.2
diff -u -u -r1.2 construct_test.m
--- construct_test.m	21 Nov 2002 15:14:45 -0000	1.2
+++ construct_test.m	21 Nov 2002 15:28:23 -0000
@@ -35,7 +35,7 @@
 			zop(float, float).
 
 :- type poly(A, B)	--->	poly_one(A) ; poly_two(B) ; 
-				poly_three(B, A, poly(B, A));
+				poly_three(B, poly3_field2 :: A, poly(B, A));
 				poly_four(A, B).
 
 :- type no_tag		---> 	qwerty(qwerty_field :: int).
--------------------------------------------------------------------------
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