The Builder Incantation
Step-by-step assembly of complex symbolic expressions through transformation rules.
✧ GANG OF FOUR LINEAGE & ARCANUM ✧
GOF DESIGN PATTERN: Builder
ARCANUM SCHOOL: Transmutation // Constructmancy
SCRIBE / ARCHON: Joshua Edward McLaughlin Cox
CANONICAL REGISTRATION:
// MATHEMATICA PATTERN //
(* The Base Construct *)
ClearAll[Golem, AddHead, AddTorso, AddLimbs, Animate];
(* Step-by-step Builders returning an updated expression *)
AddHead[material_][golem_] := Append[golem, Head -> material];
AddTorso[material_][golem_] := Append[golem, Torso -> material];
AddLimbs[material_][golem_] := Append[golem, Limbs -> material];
Animate[golem_] := Prepend[golem, Status -> "Animated"];
(* The Director Ritual using Composition *)
BuildClayGolem = RightComposition[
AddHead["Clay"],
AddTorso["Clay"],
AddLimbs["Clay"],
Animate
];
BuildIronGolem = RightComposition[
AddHead["Iron"],
AddTorso["Iron"],
AddLimbs["Iron"],
Animate
];
(* Usage *)
baseGolem = {Name -> "Nameless"};
clayGolem = BuildClayGolem[baseGolem];
ironGolem = BuildIronGolem[baseGolem];
Print[clayGolem];
Print[ironGolem];
Runic Tags:
#creation
#assembly
#composition
#symbols