Implement functions, arrays, maps, and while loops. Document and clean up code.

This commit is contained in:
2021-03-04 19:30:08 -08:00
parent 201030ed93
commit 53e0717b91
8 changed files with 475 additions and 111 deletions
+33 -1
View File
@@ -28,4 +28,36 @@ if (bool "true") {
This is a multiline comment
###
# This is a single line comment
# This is a single line comment
set hi to ["testovich", 3]
set hi[0] to "testo"
print $hi[0]
set hi to (append $hi with items [5, 4])
print {$hi[2] + $hi[3]}
set msi to [5: "hi", "hello": "world"]
set msi[5] to "hello"
print $msi[5]
print $msi["hello"]
set c to 0
set f to true
loop while $f {
set c to {$c + 1}
if {$c == 3} {
set f to false
}
print {"iter: " + (str $c)}
}
define hi {
print {"Hello, " + $_args[""]}
}
hi "Function"
hi "World"