Nitpick Pointer System

Nitpick strictly separates reference assignment, dereferencing, and member access operators to ensure code readability and prevent the ambiguity common in C/C++ (where * is overloaded for multiplication and dereferencing).

1. Pointer Type Declaration (->)

To declare a pointer to a type, use the -> operator affixed to the end of the base type. This visually indicates “points to”.

// 'ptr' is a pointer to an int32
int32->:ptr = NULL;

// A pointer to a pointer
int32->->:double_ptr = NULL;

2. Address-Of Operator (@)

To acquire the memory address of an existing variable, use the @ operator.

int32:x = 42i32;
int32->:ptr = @x;

3. Direct Member Access (.)

For standard structs and objects (not pointers), use the dot . operator to access fields or methods directly.

struct:Point = {
    int32:x;
    int32:y;
};

Point:p = Point{x: 10i32, y: 20i32};
int32:val = p.x;

4. Dereferencing Member Access (->)

When you hold a pointer to a struct or object, use the -> operator to both dereference the pointer and access the member field in a single step (identical to C).

Point->:ptr = @p;
int32:val = ptr->x;

5. Full Pointer Dereference (<-)

To perform a complete “deep” dereference of a pointer (extracting the raw underlying value or struct directly), use the <- operator prefixed to the pointer variable.

int32:x = 42i32;
int32->:ptr = @x;

// Extracts the underlying int32 value
int32:y = <-ptr;

Point:p = Point{x: 10i32, y: 20i32};
Point->:p_ptr = @p;

// Extracts a full copy of the underlying Point struct
Point:p_copy = <-p_ptr;