Skip to content

Commit dcfff21

Browse files
committed
Document new List APIs
1 parent ac14ac6 commit dcfff21

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

stdlib.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,8 @@ This module provides extensions to the built-in `List` type.
156156
* `join(sep=", ")`: Returns a string representation of the list elements joined by `sep` (or ", " if sep is omitted).
157157
* `contains(x)`: Returns `true` if the list contains element `x`, `false` otherwise.
158158
* `type func from_function(f, n: Int)`: Creates a new list of length `n`, where each element is the result of calling function `f` with its index.
159+
* `type func filled(x, n: Int)`: Creates a new list of length `n`, where each element is `x`.
160+
* `type func new_with_capacity(n: Int)`: Creates a new list with preallocated storage for `n` elements. If `n` is negative, 0 is used instead.
159161
* `op_equals(rhs: List)` (Operator `==`): Compares this list for equality with `rhs`.
160162
* `op_add(rhs: List)` (Operator `+`): Returns a new list that is the concatenation of this list and `rhs`.
161163
* `quicksort_with_comparator(f)`: Sorts the list in-place using the Quicksort algorithm with a custom comparison function `f`. The function `f(a, b)` should return `true` if `a` should come before `b`.

0 commit comments

Comments
 (0)