https://github.com/lukechampine/nock
A simple Nock interpreter in Go
https://github.com/lukechampine/nock
nock urbit
Last synced: 3 months ago
JSON representation
A simple Nock interpreter in Go
- Host: GitHub
- URL: https://github.com/lukechampine/nock
- Owner: lukechampine
- License: mit
- Created: 2018-04-15T06:47:45.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2020-07-03T23:59:48.000Z (over 5 years ago)
- Last Synced: 2024-06-20T14:19:26.799Z (over 1 year ago)
- Topics: nock, urbit
- Language: Go
- Size: 7.81 KB
- Stars: 5
- Watchers: 4
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
nock
-----[](https://godoc.org/github.com/lukechampine/nock)
[](https://goreportcard.com/report/github.com/lukechampine/nock)```
go get github.com/lukechampine/nock
````nock` implements a simple Nock interpreter, according the spec available at
https://urbit.org/docs/nock/definition.This interpreter assumes that its input is well-formed, and does not
support atoms larger than a machine `int`.### Example ###
```go
decrement := nock.Parse(`[42 [8 [1 0] 8 [1 6 [5 [0 7] 4 0 6]
[0 6] 9 2 [0 2] [4 0 6] 0 7] 9 2 0 1]]`)
program := nock.Cell(nock.Atom(42), decrement)
result := nock.Nock(program)
println(result) // 41
```