The Prototype of Echo Spells
Cloning verified spells without needing to re-prove their correctness.
✧ GANG OF FOUR LINEAGE & ARCANUM ✧
GOF DESIGN PATTERN: Prototype
ARCANUM SCHOOL: Illusion // Cloning
SCRIBE / ARCHON: Joshua Edward McLaughlin Cox
CANONICAL REGISTRATION:
// CODEX INCANTATION //
module Prototype
noeq type spell = {
incantation: string;
mana_cost: nat;
clone: unit -> spell;
}
let rec base_spell () : spell = {
incantation = "Echo... echo...";
mana_cost = 10;
clone = (fun () -> base_spell ());
}
The Prototype pattern captures the essence of spell echoing, ensuring that cloned spells maintain the exact mana cost and properties of the original.
Runic Tags:
#prototype
#cloning
#echoes