Fuzion Logo
fuzion-lang.dev — The Fuzion Language Portal
JavaScript seems to be disabled. Functionality is limited.

Mutable_Array

Mutable_Array

an interface defining a mutable array

NYI: Remove Sequence parent. Since Sequence is supposed to be immutable,
we should maybe not pretend to be a Sequence.

Functions

is this Sequence known to be array backed? If so, this means that operations
like index[] are fast.
count the number of elements in this Sequence.

Since we know the exact length, this is redefined to achive O(1) performance instead
of O(n) for counting the elements.

redefines:

the length of the array
the indices of the array
§index [ ] := (i i32, o Mutable_Array.T)
 => 
unit
:
Any 
set element at index i to o
§add(t Mutable_Array.T)
 => 
unit
:
Any 
add an element at the end of the sequence