[m-dev.] For review: doco on conditional expressions

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


Fergus Henderson, you write:
> Please check that the output looks OK in all 3 formats.
> 
Yep.

> Otherwise that looks OK.  Thanks.
> 

I'm committing the following diff.

-- 
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 .
Index: 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/09/22 04:50:26
@@ -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, a 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 @var{Goal} then @var{Expression1} else @var{Expression1})
+(@var{Goal} -> @var{Expression1} ; @var{Expression2})
+ at end example
+
+ at noindent
+ at var{Goal} is a goal; @var{Expression1} and @var{Expression2} are
+both data-terms. The semantics of a conditional expression is that
+if @var{Goal} is true, then the expression has the meaning of
+ at var{Expression1}, else the expression has the meaning of @var{Expression2}.
 
 A lambda expression is a compound term of one of the following forms
 



More information about the developers mailing list