2020-02-13 18:59:53 +03:00
|
|
|
```ucm:hide
|
2024-06-12 01:22:09 +03:00
|
|
|
scratch/main> builtins.merge
|
2020-02-13 18:59:53 +03:00
|
|
|
```
|
|
|
|
|
2019-11-08 00:24:54 +03:00
|
|
|
First we add some code:
|
|
|
|
|
|
|
|
```unison
|
|
|
|
x = 0
|
|
|
|
y = x + 1
|
|
|
|
z = y + 2
|
|
|
|
```
|
|
|
|
|
|
|
|
```ucm
|
2024-06-12 01:22:09 +03:00
|
|
|
scratch/main> add
|
2019-11-08 00:24:54 +03:00
|
|
|
```
|
|
|
|
|
|
|
|
Now we edit `x` to be `7`, which should make `z` equal `10`:
|
|
|
|
|
|
|
|
```unison
|
|
|
|
x = 7
|
|
|
|
```
|
|
|
|
|
|
|
|
```ucm
|
2024-06-12 01:22:09 +03:00
|
|
|
scratch/main> update
|
|
|
|
scratch/main> view x y z
|
2019-11-08 00:24:54 +03:00
|
|
|
```
|
|
|
|
|
|
|
|
Uh oh! `z` is still referencing the old version. Just to confirm:
|
|
|
|
|
|
|
|
```unison
|
|
|
|
test> t1 = if z == 3 then [Fail "nooo!!!"] else [Ok "great"]
|
|
|
|
```
|
|
|
|
|
|
|
|
```ucm
|
2024-06-12 01:22:09 +03:00
|
|
|
scratch/main> add
|
|
|
|
scratch/main> test
|
2019-11-08 00:24:54 +03:00
|
|
|
```
|