🥞 FORTH STACK DIFFICULTY: Adept Structural

Bridge (Forth)

Decouple the spirit (abstraction) from the vessel (implementation).

✧ GANG OF FOUR LINEAGE & ARCANUM ✧
GOF DESIGN PATTERN: Bridge
ARCANUM SCHOOL: Necromancy // Vessel-Binding
SCRIBE / ARCHON: Joshua Edward McLaughlin Cox
CANONICAL REGISTRATION:
// FORTH PATTERN //
\ Vessel-Binding: The Bridge
\ Abstraction logic is separate from implementation via deferred words.

DEFER RENDER-VESSEL

: DRAW-BONE-GOLEM ( -- ) ." Rendering bone matrix." CR ;
: DRAW-FLESH-HOUND ( -- ) ." Rendering flesh sinews." CR ;

\ The Abstraction
: MANIFEST-ENTITY ( -- )
  ." Initiating dark ritual..." CR
  RENDER-VESSEL
  ." Entity is now corporeal." CR ;

\ Usage:
\ ' DRAW-BONE-GOLEM IS RENDER-VESSEL
\ MANIFEST-ENTITY
\ ' DRAW-FLESH-HOUND IS RENDER-VESSEL
\ MANIFEST-ENTITY

The Bridge pattern allows the ritual logic (abstraction) to remain unchanged while the manifestation (implementation) shifts. By assigning execution tokens (XTs) to DEFERred words, we bind different spirits to our conjuration routines on the fly.

Runic Tags: #structural #bridge #forth #vessels