select according to value
Description
case expr of { ... } : x
case expr of { … } produces the outcome of the case clause that is selected by the value of expr.
Parameters
- expr
- the expression to be used as the subject of the case statement.
- ...
- case expr1: result1, …, default: result2
- returns
- result1 if expr = expr1, …, else result2