Next: , Previous: Links, Up: Marsyas Expression Syntax


9.6.4.6 Conditional Statements ( {? cond_expr : exprs1 : exprs2 } )

The conditional statement is used for making decisions. The cond term is the decision and must result in a boolean. If cond is true then the then_expr is executed otherwise the else_expr is executed. Each of these expressions may be a list of expressions, even the cond_expr so long as cond_expr results in a bool type and both expr1 and expr2 result in the same type. Example: {? 5<3 : 1 : 2}.