[m-rev.] for review: pred_to_bool
Simon Taylor
stayl at cs.mu.OZ.AU
Thu May 22 13:40:31 AEST 2003
Estimated hours taken: 0.1
Branches: main
NEWS:
library/bool.m:
Add `pred_to_bool(P) = ( if P then yes else no )'.
Index: NEWS
===================================================================
RCS file: /home/mercury1/repository/mercury/NEWS,v
retrieving revision 1.312
diff -u -u -r1.312 NEWS
--- NEWS 19 May 2003 14:24:20 -0000 1.312
+++ NEWS 22 May 2003 03:36:40 -0000
@@ -95,6 +95,8 @@
* We've added a predicate, expand_braces, to dir.m.
+* We've added a function, pred_to_bool, to bool.m.
+
* We've added the three predicates, `is_nan/1', `is_inf/1' and
`is_nan_or_inf/1' to float.m. These predicates are for use only on
systems which support IEEE floating point arithmetic.
Index: library/bool.m
===================================================================
RCS file: /home/mercury1/repository/mercury/library/bool.m,v
retrieving revision 1.8
diff -u -u -r1.8 bool.m
--- library/bool.m 22 Jul 2002 07:13:07 -0000 1.8
+++ library/bool.m 22 May 2003 03:37:31 -0000
@@ -1,5 +1,5 @@
%---------------------------------------------------------------------------%
-% Copyright (C) 1996-1997,2000,2002 The University of Melbourne.
+% Copyright (C) 1996-1997,2000,2002-2003 The University of Melbourne.
% This file may only be copied under the terms of the GNU Library General
% Public License - see the file COPYING.LIB in the Mercury distribution.
%---------------------------------------------------------------------------%
@@ -50,6 +50,10 @@
:- pred bool__not(bool, bool).
:- mode bool__not(in, out) is det.
+ % pred_to_bool(P) = ( if P then yes else no ).
+:- func pred_to_bool((pred)) = bool.
+:- mode pred_to_bool((pred) is semidet) = out is det.
+
%-----------------------------------------------------------------------------%
:- implementation.
@@ -108,5 +112,7 @@
bool__return_no = no.
bool__return_yes = yes.
+
+pred_to_bool(P) = ( if P then yes else no ).
%-----------------------------------------------------------------------------%
--------------------------------------------------------------------------
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