Switch
Multi-way branch on a scalar key. Replaces nested IfExpr cascades. The first case whose SwitchCase.value equals on.eval(...) exactly wins; if none match, otherwise is returned.
Properties
Cases checked in order.
Scalar expression whose value selects the case. Typically VIndex.
Returned when no case matches.
Functions
Build Div of two expressions.
Divide this expression by a literal rhs.
Exact equality (no tolerance).
Exact equality against a literal (no tolerance).
Greater-or-equal comparison.
Greater-or-equal against a literal.
Strictly-greater-than comparison.
Strictly-greater-than against a literal.
Less-or-equal comparison.
Less-or-equal against a literal.
Strictly-less-than comparison.
Strictly-less-than against a literal.
Build Sub of two expressions.
Subtract a literal rhs from this expression.
Build Add of two expressions.
Add a literal rhs to this expression.
Build Mul of two expressions.
Multiply this expression by a literal rhs.
Unary minus: wraps in Neg.
Switch
cases
Cases checked in order.
eval
on
Scalar expression whose value selects the case. Typically VIndex.
otherwise
Returned when no case matches.