aboutsummaryrefslogtreecommitdiff
path: root/example.tsl
diff options
context:
space:
mode:
Diffstat (limited to 'example.tsl')
-rw-r--r--example.tsl33
1 files changed, 30 insertions, 3 deletions
diff --git a/example.tsl b/example.tsl
index 6f165ed..501ddaa 100644
--- a/example.tsl
+++ b/example.tsl
@@ -2,7 +2,7 @@
# setv "value1"
value1 = 1
-# loadn 1
+# loadn 2
# setv "value1"
value1 = 2
@@ -21,7 +21,7 @@ value4 = "hello world"
# loads "hello"
# loads "world"
# loadn 5
-# list "value5", 3
+# list 3
# setv "value5"
value5 = ["hello", "world", 5]
@@ -33,9 +33,19 @@ value5 = ["hello", "world", 5]
# setv "value6"
value6 = {"hello": "world", "value": 23}
-
+# loadf 1 // loadf1 begins at once, because the file body itself is function 0
+# setv "value7"
value7 = fn () {}
+
+# loadf 2
+# setv "value8"
value8 = fn (value) {}
+
+# loads "hello"
+# loads "world"
+# loads "sayHello"
+# loadf 3
+# map 4
value9 = {
"hello": "world",
"sayHello": fn() {
@@ -43,9 +53,26 @@ value9 = {
}
}
+# loadv "value9"
+# loadm "hello"
+# mindex
+# setv "str"
str = value9["hello"]
+
+# loadv "value9"
+# loadm "sayHello"
+# mindex
+# callf 0
value9["sayHello"]()
+# loadv "value1"
+# loadn 23
+# add
+# setv "value1"
value1 = value1 + 23
+# loadca "curl"
+# loadca "https://example.com"
+# callc 2
+# setv "response"
response = $(curl https://example.com) \ No newline at end of file