The Composite
Treating single elemental motes and complex runic clusters uniformly via boxing.
✧ GANG OF FOUR LINEAGE & ARCANUM ✧
GOF DESIGN PATTERN: Composite
ARCANUM SCHOOL: Transmutation // Tree Weaving
SCRIBE / ARCHON: Joshua Edward McLaughlin Cox
CANONICAL REGISTRATION:
// CODEX INCANTATION //
NB. A tree structure using boxed arrays
leaf1 =: <'Spark'
leaf2 =: <'Ember'
cluster =: < leaf1 , leaf2
root =: < cluster , <'Flame'
NB. Uniform operation (flatten and count)
count_motes =: # @: S: 0
NB. Usage: count_motes root
J’s boxed arrays naturally form composite tree structures. L: and S: (Level and Spread) operate uniformly on these trees.
Runic Tags:
#composite
#trees
#boxing
#recursive