List

#import Builtin.List;

Contains the list data type

Functions


list<T>()

create :: list.T()

Creates a new empty list of the specified type T

list<T>(array)

create :: list.T(a : array.T)

Creates a new list of the specified type T from an array of the same type

Structs


list

A dynamically allocated list structure

Methods:

list.size()

size :: uint32()

Returns the number of elements in the list

Returns:

An integer representing the number of elements in the list

list.append(x)

append :: ref T(val : T)

Append an element to the end of the list like:

list.append(element)

Returns:

The element that was just added

list.at(i)

@tracked_caller: @inline:
at :: ref T(i : int)

Get an element of the list at the given index

Returns:

The element that was just added