aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2025-04-04 17:06:09 -0400
committerBruce Hill <bruce@bruce-hill.com>2025-04-04 17:06:09 -0400
commit0b8074154e2671691050bdb3bcb33245625a056c (patch)
tree1410e0c4e05c6372e876cd08f16d117e12868f41 /docs
parentfadcb45baf1274e06cfe37b87655b9146aa52874 (diff)
First working compile of refactor to add explicit typing to declarations
and support untyped empty collections and `none`s
Diffstat (limited to 'docs')
-rw-r--r--docs/arrays.md2
-rw-r--r--docs/functions.md2
-rw-r--r--docs/integers.md2
-rw-r--r--docs/operators.md2
-rw-r--r--docs/reductions.md2
-rw-r--r--docs/sets.md2
-rw-r--r--docs/tables.md2
7 files changed, 7 insertions, 7 deletions
diff --git a/docs/arrays.md b/docs/arrays.md
index e3da6e0e..437ab76f 100644
--- a/docs/arrays.md
+++ b/docs/arrays.md
@@ -18,7 +18,7 @@ you want to have an empty array, you must specify what type goes inside the arra
like this:
```tomo
-empty := [:Int]
+empty : [Int] = []
```
For type annotations, an array that holds items with type `T` is written as `[T]`.
diff --git a/docs/functions.md b/docs/functions.md
index edd1261a..9f95277f 100644
--- a/docs/functions.md
+++ b/docs/functions.md
@@ -82,7 +82,7 @@ func _add(x, y:Int -> Int):
return x + y
struct add_args(x,y:Int)
-add_cache := @{:add_args,Int}
+add_cache : @{add_args=Int} = @{}
func add(x, y:Int -> Int):
args := add_args(x, y)
diff --git a/docs/integers.md b/docs/integers.md
index d4e2fc3c..6e45f1be 100644
--- a/docs/integers.md
+++ b/docs/integers.md
@@ -361,7 +361,7 @@ An iterator function that counts onward from the starting integer.
**Example:**
```tomo
-nums := &[:Int]
+nums : &[Int] = &[]
for i in 5:onward():
nums:insert(i)
stop if i == 10
diff --git a/docs/operators.md b/docs/operators.md
index a4b68fa8..a304cf35 100644
--- a/docs/operators.md
+++ b/docs/operators.md
@@ -75,7 +75,7 @@ first option is to not account for it, in which case you'll get a runtime error
if you use a reducer on something that has no values:
```tomo
->> nums := [:Int]
+>> nums : [Int] = []
>> (+: nums)!
Error: this collection was empty!
diff --git a/docs/reductions.md b/docs/reductions.md
index 58cfa314..959d9701 100644
--- a/docs/reductions.md
+++ b/docs/reductions.md
@@ -18,7 +18,7 @@ a runtime check and error if there's a null value, or you can use `or` to
provide a fallback value:
```tomo
-nums := [:Int]
+nums : [Int] = []
sum := (+: nums)
>> sum
diff --git a/docs/sets.md b/docs/sets.md
index 778740a3..740a37f3 100644
--- a/docs/sets.md
+++ b/docs/sets.md
@@ -21,7 +21,7 @@ nums := {10, 20, 30}
Empty sets must specify the item type explicitly:
```tomo
-empty := {:Int}
+empty : {Int} = {}
```
For type annotations, a set that holds items with type `T` is written as `{T}`.
diff --git a/docs/tables.md b/docs/tables.md
index f0045ef7..83c80b2b 100644
--- a/docs/tables.md
+++ b/docs/tables.md
@@ -17,7 +17,7 @@ table := {"A"=10, "B"=20}
Empty tables must specify the key and value types explicitly:
```tomo
-empty := {:Text=Int}
+empty : {Text=Int} = {}
```
For type annotations, a table that maps keys with type `K` to values of type