aboutsummaryrefslogtreecommitdiff
path: root/src/content/chapter2_flow_control/lesson09_alternative_patterns/en.html
blob: 25421f43f3d99041c3b4f7fd1431af77e529f54f (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 is not possible to have nested alternative patterns, so the
  pattern <code>[1 | 2 | 3]</code> is not valid.
</p>