mirror of
https://github.com/urbit/ares.git
synced 2024-12-25 14:23:06 +03:00
38 lines
554 B
Plaintext
38 lines
554 B
Plaintext
## sample eval
|
|
|
|
### nock 6
|
|
```
|
|
*[a 6 b c d]
|
|
*[a *[[c d] 0 *[[2 3] 0 *[a 4 4 b]]]]
|
|
*[a *[[c d] 0 *[[2 3] 0 +*[a 4 b]]]]
|
|
*[a *[[c d] 0 *[[2 3] 0 ++*[a b]]]]
|
|
```
|
|
#### if *[a b] is 0
|
|
```
|
|
*[a *[[c d] 0 *[[2 3] 0 ++0]]]
|
|
*[a *[[c d] 0 *[[2 3] 0 +1]]]
|
|
*[a *[[c d] 0 *[[2 3] 0 2]]]
|
|
*[a *[[c d] 0 2]]
|
|
*[a c]
|
|
```
|
|
#### if *[a b] is 1
|
|
```
|
|
*[a *[[c d] 0 *[[2 3] 0 ++1]]]
|
|
*[a *[[c d] 0 *[[2 3] 0 +2]]]
|
|
*[a *[[c d] 0 *[[2 3] 0 3]]]
|
|
*[a *[[c d] 0 3]]
|
|
*[a d]
|
|
```
|
|
|
|
### nock 9
|
|
*[a 9 b c]
|
|
*[*[a c] 2 [0 1] 0 b]
|
|
(d=*[a c])
|
|
*[*[d 0 1] *[d 0 b]]
|
|
*[d *[d 0 b]]
|
|
|
|
|
|
|
|
## impl notes
|
|
|