ares/docs/proposal/nock.txt

38 lines
554 B
Plaintext
Raw Normal View History

2021-10-22 01:05:52 +03:00
## 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