Update wikipage Conditional expression. (Signed-off-by:alexk).

git-svn-id: https://svn.eiffel.com/eiffel-org/trunk@1865 abb3cda0-5349-4a8f-a601-0c33ac3a8c38
This commit is contained in:
eiffel-org
2017-07-05 17:05:54 +00:00
parent a86bc58b90
commit f679f63970

View File

@@ -0,0 +1,31 @@
[[Property:uuid|C652AC71-8BAD-4387-A46C-21C9F5C3A68F]]
[[Property:weight|0]]
[[Property:title|Conditional expression]]
[[Property:link_title|Conditional]]
= Conditional expression =
[[Eiffel%20Programming%20Language%20Syntax#Conditionals|Conditional expressions]] compute a value using different expressions depending on one or more conditions. If all expressions have the same type, the conditional expression as a whole has this type as well:
<e>
if time < noon then
"Good morning"
elseif time < evening then
"Good afternoon"
else
"Good evening"
end
</e>
has type `STRING`.
If the types of the expressions are different, the common ancestor type is used as a type of the whole expression.
<e>
if time < noon then
"Good morning"
else
Void
end
</e>
has type `detachable STRING`.