clear
read-only$container.clear(list: list)Clears the list passed in without generating a new list.
| Parameter | Type | Meaning |
|---|---|---|
list | list | The list to clear. |
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).
$container.clear(list: list)Clears the list passed in without generating a new list.
| Parameter | Type | Meaning |
|---|---|---|
list | list | The list to clear. |
$container.concat(a: list, b: list) -> listAppend the contents of one list with another.
| Parameter | Type | Meaning |
|---|---|---|
a | list | The first list. |
b | list | The second list. |
Returns list: The concatenated list.
$container.copy(source: list) -> listGenerate a new list that contains all the same elements as another.
| Parameter | Type | Meaning |
|---|---|---|
source | list | The list to copy. |
Returns list: The copy of the source list.
$container.find(list: list, value: var) -> intFind a value in a list.
| Parameter | Type | Meaning |
|---|---|---|
list | list | The list. |
value | var | The value to find. |
Returns int: The found index, or -1.
$container.get_capacity(list: list) -> intGet the capacity of the specified list.
| Parameter | Type | Meaning |
|---|---|---|
list | list | The list to get the capacity of. |
Returns int: The capacity of the specified list; otherwise 0 in the event of an error.
$container.insert(list: list, index: int, value: var) -> listInsert a value into a list.
| Parameter | Type | Meaning |
|---|---|---|
list | list | The list. |
index | int | The index at which to insert the item. |
value | var | The value to insert |
Returns list: The resulting list.
$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).
| Parameter | Type | Meaning |
|---|---|---|
list | list | The list. |
index | int | The index at which to insert the item. |
value | var | The value to insert |
$container.pop(list: list) -> listInvoke a value's pop method e.g. pop a value off the back of a list.
| Parameter | Type | Meaning |
|---|---|---|
list | list | The list. |
Returns list: The resulting list.
$container.popn(list: list, pop_count: int) -> listInvoke a value's popn method e.g. popn a values off the back of a list.
| Parameter | Type | Meaning |
|---|---|---|
list | list | The list. |
pop_count | int | The number of items to trim off the end of the list. |
Returns list: The resulting list.
$container.push(list: list, value: var) -> listPush a value onto the back of a list.
| Parameter | Type | Meaning |
|---|---|---|
list | list | The list. |
value | var | The value to push |
Returns list: The resulting list.
$container.remove(list: list, index: int) -> listRemove a value from a list.
| Parameter | Type | Meaning |
|---|---|---|
list | list | The list. |
index | int | The index of the element to remove. |
Returns list: The resulting list.
$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).
| Parameter | Type | Meaning |
|---|---|---|
list | list | The list. |
index | int | The index of the element to remove. |
$container.rotate(list: list, delta: int) -> listRotates the position of all list entries by a given delta.
| Parameter | Type | Meaning |
|---|---|---|
list | list | The list. |
delta | int | New_index for element e = (old_index + delta) % count. Can be + or - |
Returns list: The resulting list.
$container.shuffle(list: list) -> listShuffles the given list using Fisher-Yates.
| Parameter | Type | Meaning |
|---|---|---|
list | list | The list. |
Returns list: The resulting list.
$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).
| Parameter | Type | Meaning |
|---|---|---|
list | list | The list. |