aboutsummaryrefslogtreecommitdiff
path: root/std/prelude/arrays.pk
diff options
context:
space:
mode:
Diffstat (limited to 'std/prelude/arrays.pk')
-rw-r--r--std/prelude/arrays.pk14
1 files changed, 7 insertions, 7 deletions
diff --git a/std/prelude/arrays.pk b/std/prelude/arrays.pk
index 6f57865..d8512dd 100644
--- a/std/prelude/arrays.pk
+++ b/std/prelude/arrays.pk
@@ -3,28 +3,28 @@
## Primitive fixed-size arrays. Their size is statically known at compile-time.
@[magic]
-pub type array[T, size: static uint]
+pub type array[T, size: const 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?
+pub func get[T, size: const 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?
+pub func get[T, size: const 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]
+pub func set[T, size: const 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
+pub func len[T, size: const uint](self: lent array[T, size]): uint = size
-type ArrayIter[T, size: static uint] = struct
+type ArrayIter[T, size: const uint] = struct
...
-pub func iter[T, size: static uint](self: array[T, size]): ArrayIter[T, S] =
+pub func iter[T, size: const uint](self: array[T, size]): ArrayIter[T, S] =
...
# todo: Eq, PartialEq, Ord, PartialOrd