The Vala Tutorial mentions the following methods and properties (and operators) for built-in arrays:
arr.length
arr += element
arr.resize()
arr.move()
(By "built-in arrays" I mean ones like int[] arr = new int[5]
, in contrast to the fancy data structures provided by GLib or Gee.)
My question: do such arrays support any more methods and properties? Where is this documented?
According to the compiler source code there should also be arr.copy()
:
https://gitlab.gnome.org/GNOME/vala/blob/master/vala/valaarraytype.vala
Also if you look at the unit tests you can see that slices (e.g. arr[1:5]
) are a feature of arrays:
https://gitlab.gnome.org/GNOME/vala/blob/master/tests/basic-types/arrays.vala
But I think thats it. The built-in array is pretty minimalistic.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With