diff --git a/documentation/trunk/eiffel/Language_reference/quick-reference-eiffel-programming-language/Expressions/Conditional-expression.wiki b/documentation/trunk/eiffel/Language_reference/quick-reference-eiffel-programming-language/Expressions/Conditional-expression.wiki new file mode 100644 index 00000000..31d4352a --- /dev/null +++ b/documentation/trunk/eiffel/Language_reference/quick-reference-eiffel-programming-language/Expressions/Conditional-expression.wiki @@ -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: + + + if time < noon then + "Good morning" + elseif time < evening then + "Good afternoon" + else + "Good evening" + end + + +has type `STRING`. + +If the types of the expressions are different, the common ancestor type is used as a type of the whole expression. + + + if time < noon then + "Good morning" + else + Void + end + + +has type `detachable STRING`. \ No newline at end of file