❄️ SNOBOL HEX DIFFICULTY: Adept Structural

The Bridge of Snobol

Separating abstraction from implementation using indirect jumps.

✧ GANG OF FOUR LINEAGE & ARCANUM ✧
GOF DESIGN PATTERN: Bridge
ARCANUM SCHOOL: Transmutation // Ethereal Bridge
SCRIBE / ARCHON: Joshua Edward McLaughlin Cox
CANONICAL REGISTRATION:
// SNOBOL PATTERN //
        * Bridge Pattern in SNOBOL4
        DEFINE('CAST_SPELL(SPELL, IMPL)')

        CAST_SPELL('FIREBALL', 'WAND')
        CAST_SPELL('FIREBALL', 'STAFF')
        :(END)

CAST_SPELL
        OUTPUT = 'Casting ' SPELL ' using ' IMPL :(RETURN)
END

By splitting the spell from the focus (wand or staff), the Bridge allows both to vary independently. The caster merely provides both components to the conjuration function.

Runic Tags: #snobol #structural #bridge