## std.arrays: The array[T, size] primitive and associated functions. ## A stub module for documentation. Mostly compiler magic. ## Primitive fixed-size arrays. Their size is statically known at compile-time. @[magic] pub type array[T, size: static uint] ## Array access. Returns None if i is out of range. @[magic] pub func get[T, size: static uint](self: lent array[T, size], i: uint): lent T? ## Array access. Returns None if i is out of range. @[magic] pub func get[T, size: static uint](self: mut array[T, size], i: uint): mut T? ## Array mutation. # todo: how do we detect range errors? @[magic] pub func set[T, size: static uint](self: mut array[T, size], i: uint, val: T): Success[IndexOutOfBounds] ## A helper function to get the length of an array. ## Known to the compiler, and computed at compile-time. @[inline] pub func len[T, size: static uint](self: lent array[T, size]): uint = size type ArrayIter[T, size: static uint] = struct ... pub func iter[T, size: static uint](self: array[T, size]): ArrayIter[T, S] = ... # todo: Eq, PartialEq, Ord, PartialOrd