Types
Types
There are 4 types in this language: number, string, bool, and array
Numbers
Numbers can be created using 0-9 and can be used for different forms of math. The type constant for number is tn.
...
output = arrex.evaluate([1, 2, 3], "e1( (x + 2) * 3)") #Returns [9, 12, 15]
...
Strings
Strings can be created with double quotes ("") and can also take the place of arrays in most functions. The type constant for strings is ts.
...
output = arrex.evaluate([1, 2, 3], ' "Hello " + "World" ') #Returns "Hello World"
...
Bools
Bools are either True or False and can be created with T/F, boolean operators, or some other functions. The type constant for bool is tb.
...
output = arrex.evaluate([1, 2, 3], "e1(x > 1)") #Returns [False, True, True]
...
Arrays
Arrays are lists of elements. Many functions return them and they can be explicity created with arK() where k is how many times to repeat what is inside of it. The type constant for arrays is ta.
...
output = arrex.evaluate([1, 2, 3], "ar2(1, 2, 3, 4)") #Returns [1, 2, 3, 4, 1, 2, 3, 4]
...
Examples of Type Checking (Not ArrEx Code)
30 ~= tn #True
"Hello" ~= tn #False
T ~= tb #True
"World" ~= ta #False