[m-dev.] For review: doco on conditional expressions
Thomas Charles CONWAY
conway at cs.mu.OZ.AU
Tue Sep 22 14:38:56 AEST 1998
Fergus Henderson, you write:
> Could you please post another diff when you've addressed the above points.
> Thanks.
Try this.
ps I put in the comma you suggested, though it is correct and fine
style not to include it.
--
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:33:03
@@ -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 Goal then Expression1 else Expression1)
+(Goal -> Expression1 ; 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