λ SCHEME RUNE DIFFICULTY: Apprentice Structural

The Proxy

Controlling access to forbidden grimoires through intermediary spirits.

✧ GANG OF FOUR LINEAGE & ARCANUM ✧
GOF DESIGN PATTERN: Proxy
ARCANUM SCHOOL: Abjuration // Banishment
SCRIBE / ARCHON: Joshua Edward McLaughlin Cox
CANONICAL REGISTRATION:
// SCHEME PATTERN //
(define (read-forbidden-grimoire)
  "Eldritch secrets revealed.")

(define (make-grimoire-proxy true-name-known?)
  (lambda ()
    (if true-name-known?
        (read-forbidden-grimoire)
        "Access denied by the guardian spirit.")))

(define proxy (make-grimoire-proxy #f))
(proxy)

Closures trap the original invocation, allowing an intermediary logic to enforce constraints before the ancient powers are released.

Runic Tags: #structural #scheme #access-control #closures