[m-rev.] diff: implement limited_deconstruct_cc in Mercury.

Peter Ross pro at missioncriticalit.com
Tue Dec 3 03:28:20 AEDT 2002


Hi,

Woops missed this one.

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


Estimated hours taken: 0.5
Branches: main

browser/browse.m:
	Update to use the new type signature and determinism of
	limited_deconstruct_cc.


Index: browser/browse.m
===================================================================
RCS file: /home/mercury1/repository/mercury/browser/browse.m,v
retrieving revision 1.33
diff -u -r1.33 browse.m
--- browser/browse.m	1 Nov 2002 07:44:58 -0000	1.33
+++ browser/browse.m	2 Dec 2002 16:24:13 -0000
@@ -590,15 +590,20 @@
 	->
 		RemainingSize = MaxSize
 	;
-		limited_deconstruct_cc(univ_value(Univ), MaxSize,
-			Functor, Arity, Args)
-	->
-		string__length(Functor, FunctorSize),
-		% "()", plus Arity-1 times ", "
-		PrincipalSize = FunctorSize + Arity * 2,
-		MaxArgsSize = MaxSize - PrincipalSize,
-		list__foldl(term_size_left_from_max,
-			Args, MaxArgsSize, RemainingSize)
+		std_util__limited_deconstruct_cc(univ_value(Univ), MaxSize,
+				MaybeFunctorArityArgs),
+		(
+			MaybeFunctorArityArgs = yes({Functor, Arity, Args})
+		->
+			string__length(Functor, FunctorSize),
+			% "()", plus Arity-1 times ", "
+			PrincipalSize = FunctorSize + Arity * 2,
+			MaxArgsSize = MaxSize - PrincipalSize,
+			list__foldl(term_size_left_from_max,
+				Args, MaxArgsSize, RemainingSize)
+		;
+			RemainingSize = -1
+		)
 	;
 		RemainingSize = -1
 	).

--------------------------------------------------------------------------
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