2024-02-27 19:22:38 +03:00
|
|
|
If `foo#old` exists in old, and `foo#new` exists in new, you might think `upgrade old new` would rewrite references to
|
2024-07-10 17:46:18 +03:00
|
|
|
`#old` with references to `#new`. And it will... \!\!unless\!\! `#old` still exists in new.
|
2024-02-27 19:22:38 +03:00
|
|
|
|
2024-07-10 17:46:18 +03:00
|
|
|
``` unison
|
2024-02-27 19:22:38 +03:00
|
|
|
lib.old.foo = 18
|
|
|
|
lib.new.other = 18
|
|
|
|
lib.new.foo = 19
|
|
|
|
mything = lib.old.foo + lib.old.foo
|
|
|
|
```
|
|
|
|
|
2024-07-10 19:17:15 +03:00
|
|
|
``` ucm
|
2024-02-27 19:22:38 +03:00
|
|
|
|
|
|
|
Loading changes detected in scratch.u.
|
|
|
|
|
|
|
|
I found and typechecked these definitions in scratch.u. If you
|
|
|
|
do an `add` or `update`, here's how your codebase would
|
|
|
|
change:
|
|
|
|
|
|
|
|
⍟ These new definitions are ok to `add`:
|
|
|
|
|
|
|
|
lib.new.foo : Nat
|
|
|
|
lib.new.other : Nat
|
|
|
|
lib.old.foo : Nat
|
|
|
|
mything : Nat
|
|
|
|
|
|
|
|
```
|
2024-07-10 19:17:15 +03:00
|
|
|
``` ucm
|
2024-02-27 19:22:38 +03:00
|
|
|
foo/main> add
|
|
|
|
|
|
|
|
⍟ I've added these definitions:
|
|
|
|
|
|
|
|
lib.new.foo : Nat
|
|
|
|
lib.new.other : Nat
|
|
|
|
lib.old.foo : Nat
|
|
|
|
mything : Nat
|
|
|
|
|
|
|
|
foo/main> upgrade old new
|
|
|
|
|
|
|
|
I upgraded old to new, and removed old.
|
|
|
|
|
|
|
|
foo/main> view mything
|
|
|
|
|
|
|
|
mything : Nat
|
|
|
|
mything =
|
|
|
|
use Nat +
|
2024-02-27 20:32:18 +03:00
|
|
|
other + other
|
2024-02-27 19:22:38 +03:00
|
|
|
|
|
|
|
```
|