From 1a196aa8f724971e531487f9cdd541f7957cfd92 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Sun, 6 Apr 2025 23:37:05 -0400 Subject: Update syntax in docs --- docs/pointers.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'docs/pointers.md') diff --git a/docs/pointers.md b/docs/pointers.md index 0644a6ab..254db07e 100644 --- a/docs/pointers.md +++ b/docs/pointers.md @@ -12,7 +12,7 @@ a new, different value and assigning it to a pointer's memory location to replace the value that previously resided there. ```tomo -func no_mutation_possible(nums:[Int]): +func no_mutation_possible(nums:[Int]) nums[1] = 10 // This performs a copy-on-write and creates a new list // The new list is only accessible as a local variable here ... @@ -21,7 +21,7 @@ no_mutation_possible(my_nums) >> my_nums = [0, 1, 2] -func do_mutation(nums:@[Int]): +func do_mutation(nums:@[Int]) nums[1] = 10 // The mutates the value at the given pointer's location ... my_nums := @[0, 1, 2] @@ -82,9 +82,9 @@ this, and everywhere inside the truthy block will allow you to use the pointer as a non-null pointer: ``` -if optional: +if optional ok := optional[] -else: +else say("Oh, it was null") ``` -- cgit v1.2.3