[m-rev.] diff: clean up deconstruct and std_util

Peter Ross pro at missioncriticalit.com
Wed Dec 4 21:08:05 AEDT 2002


On Wed, Dec 04, 2002 at 10:38:10AM +1100, Fergus Henderson wrote:
> On 03-Dec-2002, Peter Ross <pro at missioncriticalit.com> wrote:
> > 
> > Index: library/deconstruct.m
> > ===================================================================
> > RCS file: /home/staff/zs/imp/mercury/library/deconstruct.m,v
> > retrieving revision 1.19
> > diff -u -r1.19 deconstruct.m
> > --- library/deconstruct.m	3 Dec 2002 10:09:19 -0000	1.19
> > +++ library/deconstruct.m	3 Dec 2002 10:40:44 -0000
> > @@ -122,8 +122,6 @@
> >  :- some [ArgT] pred arg(T, noncanon_handling, int, ArgT).
> >  :- mode arg(in, in(do_not_allow), in, out) is semidet.
> >  :- mode arg(in, in(canonicalize), in, out) is semidet.
> > -:- mode arg(in, in(include_details_cc), in, out) is erroneous.
> > -:- mode arg(in, in, in, out) is semidet.
> ...
> > -:- mode det_arg(in, in, in, out) is det.
> > +:- mode det_arg(in, in, in, out) is cc_multi.
> ...
> > Index: library/std_util.m
> ...
> > -:- pred argument_cc(T::in, int::in, univ::out) is cc_nondet.
> > +:- pred argument_cc(T::in, int::in, maybe(univ)::out) is cc_multi.
> 
> These interface changes should be documented in the NEWS file.
> 
> Also, rather than deleting the `in' mode, it would IMHO be better to
> replace it with an in(canonicalize_or_do_not_allow) mode,
> where
> 	:- inst canonicalize_or_do_not_allow
> 		--->	canonicalize
> 		;	do_not_allow.


Hi,


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


Estimated hours taken: 0.25
Branches: main

NEWS:
	Add argument_cc to the list of predicates whose interface has
	changed in std_util.

library/deconstruct.m:
	Add a canonicalize_or_do_not_allow inst and add a mode for it
	to arg/3.

Index: NEWS
===================================================================
RCS file: /home/mercury1/repository/mercury/NEWS,v
retrieving revision 1.289
diff -u -r1.289 NEWS
--- NEWS	3 Dec 2002 04:49:07 -0000	1.289
+++ NEWS	4 Dec 2002 10:04:58 -0000
@@ -35,10 +35,10 @@
   systems which support IEEE floating point arithmetic.
 
 * The determinisms of the following predicates in the `std_util'
-  module have been changed from cc_nondet to cc_multi: arg_cc/3 and
-  limited_deconstruct_cc/3 (formerly limited_deconstruct_cc/5).  The
-  success or failure of these predicates is now encoded in a maybe
-  type.
+  module have been changed from cc_nondet to cc_multi: arg_cc/3,
+  argument_cc/3 and limited_deconstruct_cc/3 (formerly
+  limited_deconstruct_cc/5).  The success or failure of these
+  predicates is now encoded in a maybe type.
 
 * The incorrect cc_nondet modes of the following predicates in
   the `deconstruct' module have been removed: arg/4, limited_deconstruct/6.
Index: library/deconstruct.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/deconstruct.m,v
retrieving revision 1.20
diff -u -r1.20 deconstruct.m
--- library/deconstruct.m	3 Dec 2002 12:30:20 -0000	1.20
+++ library/deconstruct.m	4 Dec 2002 10:04:59 -0000
@@ -42,6 +42,10 @@
 :- inst do_not_allow ---> do_not_allow.
 :- inst canonicalize ---> canonicalize.
 :- inst include_details_cc ---> include_details_cc.
+:- inst canonicalize_or_do_not_allow
+	--->	do_not_allow
+	;	canonicalize.
+
 
 	% functor, argument and deconstruct and their variants take any type
 	% (including univ), and return representation information for that type.
@@ -122,6 +126,7 @@
 :- some [ArgT] pred arg(T, noncanon_handling, int, ArgT).
 :- mode arg(in, in(do_not_allow), in, out) is semidet.
 :- mode arg(in, in(canonicalize), in, out) is semidet.
+:- mode arg(in, in(canonicalize_or_do_not_allow), in, out) is semidet.
 
 	% See the documentation of std_util__arg_cc
 :- pred arg_cc(T, int, std_util__maybe_arg).
--------------------------------------------------------------------------
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