🐎 PONY WARD DIFFICULTY: Archmage Behavioral

The Interpreter Ward

Parsing ancient runes.

✧ GANG OF FOUR LINEAGE & ARCANUM ✧
GOF DESIGN PATTERN: Interpreter
ARCANUM SCHOOL: Divination // Rune Decoding
SCRIBE / ARCHON: Joshua Edward McLaughlin Cox
CANONICAL REGISTRATION:
// PONY PATTERN //
trait val Expression
  fun evaluate(context: Context ref): Bool

class val RuneMatch is Expression
  let _rune: String
  new create(r: String) => _rune = r
  fun evaluate(context: Context ref): Bool => context.has(_rune)

The Interpreter Ward

Grammars map nicely to immutable val classes, interpreting runes efficiently and safely within a local execution context.

Runic Tags: #pony #interpreter