Skip to content

Seq[A: A]

[Source]

A mutable sequence of elements.

Types with a fixed number of elements that can be read and written by index implement this interface. For sequences that can grow and shrink, see ResizableSeq.

interface ref Seq[A: A]

Public Functions

size

[Source]

Returns the number of elements in the sequence.

fun box size()
: USize val

Returns


apply

[Source]

Returns the i-th element of the sequence. Raises an error if the index is out of bounds.

fun box apply(
  i: USize val)
: this->A ?

Parameters

Returns

  • this->A ?

update

[Source]

Replaces the i-th element of the sequence, returning the previous value. Raises an error if the index is out of bounds.

fun ref update(
  i: USize val,
  value: A)
: A^ ?

Parameters

Returns

  • A^ ?

values

[Source]

Returns an iterator over the elements of the sequence.

fun box values()
: Iterator[this->A] ref^

Returns