State in Whitespace
Shifting the behavior of an entity as its internal reality changes.
✧ GANG OF FOUR LINEAGE & ARCANUM ✧
GOF DESIGN PATTERN: State
ARCANUM SCHOOL: Transmutation // Polymorphism
SCRIBE / ARCHON: Joshua Edward McLaughlin Cox
CANONICAL REGISTRATION:
// CODEX INCANTATION //
The Shifting Sands of Behavior
The State pattern allows an object to alter its behavior when its internal state changes, appearing to change its class. In Whitespace, “class” is an illusion; only execution flow is real.
By storing a state function pointer in a specific heap address, the unseen construct delegates its behavior. When the state changes, the program simply updates that heap address with a new label pointer.
Subsequent invocations read the pointer and jump to the new logic block. The entity remains structurally identical in memory, yet its reaction to the same stimuli is profoundly altered.
Runic Tags:
#unseen-sigils
#behavioral
#state
#whitespace