Introduce "array[N] T" and "slice T" type syntax

This commit is contained in:
Nigel Tao committed 2018-04-05 22:21:08 +10:00
1 parent 2b91e7861c
commit d33db6dae0
15 files changed
+83 -68

No files matched your search

+3 -3
View File
@@ -78,9 +78,9 @@ Converting an expression `x` to the type `T` is written as `x as T`.
## Types
Types read from left to right: `ptr [100] u32` is a pointer to a 100-element
array of unsigned 32-bit integers. `ptr` here means a non-null pointer. Use
`nptr` for a nullable pointer type.
Types read from left to right: `ptr array [100] u32` is a pointer to a
100-element array of unsigned 32-bit integers. `ptr` here means a non-null
pointer. Use `nptr` for a nullable pointer type.
Integer types can also be refined: `var x u32[10..20]` defines a variable x
that is stored as 4 bytes (32 bits) and can be combined arithmetically (e.g.