|
e.g.
a = [1, 2, 3] b = [0, 0, 0, 4, 5] arraycopy(a, b) b ==> [1, 2, 3, 4, 5]
|
array[start..end] returns a partial list of list. When length is omitted, it returns a partial list from start to the end.
e.g.
a = [1,2,3,4] a[1..2] ==> [2, 3] a[1] ==> [2, 3, 4]
|
map() applies function to each element of list and creates an array from the results.
e.g.
> map([1, 2, 3], function (x) x * 100) [100, 200, 300]
|
filter() applies function to each element of list and build an array from the elements that the function returns true.
e.g.
> filter([1, 2, 3], function (x) x > 1) [2, 3]
(int[])[1,2,3,4,5] (float[])[1,2,3,4,5] (byte[])[#1,#2,#3,#4,#5] (char[])['a', 'b'] (boolean[])[true, false] |
Array concatenation can be used for the same purpose.
int[0] + [1,2,3,4,5] float[0] + [1,2,3,4,5] byte[0] + [#1,#2,#3,#4,#5] char[0] + ['a', 'b'] boolean[0] + [true, false] |