🥞 FORTH STACK DIFFICULTY: Adept Behavioral

Command (Forth)

Encapsulate actions as pure Execution Tokens on the stack.

✧ GANG OF FOUR LINEAGE & ARCANUM ✧
GOF DESIGN PATTERN: Command
ARCANUM SCHOOL: Enchantment // Rune-Binding
SCRIBE / ARCHON: Joshua Edward McLaughlin Cox
CANONICAL REGISTRATION:
// FORTH PATTERN //
\ Rune-Binding: The Command Pattern
\ Treating actions as data using XTs (Execution Tokens).

: SPELL-HEAL ( -- ) ." Vitality restored." CR ;
: SPELL-HARM ( -- ) ." Flesh boils." CR ;

\ We push the XT of the spells to the stack and execute them later.
: CAST-STORED ( xt -- )
  ." Channeling stored rune... " EXECUTE ;

\ Usage:
\ ' SPELL-HEAL CAST-STORED
\ ' SPELL-HARM CAST-STORED

In Forth, the Command pattern is not an emulation—it is native. The Execution Token (XT), retrieved via the tick (') operator, perfectly encapsulates an action. It can be pushed to the stack, stored in variables, and invoked via EXECUTE at the whim of the necromancer.

Runic Tags: #behavioral #command #forth #runes