aboutsummaryrefslogtreecommitdiff
path: root/examples/learnxiny.tm
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 /examples/learnxiny.tm
parentfadcb45baf1274e06cfe37b87655b9146aa52874 (diff)
First working compile of refactor to add explicit typing to declarations
and support untyped empty collections and `none`s
Diffstat (limited to 'examples/learnxiny.tm')
-rw-r--r--examples/learnxiny.tm4
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/learnxiny.tm b/examples/learnxiny.tm
index a394e581..b585a2ab 100644
--- a/examples/learnxiny.tm
+++ b/examples/learnxiny.tm
@@ -59,7 +59,7 @@ func main():
my_numbers := [10, 20, 30]
# Empty arrays require specifying the type:
- empty_array := [:Int]
+ empty_array : [Int] = []
>> empty_array.length
= 0
@@ -123,7 +123,7 @@ func main():
= 0
# Empty tables require specifying the key and value types:
- empty_table := {:Text=Int}
+ empty_table : {Text=Int} = {}
# Tables can be iterated over either by key or key,value:
for key in table: