#!/usr/bin/env tsl # loadn 1 # setv "value1" value1 = 1 # loadn 2 # setv "value1" value1 = 2 # loadb true # setv "value2" value2 = true # loadnull # setv "value3" value3 = null # loads "hello world" # setv "value4" value4 = "hello world" # loadv "value4" # loadn 0.000000 # index # setv "c" #c = value4[0] # loads "hello" # loads "world" # loadn 5 # list 3 # setv "value5" value5 = ["hello", "world", 5] # loadv "value5" # loadn 0 # index # setv "list_index_value" list_index_value = value5[0] # loadn 1 # loadn 2 # list 2 # setv "list1" list1 = [1, 2] # loadn 3 # loadn 4 # list 2 # setv "list2" list2 = [3, 4] # loadv "list1" # loadv "list2" # add # setv "list3" list3 = list1 + list2 # loads "hello" # loads "world" # loads "value" # loadn 23 # map 4 # 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 # setv "value9" value9 = { "hello": "world", "sayHello": fn() { result = $(echo hello) } } # loadv "value9" # loads "hello" # index # setv "str" str = value9["hello"] # loadv "value9" # loads "sayHello" # index # callf 0 value9["sayHello"]() # loadv "value1" # loadn 23 # add # setv "value1" value1 = value1 + 23 # loads "world" # setv "arg" arg = "world" # loads "echo" # loads "hello" # loadv "arg" # callc 3 # setv "response" response = $(echo hello $arg) # compile error (empty command): $()