Conditional Expression

The unique conditional expression operator is ?:. The expression syntax, semantics, associativity and precedence are quite identical to the corresponding C and C++ expressions. The first operand must be an boolean and the two others may be of any type. Contrary to C and C++, the two last operands does not need to be of the same type.
General Information
Operator ?:
Type ternary
Syntaxe expr ? expr : expr
Operand Types first operand is boolean, others are any type
Result Type type of the evaluated operand
Functions conditional evaluation: evaluates and returns the second operand if the first operand is true; otherwise evaluates and returns the second operand

Expression Examples
expression result
true ? "hello" : "world" "hello"
true ? 2.3 : "world" 2.3
1+1 == 2 ? (a := 3.1415926535) : nil 3.1515926535
1 ? 3 : nil raises an error: boolean expected, got integer.
EyeDB manual