[m-rev.] diff: allow `old' as a synonym for `any'
Mark Brown
mark at cs.mu.OZ.AU
Fri Jan 21 14:42:32 AEDT 2005
On 07-Jan-2005, David Overton <dmo at cs.mu.OZ.AU> wrote:
> On Fri, Jan 07, 2005 at 05:09:09PM +1100, Mark Brown wrote:
> > library/builtin.m:
> > Allow `old' as a synonym for `any', since some of the literature
> > uses this terminology.
>
> For consistency, why not also at `new' as a synonym for `free'?
>
Okay. I've also added modes `no' and `oo', although I'm not sure if this
is the best idea since the names are a bit misleading, so comments are
invited before I commit the following diff.
Cheers,
Mark.
Estimated hours taken: 0.1
Branches: main
library/builtin.m:
Allow inst `new' as a synonym for `free', mode `no' for `new >> old'
and mode `oo' for `old >> old'.
NEWS:
Mention the change.
Index: NEWS
===================================================================
RCS file: /home/mercury1/repository/mercury/NEWS,v
retrieving revision 1.364
diff -u -r1.364 NEWS
--- NEWS 18 Jan 2005 08:09:02 -0000 1.364
+++ NEWS 21 Jan 2005 03:31:38 -0000
@@ -262,8 +262,9 @@
* builtin.m now contains types and insts `unify' and `compare' for use
in defining user-defined equality and comparison predicates.
-* builtin.m now defines inst `old' as a synonym for `any', since some of the
- literature uses this terminology.
+* builtin.m now defines insts `new' and `old' as synonyms for `free' and
+ `any', respectively, since some of the literature uses this terminology.
+ Likewise it defines modes `no' for `new >> old' and `oo' for `old >> old'.
* We've fixed some problems with the use of `cc_nondet'.
Index: library/builtin.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/builtin.m,v
retrieving revision 1.107
diff -u -r1.107 builtin.m
--- library/builtin.m 7 Jan 2005 06:10:34 -0000 1.107
+++ library/builtin.m 21 Jan 2005 03:29:59 -0000
@@ -50,10 +50,11 @@
:- inst mostly_dead == mostly_clobbered.
% The `any' inst used for the constraint solver interface is also builtin.
-% The inst `old' is allowed as a synonym for `any', since some of the
-% literature uses this terminology.
+% The insts `new' and `old' are allowed as synonyms for `free' and `any',
+% respectively, since some of the literature uses this terminology.
:- inst old == any.
+:- inst new == free.
% Higher-order predicate insts `pred(<modes>) is <detism>'
% and higher-order functions insts `func(<modes>) = <mode> is det'
@@ -106,6 +107,11 @@
:- mode ia == any >> any.
:- mode oa == free >> any.
+% The modes `no' and `oo' are allowed as synonyms, since some of the
+% literature uses this terminology.
+:- mode no == new >> old.
+:- mode oo == old >> old.
+
%-----------------------------------------------------------------------------%
% PREDICATES.
--------------------------------------------------------------------------
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