From c034175ae1cbe53bc0e7e1ae71b51c64dcc3402a Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Wed, 11 Sep 2024 23:17:03 -0400 Subject: Add optional:or_else(fallback) and optional:or_fail(message) --- test/optionals.tm | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'test/optionals.tm') diff --git a/test/optionals.tm b/test/optionals.tm index e2cdf9a6..26e825ae 100644 --- a/test/optionals.tm +++ b/test/optionals.tm @@ -83,6 +83,15 @@ func main(): 5 = 5? : Int? + >> (5?):or_else(-1) + = 5 : Int + + >> (5?):or_fail() + = 5 : Int + + >> (!Int):or_else(-1) + = -1 : Int + do: !! Ints: >> yep := maybe_int(yes) -- cgit v1.2.3