For review: doco on conditional expressions

Thomas Charles CONWAY conway at cs.mu.OZ.AU
Tue Sep 22 09:01:14 AEST 1998


For anyone to review...
-- 
Thomas Conway <conway at cs.mu.oz.au>
Nail here [] for new monitor.  )O+


doc/reference_manual.texi:
	Add some documentation on conditional expressions.


cvs diff: Diffing doc
Index: doc/reference_manual.texi
===================================================================
RCS file: /home/staff/zs/imp/mercury/doc/reference_manual.texi,v
retrieving revision 1.102
diff -u -r1.102 reference_manual.texi
--- reference_manual.texi	1998/08/18 09:59:23	1.102
+++ reference_manual.texi	1998/08/24 00:24:01
@@ -669,7 +669,7 @@
 higher-order function applications, and lambda expressions.
 
 A data-term is either a variable, a data-functor, a higher-order
-function application, or a lambda expression.
+function application, conditional expression or a lambda expression.
 
 A data-functor is an integer, a float, a string, a character literal
 (any single-character name), a name, or a compound data-term.
@@ -679,6 +679,20 @@
 If a data-functor is a name or a compound data-term, its top-level functor
 must name a function, predicate, or data constructor declared
 in the program or in the interface of an imported module.
+
+A conditional expression is an expression of either of the two following
+forms
+
+ at example
+(if Goal then Expression1 else Expression1)
+(Goal -> Expression1 ; Expression2)
+ at end example
+
+ at noindent
+ at samp{Goal} is a goal; @samp{Expression1} and @samp{Expression2} are
+both data-terms. The semantics of a conditional expression is that
+if @samp{Goal} is true, then the expression has the meaning of
+ at samp{Expression1}, else the expression has the meaning of @samp{Expression2}.
 
 A lambda expression is a compound term of one of the following forms
 



More information about the developers mailing list