4.5.7 Conditional Expressions
1/3
Syntax
2/3
3/3
4/3
5/3
6/3
7/3
Name Resolution Rules
8/3
9/3
10/3
11/3
12/3
13/3
14/3
A
condition
is expected to be of any boolean type.
15/3
Legality Rules
16/3
17/3
18/3
19/3
Dynamic Semantics
20/3
For the evaluation of an
if_expression,
the
condition
specified after
if, and any
conditions
specified after
elsif, are evaluated in succession (treating a
final
else as
elsif True
then), until one evaluates
to True or all
conditions
are evaluated and yield False. If a
condition
evaluates to True, the associated
dependent_expression
is evaluated, converted to the type of the
if_expression,
and the resulting value is the value of the
if_expression.
Otherwise (when there is no
else clause), the value of the
if_expression
is True.
21/3
Ada 2005 and 2012 Editions sponsored in part by Ada-Europe