[m-rev.] diff: add queue.from_list/1 to library
Julien Fischer
juliensf at cs.mu.OZ.AU
Tue Jan 25 09:28:31 AEDT 2005
Estimated hours taken: 0.1
Branches: main
library/queue.m:
Add a function queue.from_list/1 that is a synonym
for queue.list_to_queue/1.
NEWS:
Mention the new function.
Shift the description of the term_to_xml module. It
had ended up under the changes for 0.11 for some reason.
s/ad/as/ in a spot.
Julien.
Index: NEWS
===================================================================
RCS file: /home/mercury1/repository/mercury/NEWS,v
retrieving revision 1.365
diff -u -r1.365 NEWS
--- NEWS 21 Jan 2005 03:32:11 -0000 1.365
+++ NEWS 24 Jan 2005 22:23:03 -0000
@@ -129,7 +129,10 @@
Changes to the Mercury standard library:
-* We've added the function pqueue.from_assoc_list/1 ad a synonym
+* We've add the function queue.from_list/1 as a synonym for
+ queue.list_to_queue/1.
+
+* We've added the function pqueue.from_assoc_list/1 as a synonym
for pqueue.assoc_list_to_pqueue/1.
* We've added functions set.from_list/1 and set.from_sorted_list/1
@@ -317,6 +320,12 @@
rational.from_integers/2 and rational.reciprocal/1 to rational.m
The function rational.rational_from_integers/2 has been deprecated.
+* A new module `term_to_xml' has been added to the standard library. This
+ module contains predicates to write arbitrary Mercury terms to an output
+ stream as XML. Automatic generation of DTDs for Mercury types is also
+ supported. Once a Mercury term is in XML it can be converted to many other
+ formats such as HTML or XUL using an appropriate stylesheet.
+
Changes to the Mercury compiler:
* Due to personnel changes and semantic problems in the design of
@@ -758,12 +767,6 @@
* We've added random__random/5, which produces a random integer in a
given range, and random__randcount/3, which returns the number of
distinct random numbers that can be generated.
-
-* A new module `term_to_xml' has been added to the standard library. This
- module contains predicates to write arbitrary Mercury terms to an output
- stream as XML. Automatic generation of DTDs for Mercury types is also
- supported. Once a Mercury term is in XML it can be converted to many other
- formats such as HTML or XUL using an appropriate stylesheet.
Changes to the extras distribution:
Index: library/queue.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/queue.m,v
retrieving revision 1.24
diff -u -r1.24 queue.m
--- library/queue.m 15 Mar 2004 23:49:34 -0000 1.24
+++ library/queue.m 24 Jan 2005 12:25:04 -0000
@@ -84,6 +84,10 @@
:- pred queue__list_to_queue(list(T)::in, queue(T)::out) is det.
:- func queue__list_to_queue(list(T)) = queue(T).
+ % A synonym for queue.list_to_queue/1.
+ %
+:- func queue__from_list(list(T)) = queue(T).
+
% `queue__delete_all(Queue0, Elem, Queue)' is true iff `Queue' is
% the same queue as `Queue0' with all occurences of `Elem' removed
% from it.
@@ -157,6 +161,8 @@
Length = LengthOn + LengthOff.
queue__list_to_queue(List, [] - List).
+
+queue__from_list(List) = [] - List.
queue__delete_all(On0 - Off0, Elem, On - Off) :-
list__delete_all(On0, Elem, On1),
--------------------------------------------------------------------------
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