The Composite
Treating individual spells and grand rituals uniformly through recursive lists.
✧ GANG OF FOUR LINEAGE & ARCANUM ✧
GOF DESIGN PATTERN: Composite
ARCANUM SCHOOL: Transmutation // Synthesis
SCRIBE / ARCHON: Joshua Edward McLaughlin Cox
CANONICAL REGISTRATION:
// SCHEME PATTERN //
(define (execute-magic node)
(if (list? node)
(for-each execute-magic node)
(display (string-append "Executing: " (symbol->string node) "\n"))))
(define grand-ritual
(list 'draw-circle
(list 'ignite-candles 'chant-incantation)
'summon-demon))
(execute-magic grand-ritual)
By utilizing Scheme’s intrinsic tree structures (lists of lists), the composite pattern is natively woven into the language’s fabric.
Runic Tags:
#structural
#scheme
#recursion
#trees