Nitpick Any Type & Special Sentinel Values

Nitpick provides specific primitive types and sentinel values to handle memory abstraction, missing states, and hard errors safely.

1. The any Type

The any type acts as Nitpick’s equivalent to C’s void*. It is used to represent an untyped pointer to raw memory. This is critical for building custom allocators, passing buffers to external C functions, or working with wild memory.

// Allocating 1024 bytes of raw, untyped memory
wild any->:raw_buffer = alloc(1024i64);

(Note: Unlike C, Nitpick separates the any type (for untyped pointers) from void (which is strictly used in extern function signatures to indicate no return value).)

2. Special Sentinel Values

Nitpick uses uppercase keywords for distinct, fundamental “no value” or “error” states to prevent confusion.

int32->:my_ptr = NULL;        // Represents no memory address
int32?:optional_val = NIL;    // Represents no value present

tbb32:state = ERR;            // Represents a persistent error state

(Note: There is also the unknown sentinel, which represents a soft error from a math or bounds fault. See safety_systems_specs.txt for details on how unknown propagates).