Skip to content

$container

Search and sort lists.

15 natives. Read-only natives only look things up; the rest change something. Parameter types use the language's names (Types).

clear

read-only
$container.clear(list: list)

Clears the list passed in without generating a new list.

ParameterTypeMeaning
listlistThe list to clear.

concat

read-only
$container.concat(a: list, b: list) -> list

Append the contents of one list with another.

ParameterTypeMeaning
alistThe first list.
blistThe second list.

Returns list: The concatenated list.

copy

read-only
$container.copy(source: list) -> list

Generate a new list that contains all the same elements as another.

ParameterTypeMeaning
sourcelistThe list to copy.

Returns list: The copy of the source list.

find

read-only
$container.find(list: list, value: var) -> int

Find a value in a list.

ParameterTypeMeaning
listlistThe list.
valuevarThe value to find.

Returns int: The found index, or -1.

get_capacity

read-only
$container.get_capacity(list: list) -> int

Get the capacity of the specified list.

ParameterTypeMeaning
listlistThe list to get the capacity of.

Returns int: The capacity of the specified list; otherwise 0 in the event of an error.

insert

read-only
$container.insert(list: list, index: int, value: var) -> list

Insert a value into a list.

ParameterTypeMeaning
listlistThe list.
indexintThe index at which to insert the item.
valuevarThe value to insert

Returns list: The resulting list.

insert_in_place

read-only
$container.insert_in_place(list: list, index: int, value: var)

Insert a value into an owned list without creating a new one. Warning: This only works on temporary lists. Cannot be used on lists that are members of components aka mutable lists (this would not be thread-safe).

ParameterTypeMeaning
listlistThe list.
indexintThe index at which to insert the item.
valuevarThe value to insert

pop

read-only
$container.pop(list: list) -> list

Invoke a value's pop method e.g. pop a value off the back of a list.

ParameterTypeMeaning
listlistThe list.

Returns list: The resulting list.

popn

read-only
$container.popn(list: list, pop_count: int) -> list

Invoke a value's popn method e.g. popn a values off the back of a list.

ParameterTypeMeaning
listlistThe list.
pop_countintThe number of items to trim off the end of the list.

Returns list: The resulting list.

push

read-only
$container.push(list: list, value: var) -> list

Push a value onto the back of a list.

ParameterTypeMeaning
listlistThe list.
valuevarThe value to push

Returns list: The resulting list.

remove

read-only
$container.remove(list: list, index: int) -> list

Remove a value from a list.

ParameterTypeMeaning
listlistThe list.
indexintThe index of the element to remove.

Returns list: The resulting list.

remove_in_place

read-only
$container.remove_in_place(list: list, index: int)

Remove a value from an owned list without creating a new one. Warning: This only works on temporary lists. Cannot be used on lists that are members of components aka mutable lists (this would not be thread-safe).

ParameterTypeMeaning
listlistThe list.
indexintThe index of the element to remove.

rotate

read-only
$container.rotate(list: list, delta: int) -> list

Rotates the position of all list entries by a given delta.

ParameterTypeMeaning
listlistThe list.
deltaintNew_index for element e = (old_index + delta) % count. Can be + or -

Returns list: The resulting list.

shuffle

read-only
$container.shuffle(list: list) -> list

Shuffles the given list using Fisher-Yates.

ParameterTypeMeaning
listlistThe list.

Returns list: The resulting list.

shuffle_in_place

read-only
$container.shuffle_in_place(list: list)

Shuffles the given list using Fisher-Yates. Warning: This only works on temporary lists. Cannot be used on lists that are members of components aka mutable lists (this would not be thread-safe).

ParameterTypeMeaning
listlistThe list.