[m-rev.] for review: add list.cons/3 to list.m

Julien Fischer juliensf at students.cs.mu.OZ.AU
Sat Mar 20 01:30:07 AEDT 2004


On Fri, 19 Mar 2004, Zoltan Somogyi wrote:

> On 18-Mar-2004, Julien Fischer <juliensf at students.cs.mu.OZ.AU> wrote:
> > Add a predicate list.cons/3 to list.m.  This is sometimes
> > useful with higher-order code and it can make code that
> > uses state variables more concise.
>
> That's fine.
>
> Zoltan.

I've committed this along with the following addition.

compiler/bytecode_data.m:
	Remove the cons predicate need by int_to_byte_list/3
	and use the one added above instead.

Index: bytecode_data.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/bytecode_data.m,v
retrieving revision 1.12
diff -u -r1.12 bytecode_data.m
--- bytecode_data.m	19 Mar 2004 10:19:19 -0000	1.12
+++ bytecode_data.m	19 Mar 2004 13:12:54 -0000
@@ -136,12 +136,8 @@
 :- pred int_to_byte_list(int::in, int::in, list(int)::out) is det.

 int_to_byte_list(Bits, IntVal, Bytes) :-
-	output_int(cons, Bits, IntVal, [], RevBytes),
+	output_int(list__cons, Bits, IntVal, [], RevBytes),
 	list__reverse(RevBytes, Bytes).
-
-:- pred cons(T::in, list(T)::in, list(T)::out) is det.
-
-cons(T, List, [T | List]).

 :- pred output_int(pred(int, T, T), int, int, T, T).
 :- mode output_int(pred(in, in, out) is det, in, in, in, out) is det.
--------------------------------------------------------------------------
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