On this page

Existence unique๏ƒ

๐ŸŸข Beginner ยท Lesson 13

unique, studied closely - ONE instance for the whole world: root conduit, child scopes, everywhere. The widest sharing mode.

Before you run๏ƒ

Use the Beginner guide for prerequisite concepts. Run from a checkout with Melder installed and Python 3.14 free-threading selected. The collection download includes the level's local helper modules.

Run the saved script๏ƒ

python UX_and_AIX_experiences/01_beginner/13_existence_unique.py
py -3.14t UX_and_AIX_experiences/01_beginner/13_existence_unique.py

Download this collection ยท Source on GitHub

Public surface๏ƒ

md.Existence.unique

Code๏ƒ

 1"""
 2TIER: beginner (13)
 3GOAL: unique, studied closely - ONE instance for the whole world:
 4      root conduit, child scopes, everywhere. The widest sharing mode.
 5SURFACE EXERCISED: md.Existence.unique
 6"""
 7import melder as md
 8
 9
10class WorldClock:
11    pass
12
13
14def main() -> None:
15    book = md.Spellbook()
16    book.bind(spell=WorldClock, existence="unique")
17    root = book.conjure()
18    child = root.create_lesser_conduit()
19    grandchild = child.create_lesser_conduit()
20
21    instances = {root.meld(spell=WorldClock), child.meld(spell=WorldClock),
22                 grandchild.meld(spell=WorldClock)}
23    assert len(instances) == 1
24    print("unique: one WorldClock across three scopes")
25
26
27if __name__ == "__main__":
28    main()

Check the outcome๏ƒ

The script contains its own assertions or demonstrated refusal paths. Run it to evaluate those checks against your installed version. The code above is taken directly from the saved file; no run output is invented here.

More beginner examples ยท Level guide

API contracts๏ƒ