You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: stdlib.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -156,6 +156,8 @@ This module provides extensions to the built-in `List` type.
156
156
*`join(sep=", ")`: Returns a string representation of the list elements joined by `sep` (or ", " if sep is omitted).
157
157
*`contains(x)`: Returns `true` if the list contains element `x`, `false` otherwise.
158
158
*`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.
159
161
*`op_equals(rhs: List)` (Operator `==`): Compares this list for equality with `rhs`.
160
162
*`op_add(rhs: List)` (Operator `+`): Returns a new list that is the concatenation of this list and `rhs`.
161
163
*`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