Expand description
Lean’s Array: a growable sequence of objects, updated in place when nothing else
refers to it.
As in lean.h: an argument named a that a function changes is consumed, indexes and
arrays that are only read are borrowed, stored values are consumed, and results are owned
unless the function’s name ends in borrowed.
Functions§
- array_
fget ⚠ - array_
fget_ ⚠borrowed - array_
fset ⚠ - array_
fswap ⚠ - array_
get ⚠ - array_
get_ ⚠borrowed - The element at
i. Lean’sarr[i]!: an index outside the array is a panic. - array_
get_ ⚠size - array_
mark_ ⚠linear - Lean’s debugging aid for finding accidental copies of an array. The mark has no effect on values, and this runtime does not track it.
- array_
mk ⚠ - An array from a
List, which it consumes. - array_
pop ⚠ - Removes the last element, if there is one.
- array_
propagate_ ⚠mark - See
array_mark_linear. Returnstarget. - array_
push ⚠ - array_
set ⚠ - Lean’s
arr.set! i v: an index outside the array is a panic. - array_
size ⚠ - array_
swap ⚠ - Swaps two elements; does nothing if an index is outside the array.
- array_
to_ ⚠list - The elements as a
List. Consumesa. - array_
uget ⚠ - array_
uget_ ⚠borrowed - array_
uset ⚠ - array_
uswap ⚠ - elements⚠
- The elements of an array.
- from_
vec - A new array that owns
items. - into_
vec ⚠ - The elements of an array nothing else refers to, with the references it held. Gives up the array.
- mk_
array ⚠ - An array of
nreferences tovalue. Consumes both. - mk_
empty_ ⚠array_ with_ capacity