From 938f49fc7835501192ccc7db7c1ab3174f050b34 Mon Sep 17 00:00:00 2001 From: Louis Pilfold Date: Tue, 20 Feb 2024 12:20:16 +0000 Subject: Let assert --- .../lesson04_let_assert/en.html | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 src/content/chapter5_advanced_features/lesson04_let_assert/en.html (limited to 'src/content/chapter5_advanced_features/lesson04_let_assert/en.html') diff --git a/src/content/chapter5_advanced_features/lesson04_let_assert/en.html b/src/content/chapter5_advanced_features/lesson04_let_assert/en.html new file mode 100644 index 0000000..29fd06c --- /dev/null +++ b/src/content/chapter5_advanced_features/lesson04_let_assert/en.html @@ -0,0 +1,15 @@ +

+ let assert is the final way to intentionally crash your Gleam + program. It is similar to the panic keyword in that it crashes + when the program has reached a point that should never be reached. +

+

+ let assert is similar to let in that it is a way to + assign values to variables, but it is different in that the pattern can be + partial. The pattern does not need to match every possible value of the + type being assigned. +

+

+ Like panic this feature should be used sparingly, and likely not + at all in libraries. +

-- cgit v1.2.3