![]() |
| ||||||||
Navigation |
Synopsis Conditional expression on values.
Syntax
Exp1 ? Exp2 : Exp3
Types
Description Yields the value of
Exp2 if the value of Exp1 is true and the value of Exp3 otherwise.
The result type is the least upper bound (also known as lub , see StaticTyping) of the types of Exp2 and Exp3 .
Examples
rascal>( 3 > 2 ) ? 30 : 40; int: 30 rascal>( 3 < 2 ) ? "abc" : {3, 4}; set[int]: {3,4} ![]() |