[m-dev.] for review: change typeclass_info structure

David Glen JEFFERY dgj at students.cs.mu.oz.au
Wed May 24 14:43:25 AEST 2000


On 23-May-2000, Fergus Henderson <fjh at cs.mu.OZ.AU> wrote:
> The goals that end up in ExtraGoals are, but the calls to list__append aren't,
> if you see what I mean.
> 
> IMHO, it would be much clearer to replace that sequence of calls to
> list__append with various intermediate variables with a single call to
> list__condense.  That is, instead of
> 
>                           list__append(ExtraGoals1, RevTypeInfoGoals,
>                                   ExtraGoals2),
>                           list__append(NewGoals, ExtraGoals2, ExtraGoals3),
>                           list__append(RevUnconstrainedTypeInfoGoals,
>                                   ExtraGoals3, ExtraGoals)
> 
> write
> 
> 			  list__condense([RevUnconstrainedTypeInfoGoals,
> 			  	NewGoals, ExtraGoals1, RevTypeInfoGoals],
> 				ExtraGoals)

What a jolly good idea.

---------------------------------------------------------------------------

Estimated hours taken: 0.1

compiler/polymorphism.m:
	Replace a series of list__appends with a list__condense.

---------------------------------------------------------------------------

Index: polymorphism.m
===================================================================
RCS file: /home/staff/zs/imp/mercury/compiler/polymorphism.m,v
retrieving revision 1.187
diff -u -t -r1.187 polymorphism.m
--- polymorphism.m	2000/05/22 18:00:36	1.187
+++ polymorphism.m	2000/05/23 04:39:27
@@ -2026,11 +2026,9 @@
                         list__reverse(UnconstrainedTypeInfoGoals, 
                                 RevUnconstrainedTypeInfoGoals),
 
-                        list__append(ExtraGoals1, RevTypeInfoGoals,
-                                ExtraGoals2),
-                        list__append(NewGoals, ExtraGoals2, ExtraGoals3),
-                        list__append(RevUnconstrainedTypeInfoGoals,
-                                ExtraGoals3, ExtraGoals)
+                        list__condense([RevUnconstrainedTypeInfoGoals, 
+                                NewGoals, ExtraGoals1, RevTypeInfoGoals],
+                                ExtraGoals)
                 ;
                                 % We have to extract the typeclass_info from
                                 % another one



dgj
-- 
David Jeffery (dgj at cs.mu.oz.au) | If your thesis is utterly vacuous
PhD student,                    | Use first-order predicate calculus.
Dept. of Comp. Sci. & Soft. Eng.|     With sufficient formality
The University of Melbourne     |     The sheerist banality
Australia                       | Will be hailed by the critics: "Miraculous!"
                                |     -- Anon.
--------------------------------------------------------------------------
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