⚙️ ISABELLE RUNE DIFFICULTY: Apprentice Structural

The Proxy

Provide a surrogate or placeholder for a logical construct to control access or defer its evaluation.

✧ GANG OF FOUR LINEAGE & ARCANUM ✧
GOF DESIGN PATTERN: Proxy
ARCANUM SCHOOL: Transmutation // Illusion
SCRIBE / ARCHON: Joshua Edward McLaughlin Cox
CANONICAL REGISTRATION:
// ISABELLE PATTERN //
theory Proxy
  imports Main
begin

record secure_spell =
  secret_incantation :: string

definition proxy_cast :: "secure_spell \<Rightarrow> string \<Rightarrow> string option" where
  "proxy_cast spell password = 
    (if password = ''mellon'' then Some (secret_incantation spell) else None)"

end
Runic Tags: #isabelle #hol #transmutation #design-patterns