The Command
Encapsulating arcane rituals as executable stack closures for delayed invocation.
β§ GANG OF FOUR LINEAGE & ARCANUM β§
GOF DESIGN PATTERN: Command
ARCANUM SCHOOL: Enchantment // Domination
SCRIBE / ARCHON: Joshua Edward McLaughlin Cox
CANONICAL REGISTRATION:
// WASM PATTERN //
(module
(type $command (func))
(table 1 funcref)
(elem (i32.const 0) $smite_command)
(func $smite_command
;; Execution logic
)
(func $execute_command (param $cmd_idx i32)
(call_indirect (type $command) (local.get $cmd_idx))
)
)
The Command
To delay the execution of a destructive ritual, one must encapsulate its essence. The Command pattern binds the parameters and the invocation into a single stack closure, storing it in the funcref table to be unleashed at the optimal moment.
Runic Tags:
#WASM
#Command
#Enchantment