diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2025-11-29 15:56:02 -0500 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2025-11-29 15:56:02 -0500 |
| commit | 97047cb95a88228ddefbc83b4c50b05eaf048272 (patch) | |
| tree | fb6a57ef6c6fd8e18aba8b8c3e3c6bbf83d61ec6 /docs/optionals.md | |
| parent | d60962ab5de970a9ce0893df4154b8a0b3ea646a (diff) | |
Update docs
Diffstat (limited to 'docs/optionals.md')
| -rw-r--r-- | docs/optionals.md | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/docs/optionals.md b/docs/optionals.md index 131daf19..326d77b5 100644 --- a/docs/optionals.md +++ b/docs/optionals.md @@ -90,14 +90,11 @@ an `Abort` type like `fail()` or `exit()`: ```tomo maybe_x : Int? = 5 ->> maybe_x or -1 -= 5 : Int ->> maybe_x or fail("No value!") -= 5 : Int +assert (maybe_x or -1) == 5 +assert (maybe_x or fail("No value!")) == 5 maybe_x = none ->> maybe_x or -1 -= -1 : Int +assert (maybe_x or -1) == -1 >> maybe_x or fail("No value!") # Failure! |
