From 7b735ab6fc3e0bb368f1ca484168eaefbbe3ce9c Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Fri, 4 Apr 2025 18:29:09 -0400 Subject: Misc fixes --- docs/optionals.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'docs/optionals.md') diff --git a/docs/optionals.md b/docs/optionals.md index 84f886b7..ff4252d1 100644 --- a/docs/optionals.md +++ b/docs/optionals.md @@ -40,7 +40,7 @@ example, if you wanted to declare a variable that could be either an integer value or `none` and initialize it as none, you would write it as: ```tomo -x := none:Int +x : Int = none ``` Similarly, if you wanted to declare a variable that could be an array of texts @@ -57,7 +57,7 @@ keep open the possibility of assigning `none` later, you can use the postfix ```tomo x := 5? # Later on, assign none: -x = !Int +x = none ``` ## Type Inference @@ -86,7 +86,7 @@ Non-none values can also be automatically promoted to optional values without the need for an explicit `?` operator in the cases listed above: ```tomo -x := !Int +x : Int? = none x = 5 func doop(arg:Int?)->Text?: @@ -109,7 +109,7 @@ maybe_x := 5? >> maybe_x or fail("No value!") = 5 : Int -maybe_x = !Int +maybe_x = none >> maybe_x or -1 = -1 : Int >> maybe_x or fail("No value!") -- cgit v1.2.3