...
Operation | Description | Syntax | Example | Result Value | Result Type |
---|---|---|---|---|---|
creates a set from elements | mkset (ele_1, ... ,ele_n) | mkset (1.33,2,3,4) | {1.33, 2, 3, 4} | set(float) | |
Checks if a set is empty | isempty (set) | isempty ({1, 2, 3}) | false | bool | |
Returns the length of a set | length (set) | length ({1, 20, 3, 4, 20, 20}) | 4 | int | |
size | Returns the length of a set | size (set) | size ({1, 20, 3, 4, 20, 20}) | 4 | int |
Checks the occurrence of | has (set, ele) | has ({31, 2, 77}, 77) | true | bool | |
Checks the occurrence of | `in` (ele, set) | `in` (77, {30, 2, 77}) | true | bool | |
Checks whether a set | has (set_1, set_2) | has ({1, 2 , 3, 4}, {2, 1}) | true | bool | |
Checks whether a set | `in` (set_1, set_2) | `in` ({1, 2 , 3, 4}, {2, 1}) | false | bool | |
Adds some value to a set | add (set, ele) | add ({30, "Peter", 77}, “Ann") | {30, Peter, 77, Ann} | set(str) | |
Union of two sets | add (set_1, set_2) | add ({5, "Peter", 77}, {77, "Ann", 400}) | {5, Peter, 77, Ann, 400] | set(str) | |
Joins the strings of a given | join (set_str) | join ({1, "Peter", 77, 77, "Ann"}) | 1Ann77Peter | str | |
Intersection of two sets | band (set_1, set_2) | band ({30, 2, 77}, {77, 400}) | {77} | set(int) | |
Deletes a value from a set | sub (set, ele) | sub ({30, 2, 77}, 400) | {30, 2, 77} | •set(int) | |
Difference of two sets | sub (set_1, set_2) | sub ({30, 2, 77}, {400, 30}) | {2, 77} | set(int) |
...
Operation | Description | Syntax | Example | Result Value | Result Type | ||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Creates an array from elements | mkarray (ele_1, … ,ele_n) | mkarray (1.33,2,3,4) mkarray (“One", "two", "Number 3“) [ “One", 77 ] mkarray (domain, responseTime) | [1.33, 2, 3, 4] | array(float) array(str) array(str) array(str) | |||||||
Checks if an array is empty | isempty (array) | isempty ([1, 2, 3]) isempty ([ ]) | false true | bool | |||||||
Returns the length of an array | length (array) | length ([1, 2, 3, 4, 5, 6]) | 6 | Int | size | Returns the length of an array | size (array) | size ([1, 2, 3, 4, 5, 6]) | 6 | Int | |
Checks the occurrence of a specified value in a given array | •has (array, ele) •array -> ele | has ([30, 2, 77], 77) [30, 2, 77] -> 77 | true true | bool | |||||||
Checks the occurrence of a specified value in a given array | `in` (ele, array) ele <- array | `in` (77, [30, 2, 77]) 77 <- [30, 2, 77] | true true | bool | |||||||
Appends some value to the end of an array | add (array, ele) | add ([30, "Peter", 77], "Ann") | [30, Peter, 77, Ann] | array(str) | |||||||
Concatenates two arrays | add (array_1, array_2) | add ([5, "Peter", 77], [77, "Ann", 400]) | [5, Peter, 77, 77, Ann, 400] | array(str) | |||||||
Joins the strings of a given | join (array_str) | join ([1, "Peter", 77, 77, "Ann"]) | 1Peter7777Ann | str | |||||||
Returns the n-th element of | at (array, n) | at ([10, 20, 3.33, 40], 1) | 20 | float | |||||||
Returns a subarray between | at (array, from, to) | at ([10, 20, 30, 40], 1, 3) | [20, 30] | array(int) | |||||||
Returns the index of the first | indexof (array, ele) | indexof ([10, 20, 3.33, 40], 3.33) | 2 | int | |||||||
Drops null elements of a given array | dropnulls (array) | dropnulls ([3, null, 77, null]) | [3, 77] | array(int) | |||||||
Sorts the elements of a | sort (array) | sort ([3, 77, 30, 1) | [1, 3, 30, 77] | array(int) | |||||||
Reverses the elements of | reverse | reverse ([3, 77, 30, 1) | [1, 30, 77, 3] | array(int) | |||||||
Sums the values of a | sum (array) | sum([1,2,3,4]) | 10 | Int |
...