aboutsummaryrefslogtreecommitdiff
path: root/src/content/chapter5_advanced_features/lesson05_let_assert/en.html
blob: 0a6d10f2354d75c9ab87e60b98c489b0216b9fa5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<p>
  <code>let assert</code> is the final way to intentionally crash your Gleam
  program. It's similar to the <code>panic</code> keyword in that it crashes
  when the program has reached a point that should never be reached.
</p>
<p>
  <code>let assert</code> is similar to <code>let</code> in that it's a way to
  assign values to variables, but it's different in that the pattern can be
  <i>partial</i>. The pattern does not need to match every possible value of the
  type being assigned.
</p>
<p>
  Like <code>panic</code> this feature should be used sparingly, and likely not
  at all in libraries.
</p>