aboutsummaryrefslogtreecommitdiff
path: root/src/content/chapter2_flow_control/lesson09_alternative_patterns/en.html
blob: 0e36b2dad094bc8bfda426da558a61b4b9561942 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
<p>
  Alternative patterns can be given for a case clause using the
  <code>|</code> operator. If any of the patterns match then the clause matches.
</p>
<p>
  If a pattern defines a variable then all of the alternative patterns for that
  clause must also define a variable with the same name and same type.
</p>
<p>
  Currently it's not possible to have nested alternative patterns, so the
  pattern <code>[1 | 2 | 3]</code> is not valid.
</p>