Skip to content

Instantly share code, notes, and snippets.

@ELLIOTTCABLE
Created September 6, 2015 00:39
Show Gist options
  • Save ELLIOTTCABLE/fe76e2facaa3a72c2a46 to your computer and use it in GitHub Desktop.
Save ELLIOTTCABLE/fe76e2facaa3a72c2a46 to your computer and use it in GitHub Desktop.
│ │ │ │
│ ▼
└ ─ ─ ─ ┐ ┌ ─ ┘ │ └ ─ ─ ─ ┐ ┌ ─ ┘ Ownership ┃
│ flows ┃
│ │ │ *............│.│.....* ↓down↓ ┃
□ □ │ : □ □ : ┃
┌─────────┐ │ : ┌─────────┐ : ┃
│ foo │ │ : │ foo │ : Thick line:┃
└─────────┘ │ : └─────────┘ : Active ϱ ┃
│ │ │ : ▲ │ : ━━━━━━━━━▶ ┃
└─┐ └─────────────┐ │ : ┗━┓ └─────────────┐ ┃
│ ▽ │ *••••••••••••┃•••••••* ▽ Thin line: ┃
▽ ┌────────┐ │ • ┃ • ┌────────┐ Owned ┃
┌─────────┐ │ widget │ │ • ╔═════════╗ • │ widget │ ─────────▷ ┃
│ bar │ └────────┘ │ • ║ bar ║░ • └────────┘ ┃
└─────────┘ │ • ╚═════════╝░ • Dot-line: ┃
│ │ │ • ░░┃░░░│░░░░ • Non-owned ┃
┌──┘ ─ ─ ─ ─ ─ ─ ─ ─ │ • ┏━━┛ ─ ─ ─ ─•─ ─ ─ ─ ─ ─ ─ ─ ─□ ┃
▽ □ │ • ▼ • □ ┃
┌───────┐ ┌─────────┐ │ • ┌───────┐ • ┌─────────┐ ┃
│ qux │ │ baz │ │ • │ qux │ • │ baz │ ┃
└───────┘ └─────────┘ │ • └───────┘ • └─────────┘ ┃
│ │ • ┃ • ┃
▽ │ • ▼ • ┃
┌───────┐ │ • ┌───────┐ • ┃
│ corge │ │ • │ corge │ • ┃
└───────┘ │ • └───────┘ • ┃
│ │ • ┃ • ┃
▽ │ • ▼ • ┃
┌───────┐ │ • ┌───────┐ • ▼
│grault │ │ • │grault │ •
└───────┘ │ • └───────┘ •
│ *••••••••••••••••••••*
┌─────────────────────────────────────┐ │ ┌─────────────────────────────────────┐
This is a data-structure, rooted on │ When something _adopts_ `bar`, not
`foo`, that flows through ‘ownership’ │ only is everything *below* it in the
links to everything else below, with │ graph locked ... but so is everything
the exception of `baz`, which isn't │ *directly above it* (like `foo`, its
‘owned’ by its' parent. │ direct parent.)
└─────────────────────────────────────┘ │ Notice, however, that `widget` is
│ outside the locked zone-of-influence:
│ `foo` isn't directly adopted; and
│ neither is `widget` involved in
│ `bar`'s ancestry. (That is, `widget`
│ can safely be adopted, without
│ conflicting with `bar`'s adoption.)
│ └─────────────────────────────────────┘
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment