SplitScript reference / Language / at
at
syntax
field: T at module-or-field, offset, ... | field: T? at module-or-field, offset, ...
Reads a persistent state field through a pointer path.
A string selects a module-relative pointer base, an integer selects an absolute base, and a sibling field name uses that field's candidate value as a dynamic base. Each following integer is an address offset. Sibling references are independent of declaration order, must stay within the active named layout, and may also appear in expression-backed fields. The compiler evaluates their dependency graph in order and rejects cycles. If a dependency fails, the dependent read is skipped and retains its previous accepted value. A required T field is a T! boundary: initialization waits for it, while a later failed read retains its last accepted value. An explicitly optional T? field instead accepts its own read failure as None and a successful read as Some(T), so absence is observable in current and old. The exact memory representation must be explicit or inferred from an exact use; optional read semantics require the T? annotation.
Examples
Read a pointer-backed field
score: i32 at 0x1000