aboutsummaryrefslogtreecommitdiff
path: root/docs/pointers.md
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2025-04-06 23:37:05 -0400
committerBruce Hill <bruce@bruce-hill.com>2025-04-06 23:37:05 -0400
commit1a196aa8f724971e531487f9cdd541f7957cfd92 (patch)
tree52a36701065ab0e3f7012765c909c3b2a3fd2e49 /docs/pointers.md
parent4a3db447ce820617a72bdd9fc6217c84c3799bea (diff)
Update syntax in docs
Diffstat (limited to 'docs/pointers.md')
-rw-r--r--docs/pointers.md8
1 files changed, 4 insertions, 4 deletions
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")
```