[m-dev.] for review: fix tuple type printing bug.

Tyson Dowd trd at cs.mu.OZ.AU
Thu Dec 14 17:34:36 AEDT 2000


On 13-Dec-2000, Simon Taylor <stayl at cs.mu.OZ.AU> wrote:
> > Index: library/std_util.m
> > ===================================================================
> > @@ -1513,7 +1513,13 @@
> >  				UnqualifiedTypeName)
> >  		;
> >  			type_arg_names(ArgTypes, IsFunc, ArgTypeNames),
> > -			string__append_list([Name, "(" | ArgTypeNames],
> > +			( IsFunc = yes ->
> > +				list__append(ArgTypeNames, [")"], TypeStrings0)
> > +			;
> > +				TypeStrings0 = ArgTypeNames
> > +			),
> > +			TypeNameStrings = [Name, "(" | TypeStrings0],
> > +			string__append_list(TypeNameStrings,
> >  				UnqualifiedTypeName)
> >  		)
> >  	),
> 
> That test should be `IsFunc = no'.

Good spotting -- I hadn't finished my bootcheck yet.

Here's the incremental diff.  I added a test for the bug above to the test 
case, and also fixed a bug in the test case for construct.


diff -u library/std_util.m library/std_util.m
--- library/std_util.m
+++ library/std_util.m
@@ -1513,7 +1513,7 @@
 				UnqualifiedTypeName)
 		;
 			type_arg_names(ArgTypes, IsFunc, ArgTypeNames),
-			( IsFunc = yes ->
+			( IsFunc = no ->
 				list__append(ArgTypeNames, [")"], TypeStrings0)
 			;
 				TypeStrings0 = ArgTypeNames
diff -u write_reg2.exp write_reg2.exp
--- write_reg2.exp
+++ write_reg2.exp
@@ -1 +1,2 @@
+univ(1 - 2 : std_util:pair(int, int))
 univ({1, 2, 3} : {int, int, int})
diff -u write_reg2.m write_reg2.m
--- write_reg2.m
+++ write_reg2.m
@@ -18,5 +18,7 @@
 :- import_module std_util.
 
 main -->
+	io__write(univ((1 - 2))),
+	io__nl,
 	io__write(univ({1,2,3})),
 	io__nl.
only in patch2:
--- tests/hard_coded/construct.exp	2000/09/18 11:52:41	1.5
+++ tests/hard_coded/construct.exp	2000/12/14 05:55:38
@@ -227,4 +227,4 @@
 About to construct {}/3
 Constructed: {4, "five", '6'}
 About to call construct_tuple
-Constructed tuple: univ({[1, 2, 3], [one, two, three], 1, 2.10000000000000} : {list:list(int), list:list(construct:enum), int, float)})
+Constructed tuple: univ({[1, 2, 3], [one, two, three], 1, 2.10000000000000} : {list:list(int), list:list(construct:enum), int, float})

-- 
       Tyson Dowd           # 
                            #  Surreal humour isn't everyone's cup of fur.
     trd at cs.mu.oz.au        # 
http://www.cs.mu.oz.au/~trd #
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list