summaryrefslogtreecommitdiff
path: root/docs/type_system/shared.md
blob: 2af408d873c900bef8ba3345fe8190b2919b890a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# Shared

---

Hold multiple references to the same object

```text
Shared[[] Type]
```

# Garbage Collection

A tracing mark and sweep garbage collector is used

# Mutating

```text
x : Shared[Array] $ (1; 2; 3)
^ x {[y]
    y `push 4
}
`log x // Shared[Array[I64]] $ (1; 2; 3; 4)
```