API Reference › Types › pointers
type

pointers

pointers

A pointers is a raw buffer whose elements are pointers: index it with buffer[i] to read or write a pointer, with no bounds checking. Allocate the storage with words(n) (a pointer fits in a slot) and type the binding as pointers so indexing uses the pointer element size. It is the low-level building block for hand-rolled data structures — a table of records made with new, a free list, a bucket array — for when you want manual control instead of a growable []T slice.

Example

program Records {
  property Position { column: int = 0, row: int = 0 }

  handler Setup phase Start {
    let slots: pointers = words(2)
    slots[0] = new Position
    slots[1] = new Position
    print(2)
  }
}
← All symbols