Skip to content

Latest commit

 

History

History
10 lines (8 loc) · 525 Bytes

File metadata and controls

10 lines (8 loc) · 525 Bytes

An array is a collection of objects of the same type T, stored in contiguous memory. Arrays are created using brackets [], and their size, which is known at compile time, is part of their type signature [T, ..size].

Slices are similar to arrays, but their size is not known at compile time. Instead, a slice is two-word object, the first word is a pointer to the data, and the second word is the length of the slice. Slices can be used to borrow a section of an array, and have &[T] as type signature.

{array.play}