2024-06-03 20:43:21 +03:00
|
|
|
```ucm
|
2024-06-12 01:22:09 +03:00
|
|
|
scratch/main> builtins.merge
|
2024-06-03 20:43:21 +03:00
|
|
|
```
|
|
|
|
|
2024-06-03 20:56:33 +03:00
|
|
|
First, lets create two namespaces. `foo` and `bar`, and add some definitions.
|
2024-06-03 20:43:21 +03:00
|
|
|
|
|
|
|
```unison
|
2024-06-03 20:56:33 +03:00
|
|
|
foo.x = 42
|
|
|
|
foo.y = 100
|
|
|
|
bar.z = x + y
|
2024-06-03 20:43:21 +03:00
|
|
|
```
|
|
|
|
|
|
|
|
```ucm
|
2024-06-12 01:22:09 +03:00
|
|
|
scratch/main> add
|
2024-06-03 20:43:21 +03:00
|
|
|
```
|
|
|
|
|
|
|
|
Let's see what we have created...
|
2024-06-03 20:56:33 +03:00
|
|
|
|
2024-06-03 20:43:21 +03:00
|
|
|
```ucm
|
2024-06-12 01:22:09 +03:00
|
|
|
scratch/main> ls
|
2024-06-03 20:43:21 +03:00
|
|
|
```
|
2024-06-03 20:56:33 +03:00
|
|
|
|
2024-06-03 20:43:21 +03:00
|
|
|
Now, if we try deleting the namespace `foo`, we get an error, as expected.
|
|
|
|
|
2024-06-03 20:56:33 +03:00
|
|
|
```ucm:error
|
2024-06-12 01:22:09 +03:00
|
|
|
scratch/main> delete.namespace foo
|
2024-06-03 20:56:33 +03:00
|
|
|
```
|
2024-06-03 20:43:21 +03:00
|
|
|
|
2024-06-03 20:56:33 +03:00
|
|
|
Any numbered arguments should refer to `bar.z`.
|
2024-06-03 20:43:21 +03:00
|
|
|
|
|
|
|
```ucm
|
2024-06-12 01:22:09 +03:00
|
|
|
scratch/main> debug.numberedArgs
|
2024-06-03 20:56:33 +03:00
|
|
|
```
|
2024-06-03 20:43:21 +03:00
|
|
|
|
2024-06-03 20:56:33 +03:00
|
|
|
We can then delete the dependent term, and then delete `foo`.
|
2024-06-03 20:43:21 +03:00
|
|
|
|
2024-06-03 20:56:33 +03:00
|
|
|
```ucm
|
2024-06-12 01:22:09 +03:00
|
|
|
scratch/main> delete.term 1
|
|
|
|
scratch/main> delete.namespace foo
|
2024-06-03 20:43:21 +03:00
|
|
|
```
|