on master help sign in
Merge branch 'master' of github.com:asgardiator/docs into cleanorg
4290670Tobias Merkle
@@ -1,6 +1,8 @@
1---
1---
2anchor: none
2anchor: none
3footer: true
3footer: true
4+title: Develop
5+sort: 4
4---
6---
5
7
6<div class="lead">
8<div class="lead">
docs/about.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 1
3sort: 1
3---
4---
4
5
docs/about/overview.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2next: true
3next: true
3sort: 1
4sort: 1
4title: Technical overview
5title: Technical overview
docs/about/runtime.md+4−3
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 2
3sort: 2
3title: C runtime system
4title: C runtime system
4---
5---
@@ -952,9 +953,9 @@ We might even have changed the semantics of the battery without
952changing the label - so long as those semantics don't invalidate
953changing the label - so long as those semantics don't invalidate
953any attached driver.
954any attached driver.
954
955
955−et tree. For instance, it's normal to have
956+For instance, it's normal to have two equivalent Nock batteries
956−two equivalent Nock batteries at the same time in one pier: one
957+at the same time in one pier: one battery compiled with
957−battery compiled with debugging hints, one not.
958+debugging hints, one not.
958
959
959Rather, the jet tree is a semantic hierarchy. The root of the
960Rather, the jet tree is a semantic hierarchy. The root of the
960hierarchy is a constant, by convention the Hoon kernel version
961hierarchy is a constant, by convention the Hoon kernel version
docs/arvo.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 4
3sort: 4
3---
4---
4
5
docs/arvo/api.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2next: true
3next: true
3sort: 12
4sort: 12
4title: API Connectors
5title: API Connectors
docs/arvo/basic.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 1
3sort: 1
3next: true
4next: true
4title: Hoon refresher / crash course
5title: Hoon refresher / crash course
docs/arvo/generators.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2next: true
3next: true
3sort: 8
4sort: 8
4title: Using Generators with Apps
5title: Using Generators with Apps
docs/arvo/http.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2next: false
3next: false
3sort: 9
4sort: 9
4title: HTTP Requests and Timers
5title: HTTP Requests and Timers
docs/arvo/internals.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 15
3sort: 15
3---
4---
4
5
docs/arvo/internals/ames.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 1
3sort: 1
3---
4---
4
5
docs/arvo/internals/ames/commentary.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
1`%ames` commentary
6`%ames` commentary
2==================
7==================
3
8
docs/arvo/internals/behn.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 2
3sort: 2
3---
4---
4
5
docs/arvo/internals/clay.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 3
3sort: 3
3---
4---
4
5
docs/arvo/internals/clay/architecture.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
1# clay
6# clay
2
7
3## high-level
8## high-level
docs/arvo/internals/clay/commentary.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
1`%clay` commentary
6`%clay` commentary
2==================
7==================
3
8
docs/arvo/internals/dill.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 4
3sort: 4
3---
4---
4
5
docs/arvo/internals/eyre.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 5
3sort: 5
3---
4---
4
5
docs/arvo/internals/eyre/commentary.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
1Eyre: Reference
6Eyre: Reference
2===============
7===============
3
8
docs/arvo/internals/ford.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 6
3sort: 6
3---
4---
4
5
docs/arvo/internals/ford/commentary.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
1Reference
6Reference
2=========
7=========
3
8
docs/arvo/internals/gall.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 7
3sort: 7
3---
4---
4
5
docs/arvo/marks.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2next: true
3next: true
3sort: 6
4sort: 6
4title: Marks
5title: Marks
docs/arvo/network.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2next: false
3next: false
3sort: 3
4sort: 3
4title: Network messages
5title: Network messages
docs/arvo/security-driver.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2next: false
3next: false
3sort: 10
4sort: 10
4title: Security Drivers
5title: Security Drivers
docs/arvo/state.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2next: true
3next: true
3sort: 4
4sort: 4
4title: State
5title: State
docs/arvo/subject.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 2
3sort: 2
3next: true
4next: true
4title: The subject
5title: The subject
docs/arvo/subscriptions.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2next: true
3next: true
3sort: 5
4sort: 5
4title: Subscriptions
5title: Subscriptions
docs/arvo/web-apps.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2next: true
3next: true
3sort: 7
4sort: 7
4title: Web Apps
5title: Web Apps
docs/hoon.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 3
3sort: 3
3---
4---
4
5
docs/hoon/advanced.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 7
3sort: 7
3next: true
4next: true
4title: Advanced types
5title: Advanced types
docs/hoon/basic.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 5
3sort: 5
3next: true
4next: true
4title: Basic types
5title: Basic types
docs/hoon/concepts.md+5−4
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 3
3sort: 3
3next: true
4next: true
4title: Concepts
5title: Concepts
@@ -77,7 +78,7 @@ Turing-complete, non-lambda combinator function. The function
77takes a cell `{subject formula}`, and produces a noun `product`.
78takes a cell `{subject formula}`, and produces a noun `product`.
78
79
79To program in Hoon, this is all you need to know about Nock. But
80To program in Hoon, this is all you need to know about Nock. But
80−it's still bfun and useful to [learn more](../../nock).
81+it's still fun and useful to [learn more](../../nock).
81
82
82## Compilation concepts
83## Compilation concepts
83
84
@@ -120,7 +121,7 @@ contain flat twigs, but not vice versa.
120
121
121Regular forms always start with a *sigil*, which is either a
122Regular forms always start with a *sigil*, which is either a
122*keyword* or a *rune* at the programmer's choice. A keyword is
123*keyword* or a *rune* at the programmer's choice. A keyword is
123−the stem cord,
124+the stem cord.
124
125
125For most stems, tall regular form has no delimiter or terminator,
126For most stems, tall regular form has no delimiter or terminator,
126eliminating the `)))))` problem common in functional languages.
127eliminating the `)))))` problem common in functional languages.
@@ -142,7 +143,7 @@ b
142```
143```
143or the tall rune syntax (here on one line, with double spaces):
144or the tall rune syntax (here on one line, with double spaces):
144```
145```
145−:- a b
146+%- a b
146```
147```
147
148
148### `span` (type, as range)
149### `span` (type, as range)
@@ -155,7 +156,7 @@ no syntax for spans; they are always defined by inference (ie, by
155### `gate` (function)
156### `gate` (function)
156
157
157A `gate` is a Hoon function (lambda or closure). Other
158A `gate` is a Hoon function (lambda or closure). Other
158−constructs Urbit are functions in the mathematical sense -- for
159+constructs in Urbit are functions in the mathematical sense -- for
159instance, a Nock formula is also a function. But a gate is not a
160instance, a Nock formula is also a function. But a gate is not a
160formula. The gate's argument is its *sample*; the result is its
161formula. The gate's argument is its *sample*; the result is its
161*product*.
162*product*.
docs/hoon/demo.md+2−1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 1
3sort: 1
3next: true
4next: true
4title: Demo
5title: Demo
@@ -57,6 +58,6 @@ The tail of the pair is line 15, which repeats the loop (like
57Clojure `recur`), with `count` incremented. This list of strings
58Clojure `recur`), with `count` incremented. This list of strings
58is the rest of the output list.
59is the rest of the output list.
59
60
60−You can test this code by mounting your home desk with `|mount %home`;
61+You can test this code by mounting your home desk with `|mount %`;
61copying it into `home/gen/fizzbuzz.hoon` in your Urbit pier; then
62copying it into `home/gen/fizzbuzz.hoon` in your Urbit pier; then
62typing `+fizzbuzz 100` in the Urbit dojo (shell).
63typing `+fizzbuzz 100` in the Urbit dojo (shell).
docs/hoon/examples.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 8
3sort: 8
3title: Examples
4title: Examples
4next: true
5next: true
docs/hoon/exercises.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 11
3sort: 11
3---
4---
4
5
docs/hoon/exercises/data-structures.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 4
3sort: 4
3comments: true
4comments: true
4---
5---
docs/hoon/exercises/fizzbuzz.md+2−1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 1
3sort: 1
3comments: true
4comments: true
4---
5---
@@ -22,7 +23,7 @@ comments: true
22 "Fizz"
23 "Fizz"
23 ?: =(0 (mod count 3))
24 ?: =(0 (mod count 3))
24 "Buzz"
25 "Buzz"
25− (text !>(count))
26+ (pave !>(count))
26 $(count (add 1 count))
27 $(count (add 1 count))
27 ```
28 ```
28
29
docs/hoon/exercises/life.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 5
3sort: 5
3comments: true
4comments: true
4---
5---
docs/hoon/exercises/lists.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 3
3sort: 3
3comments: true
4comments: true
4---
5---
docs/hoon/exercises/math.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 2
3sort: 2
3comments: true
4comments: true
4---
5---
docs/hoon/library.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 10
3sort: 10
3title: Standard library
4title: Standard library
4---
5---
docs/hoon/library/1a.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
1# 1a: basic arithmetic
6# 1a: basic arithmetic
2### `++add`
7### `++add`
3
8
docs/hoon/library/1b.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
1# 1b: tree addressing
6# 1b: tree addressing
2### `++cap`
7### `++cap`
3
8
docs/hoon/library/1c.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
1# 1c: molds and mold builders
6# 1c: molds and mold builders
2
7
3### `++bloq`
8### `++bloq`
docs/hoon/library/2a.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
1# 2a: unit logic
6# 2a: unit logic
2### `++biff`
7### `++biff`
3
8
docs/hoon/library/2b.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
1# 2b: list logic
6# 2b: list logic
2Reverse
7Reverse
3
8
docs/hoon/library/2c.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
1# 2c: bit arithmetic
6# 2c: bit arithmetic
2### `++bex`
7### `++bex`
3
8
docs/hoon/library/2d.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
1# 2d: bit logic
6# 2d: bit logic
2### `++con`
7### `++con`
3
8
docs/hoon/library/2e.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
1# 2e: insecure hashing
6# 2e: insecure hashing
2### `++fnv`
7### `++fnv`
3
8
docs/hoon/library/2f.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
1# 2f: noun ordering
6# 2f: noun ordering
2### `++aor`
7### `++aor`
3
8
docs/hoon/library/2g.md+5
@@ -1 +1,6 @@
1+---
2+navhome: /docs
3+---
4+
5+
1# 2g: unsigned powers (currently undocumented)
6# 2g: unsigned powers (currently undocumented)
docs/hoon/library/2h.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
1# 2h: set logic
6# 2h: set logic
2
7
3### `++in`
8### `++in`
docs/hoon/library/2i.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
1# 2i: map logic
6# 2i: map logic
2### `++by`
7### `++by`
3
8
docs/hoon/library/2j.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
1# 2j: jar and jug logic
6# 2j: jar and jug logic
2### `++ja`
7### `++ja`
3
8
docs/hoon/library/2k.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
1# 2k: queue logic
6# 2k: queue logic
2### `++to`
7### `++to`
3
8
docs/hoon/library/2l.md+5
@@ -1 +1,6 @@
1+---
2+navhome: /docs
3+---
4+
5+
1# 2l: container from container
6# 2l: container from container
docs/hoon/library/2m.md+5
@@ -1 +1,6 @@
1+---
2+navhome: /docs
3+---
4+
5+
1# 2m: container from noun
6# 2m: container from noun
docs/hoon/library/2n.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
1# 2n: functional hacks
6# 2n: functional hacks
2### `++cork`
7### `++cork`
3
8
docs/hoon/library/2o.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
1# 2o: normalizing containers
6# 2o: normalizing containers
2### `++jar`
7### `++jar`
3
8
docs/hoon/library/2p.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
1# 2p: serialization
6# 2p: serialization
2### `++cue`
7### `++cue`
3
8
docs/hoon/library/2q.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
1# 2q: molds and mold builders
6# 2q: molds and mold builders
2### `++char`
7### `++char`
3
8
docs/hoon/library/3a.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
1# 3a: signed and modular ints
6# 3a: signed and modular ints
2### `++fe` :: modulo bloq
7### `++fe` :: modulo bloq
3
8
docs/hoon/library/3b.md+5
@@ -1 +1,6 @@
1+---
2+navhome: /docs
3+---
4+
5+
1# 3b: floating point
6# 3b: floating point
docs/hoon/library/3c.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
1# 3c: urbit time
6# 3c: urbit time
2### `++yo`
7### `++yo`
3
8
docs/hoon/library/3d.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
1# 3d: SHA hash family
6# 3d: SHA hash family
2
7
3### `++og`
8### `++og`
docs/hoon/library/3e.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
1# 3e: AES encryption
6# 3e: AES encryption
2### `++aesc`
7### `++aesc`
3
8
docs/hoon/library/3f.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
1# 3f: scrambling
6# 3f: scrambling
2### `++ob`
7### `++ob`
3
8
docs/hoon/library/3g.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
1# 3g: molds and mold builders
6# 3g: molds and mold builders
2### `++coin`
7### `++coin`
3
8
docs/hoon/library/4a.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
1# 4a: exotic bases
6# 4a: exotic bases
2### `++po`
7### `++po`
3
8
docs/hoon/library/4b.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
1# 4b: text processing
6# 4b: text processing
2### `++at`
7### `++at`
3
8
docs/hoon/library/4c.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
1# 4c: tank printer
6# 4c: tank printer
2### `++re`
7### `++re`
3
8
docs/hoon/library/4d.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
1# 4d: parsing (tracing)
6# 4d: parsing (tracing)
2### `++last`
7### `++last`
3
8
docs/hoon/library/4e.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
1# 4e: parsing (combinators)
6# 4e: parsing (combinators)
2### `++bend`
7### `++bend`
3
8
docs/hoon/library/4f.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
1# 4f: parsing (rule builders)
6# 4f: parsing (rule builders)
2### `++bass`
7### `++bass`
3
8
docs/hoon/library/4g.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
1# 4g: parsing (outside caller)
6# 4g: parsing (outside caller)
2### `++rash`
7### `++rash`
3
8
docs/hoon/library/4h.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
1# 4h: parsing (ascii glyphs)
6# 4h: parsing (ascii glyphs)
2### `++ace`
7### `++ace`
3
8
docs/hoon/library/4i.md+5
@@ -1 +1,6 @@
1+---
2+navhome: /docs
3+---
4+
5+
1# 4i: parsing (useful idioms)
6# 4i: parsing (useful idioms)
docs/hoon/library/4j.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
1# 4j: parsing (bases and base digits)
6# 4j: parsing (bases and base digits)
2### `++ab`
7### `++ab`
3
8
docs/hoon/library/4k.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
1# 4k: atom printing
6# 4k: atom printing
2### `++co`
7### `++co`
3
8
docs/hoon/library/4l.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
1# 4l: atom parsing
6# 4l: atom parsing
2### `++so`
7### `++so`
3
8
docs/hoon/library/4m.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
1# 4m: formatting functions
6# 4m: formatting functions
2### `++scot`
7### `++scot`
3
8
docs/hoon/library/4n.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
1# 4n: virtualization
6# 4n: virtualization
2### `++mack`
7### `++mack`
3
8
docs/hoon/library/4o.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
1# 4o: molds and mold builders
6# 4o: molds and mold builders
2### `++abel`
7### `++abel`
3
8
docs/hoon/library/5a.md+5
@@ -1 +1,6 @@
1+---
2+navhome: /docs
3+---
4+
5+
1# 5a: compiler utilities
6# 5a: compiler utilities
docs/hoon/library/5b.md+5
@@ -1 +1,6 @@
1+---
2+navhome: /docs
3+---
4+
5+
1# 5b: macro expansion
6# 5b: macro expansion
docs/hoon/library/5c.md+5
@@ -1 +1,6 @@
1+---
2+navhome: /docs
3+---
4+
5+
1# 5c: compiler backend and prettyprinter
6# 5c: compiler backend and prettyprinter
docs/hoon/library/5d.md+5
@@ -1 +1,6 @@
1+---
2+navhome: /docs
3+---
4+
5+
1# 5d: parser
6# 5d: parser
docs/hoon/library/5e.md+5
@@ -1 +1,6 @@
1+---
2+navhome: /docs
3+---
4+
5+
1# 5e: caching compiler
6# 5e: caching compiler
docs/hoon/library/5f.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
1# 5f: molds and mold builders
6# 5f: molds and mold builders
2### `++mane`
7### `++mane`
3
8
docs/hoon/library/5g.md+5
@@ -0,0 +1,5 @@
1+---
2+navhome: /docs
3+---
4+
5+
docs/hoon/library/zuse.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 3
3sort: 3
3---
4---
4
5
docs/hoon/library/zuse/core/crua.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
1### `++crua`
6### `++crua`
2
7
3 ++ crua !: :: cryptosuite A (RSA)
8 ++ crua !: :: cryptosuite A (RSA)
docs/hoon/library/zuse/core/epur.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
1### `++epur`
6### `++epur`
2
7
3Top-level URL parser
8Top-level URL parser
docs/hoon/library/zuse/core/fu.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
13bA lite number theory
63bA lite number theory
2======================
7======================
3
8
docs/hoon/library/zuse/core/jo.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
1
6
2### `++jo`
7### `++jo`
3
8
docs/hoon/library/zuse/core/poja.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
1### `++poja`
6### `++poja`
2
7
3JSON parser core
8JSON parser core
docs/hoon/library/zuse/core/poxa.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
1### `++poxa`
6### `++poxa`
2
7
3Parse XML
8Parse XML
docs/hoon/library/zuse/core/poxo.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
1### `++poxo`
6### `++poxo`
2
7
3Print XML
8Print XML
docs/hoon/library/zuse/core/yu.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
1### `++yu`
6### `++yu`
2
7
3UTC format constants
8UTC format constants
docs/hoon/library/zuse/diff.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
12eP diff
62eP diff
2========
7========
3
8
docs/hoon/library/zuse/gate/clan.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
1### `++clan`
6### `++clan`
2
7
3Ship class
8Ship class
docs/hoon/library/zuse/gate/dawn.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
1### `++dawn`
6### `++dawn`
2
7
3Weekday of Jan 1
8Weekday of Jan 1
docs/hoon/library/zuse/gate/daws.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
1### `++daws`
6### `++daws`
2
7
3Weekday of date
8Weekday of date
docs/hoon/library/zuse/gate/deal.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
1### `++deal`
6### `++deal`
2
7
3Add leap seconds
8Add leap seconds
docs/hoon/library/zuse/gate/deft.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
1### `++deft`
6### `++deft`
2
7
3Import URL path
8Import URL path
docs/hoon/library/zuse/gate/dust.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
1### `++dust`
6### `++dust`
2
7
3Print UTC format
8Print UTC format
docs/hoon/library/zuse/gate/earl.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
1### `++earl`
6### `++earl`
2
7
3Localize purl
8Localize purl
docs/hoon/library/zuse/gate/earn.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
1### `++earn`
6### `++earn`
2
7
3Purl to tape
8Purl to tape
docs/hoon/library/zuse/gate/fain.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
1### `++fain`
6### `++fain`
2
7
3Restructure path
8Restructure path
docs/hoon/library/zuse/gate/feel.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
1### `++feel`
6### `++feel`
2
7
3Generate file diff
8Generate file diff
docs/hoon/library/zuse/gate/file.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
1### `++file`
6### `++file`
2
7
3Simple file load
8Simple file load
docs/hoon/library/zuse/gate/foal.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
1
6
2### `++foal`
7### `++foal`
3
8
docs/hoon/library/zuse/gate/fray.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
1
6
2### `++fray`
7### `++fray`
3
8
docs/hoon/library/zuse/gate/fuel.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
1### `++fuel`
6### `++fuel`
2
7
3Parse fcgi
8Parse fcgi
docs/hoon/library/zuse/gate/furl.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
1### `++furl`
6### `++furl`
2
7
3Unify changes
8Unify changes
docs/hoon/library/zuse/gate/glam.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
1### `++glam`
6### `++glam`
2
7
3Galaxy names
8Galaxy names
docs/hoon/library/zuse/gate/glon.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
1### `++glon`
6### `++glon`
2
7
3ISO language code
8ISO language code
docs/hoon/library/zuse/gate/gnom.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
1### `++gnom`
6### `++gnom`
2
7
3Display ship name
8Display ship name
docs/hoon/library/zuse/gate/jape.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
1### `++jape`
6### `++jape`
2
7
3`++json` string from tape
8`++json` string from tape
docs/hoon/library/zuse/gate/jesc.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
1### `++jesc`
6### `++jesc`
2
7
3Escape JSON character
8Escape JSON character
docs/hoon/library/zuse/gate/joba.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
1### `++joba`
6### `++joba`
2
7
3`++json` from key-value pair
8`++json` from key-value pair
docs/hoon/library/zuse/gate/jobe.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
1### `++jobe`
6### `++jobe`
2
7
3Object from key-value list
8Object from key-value list
docs/hoon/library/zuse/gate/jone.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
1### `++jone`
6### `++jone`
2
7
3`++json` number from unigned
8`++json` number from unigned
docs/hoon/library/zuse/gate/lead.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
1### `++lead`
6### `++lead`
2
7
3Subtract leap seconds
8Subtract leap seconds
docs/hoon/library/zuse/gate/mang.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
1### `++mang`
6### `++mang`
2
7
3Unit: Slam gate with sample
8Unit: Slam gate with sample
docs/hoon/library/zuse/gate/meat.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
1### `++meat`
6### `++meat`
2
7
3Kite to .^ path
8Kite to .^ path
docs/hoon/library/zuse/gate/moon.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
1### `++moon`
6### `++moon`
2
7
3Mime type to `++cord`
8Mime type to `++cord`
docs/hoon/library/zuse/gate/mung.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
1### `++mung`
6### `++mung`
2
7
3Virtualize slamming gate
8Virtualize slamming gate
docs/hoon/library/zuse/gate/perk.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
1### `++perk`
6### `++perk`
2
7
3Parse cube with fork
8Parse cube with fork
docs/hoon/library/zuse/gate/pojo.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
1### `++pojo`
6### `++pojo`
2
7
3Print JSON
8Print JSON
docs/hoon/library/zuse/gate/saxo.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
1### `++saxo`
6### `++saxo`
2
7
3List ancestors
8List ancestors
docs/hoon/library/zuse/gate/scanf.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
1### `++scanf` XX
6### `++scanf` XX
2
7
3Formatted scan
8Formatted scan
docs/hoon/library/zuse/gate/sein.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
1### `++sein`
6### `++sein`
2
7
3Direct parent
8Direct parent
docs/hoon/library/zuse/gate/sifo.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
1### `++sifo`
6### `++sifo`
2
7
364-bit encode
864-bit encode
docs/hoon/library/zuse/gate/stud.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
1### `++stud`
6### `++stud`
2
7
3Parse UTC format
8Parse UTC format
docs/hoon/library/zuse/gate/taco.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
1### `++taco`
6### `++taco`
2
7
3Converts an atom to an octet stream [`++octs`](), which contains a length, to
8Converts an atom to an octet stream [`++octs`](), which contains a length, to
docs/hoon/library/zuse/gate/tact.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
1### `++tact`
6### `++tact`
2
7
3tape to octs
8tape to octs
docs/hoon/library/zuse/gate/tame.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
1### `++tame`
6### `++tame`
2
7
3Parse kite path
8Parse kite path
docs/hoon/library/zuse/gate/tell.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
1### `++tell`
6### `++tell`
2
7
3octs from wall
8octs from wall
docs/hoon/library/zuse/gate/tome.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
1
6
2### `++tome`
7### `++tome`
3
8
docs/hoon/library/zuse/gate/tope.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
1### `++tope`
6### `++tope`
2
7
3Parse beam to path
8Parse beam to path
docs/hoon/library/zuse/gate/txml.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
1### `++txml`
6### `++txml`
2
7
3Tape to xml CDATA node
8Tape to xml CDATA node
docs/hoon/library/zuse/gate/unt.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
1### `++unt`
6### `++unt`
2
7
3UGT to UTC time
8UGT to UTC time
docs/hoon/library/zuse/gate/urld.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
1### `++urld`
6### `++urld`
2
7
3Decode URL
8Decode URL
docs/hoon/library/zuse/gate/urle.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
1### `++urle`
6### `++urle`
2
7
3Encode URL
8Encode URL
docs/hoon/library/zuse/mold/udal.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
1### `++udal`
6### `++udal`
2
7
3Source
8Source
docs/hoon/library/zuse/mold/udon.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
1### `++udon`
6### `++udon`
2
7
3 ++ udon :: abstract delta
8 ++ udon :: abstract delta
docs/hoon/library/zuse/mold/umph.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
1### `++umph`
6### `++umph`
2
7
3 ++ umph :: change filter
8 ++ umph :: change filter
docs/hoon/library/zuse/mold/unce.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
1### `++unce`
6### `++unce`
2
7
3 ++ unce |* a=_,* :: change part
8 ++ unce |* a=_,* :: change part
docs/hoon/library/zuse/mold/upas.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
1### `++upas`
6### `++upas`
2
7
3 ++ upas :: tree change (%d)
8 ++ upas :: tree change (%d)
docs/hoon/library/zuse/mold/urge.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
1### `++urge`
6### `++urge`
2
7
3 ++ urge |*(a=_,* (list (unce a))) :: list change
8 ++ urge |*(a=_,* (list (unce a))) :: list change
docs/hoon/library/zuse/rsa.md+5
@@ -1,3 +1,8 @@
1+---
2+navhome: /docs
3+---
4+
5+
1------------------------------------------------------------------------
6------------------------------------------------------------------------
2
7
3### `++pram`
8### `++pram`
docs/hoon/mission.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 2
3sort: 2
3next: true
4next: true
4title: Mission
5title: Mission
docs/hoon/reference.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 9
3sort: 9
3title: Twig reference
4title: Twig reference
4---
5---
docs/hoon/syntax.md+7−6
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 4
3sort: 4
3next: true
4next: true
4title: Syntax
5title: Syntax
@@ -53,7 +54,7 @@ the eye to tell whether a token on the screen is a feature of the
53language, or a label in the program. For example, in Lisp a
54language, or a label in the program. For example, in Lisp a
54special form has the same syntax as a function call.
55special form has the same syntax as a function call.
55
56
56−The worst-case result of FLC is "DSL cancer". Every source file
57+The worst-case result of FLC is "DSL cancer." Every source file
57is effectively written in its own domain-specific language. To
58is effectively written in its own domain-specific language. To
58read a new file is to learn a new language -- "write-only code."
59read a new file is to learn a new language -- "write-only code."
59
60
@@ -138,10 +139,10 @@ Some twigs (simple leafy ones) have *only* irregular forms.
138A regular form starts with a *sigil*, which is either a
139A regular form starts with a *sigil*, which is either a
139*keyword* or a *rune* -- at the programmer's choice.
140*keyword* or a *rune* -- at the programmer's choice.
140
141
141−A *keyword* is `:` and then the stem label - eg, `:cons`.
142+A *keyword* is `:` and then the stem label - e.g., `:cons`.
142
143
143−A *rune* is a pair of ASCII punctuation marks (a digraph) - eg,
144+A *rune* is a pair of ASCII punctuation marks (a digraph) - e.g.,
144−`:-`. The first glyph in the rune indicates the category - eg,
145+`:-`. The first glyph in the rune indicates the category - e.g.,
145`:` runes make cells. Runes can be pronounced by their glyphs or
146`:` runes make cells. Runes can be pronounced by their glyphs or
146by their stem -- for `:-`, you can say either "colhep" or "cons".
147by their stem -- for `:-`, you can say either "colhep" or "cons".
147
148
@@ -152,7 +153,7 @@ with keywords and move to runes; start with runes and stick
152with runes; or start with keywords and stick with keywords.
153with runes; or start with keywords and stick with keywords.
153
154
154Here's the FizzBuzz demo code, in idiomatic rune syntax. Compare
155Here's the FizzBuzz demo code, in idiomatic rune syntax. Compare
155−with the [original](../../demo).
156+with the [original](../demo).
156
157
157```
158```
158 |= end/atom
159 |= end/atom
@@ -195,7 +196,7 @@ both tall/flat mode switches and well-shaped gaps. (Hoon layout
195could probably be done automatically with reasonable quality.
196could probably be done automatically with reasonable quality.
196But it would at least take machine learning, not a rule engine.)
197But it would at least take machine learning, not a rule engine.)
197
198
198−There only two real *rules* in Hoon whitespace design: don't
199+There are only two real *rules* in Hoon whitespace design: don't
199go past 80 characters, and don't use (completely) blank lines.
200go past 80 characters, and don't use (completely) blank lines.
200Otherwise, if it looks good and is easy to read, it's good. But
201Otherwise, if it looks good and is easy to read, it's good. But
201the best way to learn the art is to do everything by convention
202the best way to learn the art is to do everything by convention
docs/hoon/troubleshooting.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 12
3sort: 12
3title: Troubleshooting
4title: Troubleshooting
4next: true
5next: true
docs/hoon/twig.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 6
3sort: 6
3next: true
4next: true
4title: Expressions
5title: Expressions
docs/hoon/twig/atom.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 1
3sort: 1
3
4
4---
5---
docs/hoon/twig/atom/knit.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 3
3sort: 3
3
4
4---
5---
docs/hoon/twig/atom/path.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 4
3sort: 4
3---
4---
4
5
docs/hoon/twig/atom/rock.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 2
3sort: 2
3
4
4---
5---
docs/hoon/twig/atom/sand.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 1
3sort: 1
3
4
4---
5---
docs/hoon/twig/bar-core.md+5−4
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 5
3sort: 5
3
4
4---
5---
@@ -8,10 +9,10 @@ sort: 5
8Core twigs are flow twigs. The compiler essentially pins a Nock
9Core twigs are flow twigs. The compiler essentially pins a Nock
9formula, or battery of formulas, to the subject.
10formula, or battery of formulas, to the subject.
10
11
11−All `|` twigs are macros around `$core`. (See the `$core`
12+All `|` twigs are macros around `$core`. (See the `$core`
12−section in [`span`](../span) above.) `$core` uses the subject as
13+section in [`span`](../../basic#-core-p-span-q-map-term-span) above.)
13−the payload of a battery, whose arms are compiled with the core
14+`$core` uses the subject as the payload of a battery, whose arms are
14−itself as the subject.
15+compiled with the core itself as the subject.
15
16
16## Stems
17## Stems
17
18
docs/hoon/twig/bar-core/cab-door.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 5
3sort: 5
3
4
4---
5---
docs/hoon/twig/bar-core/cen-core.md+1−1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 1
3sort: 1
3
4
4---
5---
@@ -20,7 +21,6 @@ Regular: *battery*.
20A core is like an "object" in a conventional language, but its
21A core is like an "object" in a conventional language, but its
21attributes (*arms*) are functions on the core, not the core and
22attributes (*arms*) are functions on the core, not the core and
22an argument. A "method" on a core is an arm producing a gate.
23an argument. A "method" on a core is an arm producing a gate.
23−gate.
24
24
25## Examples
25## Examples
26
26
docs/hoon/twig/bar-core/dot-trap.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 3
3sort: 3
3
4
4---
5---
docs/hoon/twig/bar-core/hep-loop.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 4
3sort: 4
3
4
4---
5---
docs/hoon/twig/bar-core/tar-gill.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 6
3sort: 6
3---
4---
4
5
docs/hoon/twig/bar-core/tis-gate.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 2
3sort: 2
3
4
4---
5---
docs/hoon/twig/buc-mold.md+2−1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 7
3sort: 7
3
4
4---
5---
@@ -44,7 +45,7 @@ In any case, since molds are just functions, we can use
44functional programming to assemble interesting molds. For
45functional programming to assemble interesting molds. For
45instance, `(map foo bar)` is a table from mold `foo` to mold
46instance, `(map foo bar)` is a table from mold `foo` to mold
46`bar`. `map` is not a mold; it's a function that makes a mold.
47`bar`. `map` is not a mold; it's a function that makes a mold.
47−Molds and mold builder sare generally described together.
48+Molds and mold builders are generally described together.
48
49
49## Stems
50## Stems
50
51
docs/hoon/twig/buc-mold/base.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 1
3sort: 1
3
4
4---
5---
docs/hoon/twig/buc-mold/cab-shoe.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 9
3sort: 9
3---
4---
4
5
docs/hoon/twig/buc-mold/cen-book.md+2−1
@@ -1,9 +1,10 @@
1---
1---
2+navhome: /docs
2sort: 4
3sort: 4
3
4
4---
5---
5
6
6−# `:book $% "buctis"`
7+# `:book $% "buccen"`
7
8
8`{$book p/(list {{aura @} moss})}`: mold which recognizes a union tagged by head atom.
9`{$book p/(list {{aura @} moss})}`: mold which recognizes a union tagged by head atom.
9
10
docs/hoon/twig/buc-mold/col-bank.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 2
3sort: 2
3
4
4---
5---
docs/hoon/twig/buc-mold/hep-lamb.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 8
3sort: 8
3
4
4---
5---
docs/hoon/twig/buc-mold/ket-bush.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 6
3sort: 6
3
4
4---
5---
docs/hoon/twig/buc-mold/pat-claw.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 5
3sort: 5
3
4
4---
5---
docs/hoon/twig/buc-mold/tis-coat.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 3
3sort: 3
3
4
4---
5---
docs/hoon/twig/buc-mold/wut-pick.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 7
3sort: 7
3
4
4---
5---
docs/hoon/twig/cen-call.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 6
3sort: 6
3
4
4---
5---
docs/hoon/twig/cen-call/cab-keep.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 2
3sort: 2
3
4
4---
5---
docs/hoon/twig/cen-call/dot-lace.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 5
3sort: 5
3---
4---
4
5
docs/hoon/twig/cen-call/hep-call.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 4
3sort: 4
3---
4---
4
5
docs/hoon/twig/cen-call/ket-calq.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 7
3sort: 7
3---
4---
4
5
docs/hoon/twig/cen-call/lus-calt.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 6
3sort: 6
3---
4---
4
5
docs/hoon/twig/cen-call/sig-open.md+2−1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 3
3sort: 3
3---
4---
4
5
@@ -30,5 +31,5 @@ learn to step outside your linear, Western way of thinking."
30
31
31## Examples
32## Examples
32
33
33−See [`:door`](../bar-core/cab-door).
34+See [`:door`](../../bar-core/cab-door).
34
35
docs/hoon/twig/cen-call/tis-make.md+3−2
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 1
3sort: 1
3---
4---
4
5
@@ -25,9 +26,9 @@ Irregular: `foo(x 1, y 2, z 3)` is `:make(foo x 1, y 2, z 3)`.
25Note that `p` is a wing, not a twig. Knowing that a function
26Note that `p` is a wing, not a twig. Knowing that a function
26call `(foo bar)` involves making `foo`, replacing its sample
27call `(foo bar)` involves making `foo`, replacing its sample
27at slot `+6` with `bar`, and taking the `$` limb, you might think
28at slot `+6` with `bar`, and taking the `$` limb, you might think
28−`(foo bar)` would mean `:(make foo +6 bar)`.
29+`(foo bar)` would mean `:make(foo +6 bar)`.
29
30
30−But it's actually `:pin(foo :(make $ +2 +6 bar))`. Even if `foo`
31+But it's actually `:pin(foo :make($ +2 +6 bar))`. Even if `foo`
31is a wing, we would just be mutating `+6` within the core that
32is a wing, we would just be mutating `+6` within the core that
32defines the `foo` arm. Instead we want to modify the *product*
33defines the `foo` arm. Instead we want to modify the *product*
33of `foo` -- the gate -- so we have to pin it into the subject.
34of `foo` -- the gate -- so we have to pin it into the subject.
docs/hoon/twig/col-cell.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 3
3sort: 3
3
4
4---
5---
docs/hoon/twig/col-cell/cab-scon.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 6
3sort: 6
3---
4---
4
5
docs/hoon/twig/col-cell/hep-cons.md+8−1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 1
3sort: 1
3---
4---
4
5
@@ -22,7 +23,7 @@ Irregular: `a^b^c` is `[a b c]`.
22
23
23Irregular: `a+b` is `[%a b]`.
24Irregular: `a+b` is `[%a b]`.
24
25
25−Irregular: `\`a` is `[~ a]`.
26+Irregular: `` `a`` is `[~ a]`.
26
27
27Irregular: `~[a b]` is `[a b ~]`.
28Irregular: `~[a b]` is `[a b ~]`.
28
29
@@ -39,4 +40,10 @@ compiler does), `[a b]` is the same as `[%cons a b]`.
39```
40```
40~zod:dojo> :-(1 2)
41~zod:dojo> :-(1 2)
41[1 2]
42[1 2]
43+~zod:dojo> 1^2
44+[1 2]
45+~zod:dojo> 1+2
46+[%1 2]
47+~zod:dojo> `1
48+[~ 1]
42```
49```
docs/hoon/twig/col-cell/ket-conq.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 3
3sort: 3
3---
4---
4
5
docs/hoon/twig/col-cell/lus-cont.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 2
3sort: 2
3---
4---
4
5
docs/hoon/twig/col-cell/sig-conl.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 5
3sort: 5
3---
4---
4
5
docs/hoon/twig/col-cell/tar-conp.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 4
3sort: 4
3---
4---
4
5
docs/hoon/twig/dot-nock.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 10
3sort: 10
3
4
4---
5---
docs/hoon/twig/dot-nock/ket-wish.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 5
3sort: 5
3---
4---
4
5
docs/hoon/twig/dot-nock/lus-bump.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 3
3sort: 3
3---
4---
4
5
docs/hoon/twig/dot-nock/tar-nock.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 1
3sort: 1
3---
4---
4
5
docs/hoon/twig/dot-nock/tis-same.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 4
3sort: 4
3---
4---
4
5
docs/hoon/twig/dot-nock/wut-deep.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 2
3sort: 2
3---
4---
4
5
docs/hoon/twig/ket-cast.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 9
3sort: 9
3
4
4---
5---
docs/hoon/twig/ket-cast/bar-iron.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 5
3sort: 5
3---
4---
4
5
docs/hoon/twig/ket-cast/hep-cast.md+5−2
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 2
3sort: 2
3---
4---
4
5
@@ -14,7 +15,9 @@ sort: 2
14
15
15## Syntax
16## Syntax
16
17
17−Regular: *2-fixed*
18+Regular: *2-fixed*.
19+
20+Irregular: `` `foo`bar`` is `:cast(foo bar)`.
18
21
19## Discussion
22## Discussion
20
23
@@ -26,7 +29,7 @@ infinite loop in the compiler).
26
29
27## Examples
30## Examples
28
31
29−``
32+```
30~zod:dojo> (add 90 7)
33~zod:dojo> (add 90 7)
3197
3497
32~zod:dojo> `@t`(add 90 7)
35~zod:dojo> `@t`(add 90 7)
docs/hoon/twig/ket-cast/lus-like.md+4−3
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 1
3sort: 1
3---
4---
4
5
@@ -15,11 +16,11 @@ within the span of `q`. Otherwise, `nest-fail`.
15
16
16Regular: *2-fixed*.
17Regular: *2-fixed*.
17
18
18−Irregular: `\`_foo\`bar` is `:like(foo bar)`.
19−
20## Examples
19## Examples
21
20
22```
21```
23−~zod:dojo> :like('text' 97)
22+~zod:dojo> :like('text' %a)
24'a'
23'a'
25```
24```
25+
26+
docs/hoon/twig/ket-cast/sig-burn.md+2−1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 6
3sort: 6
3---
4---
4
5
@@ -8,7 +9,7 @@ sort: 6
8
9
9## Produces
10## Produces
10
11
11−`p`, folded as a constqnt if possible.
12+`p`, folded as a constant if possible.
12
13
13## Syntax
14## Syntax
14
15
docs/hoon/twig/ket-cast/tis-name.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 3
3sort: 3
3---
4---
4
5
docs/hoon/twig/ket-cast/wut-lead.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 4
3sort: 4
3---
4---
4
5
docs/hoon/twig/limb.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 2
3sort: 2
3---
4---
4
5
docs/hoon/twig/limb/limb.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 1
3sort: 1
3
4
4---
5---
docs/hoon/twig/limb/wing.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 2
3sort: 2
3---
4---
4
5
docs/hoon/twig/sem-make.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 11
3sort: 11
3
4
4---
5---
docs/hoon/twig/sem-make/col-wad.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 3
3sort: 3
3---
4---
4
5
docs/hoon/twig/sem-make/fas-nub.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 4
3sort: 4
3---
4---
4
5
docs/hoon/twig/sem-make/sem-fry.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 1
3sort: 1
3---
4---
4
5
docs/hoon/twig/sem-make/sig-dip.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 2
3sort: 2
3---
4---
4
5
docs/hoon/twig/sig-hint.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 12
3sort: 12
3
4
4---
5---
docs/hoon/twig/sig-hint/bar-show.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 2
3sort: 2
3---
4---
4
5
docs/hoon/twig/sig-hint/buc-poll.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 12
3sort: 12
3---
4---
4
5
docs/hoon/twig/sig-hint/cab-lurk.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 3
3sort: 3
3---
4---
4
5
docs/hoon/twig/sig-hint/cen-fast.md+2−1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 10
3sort: 10
3---
4---
4
5
@@ -26,7 +27,7 @@ between opening and closing `==`.
26formal identity to the interpreter, which may or may not be able
27formal identity to the interpreter, which may or may not be able
27to recognize and/or accelerate it.
28to recognize and/or accelerate it.
28
29
29−Registered cores are are organized in a containment hierarchy.
30+Registered cores are organized in a containment hierarchy.
30The parent core is at any leg within the child core. When we
31The parent core is at any leg within the child core. When we
31register a core, we state the leg to its parent, in the form of
32register a core, we state the leg to its parent, in the form of
32wing `q`. We assume the parent is already registered -- as it
33wing `q`. We assume the parent is already registered -- as it
docs/hoon/twig/sig-hint/fas-funk.md+2−1
@@ -1,5 +1,6 @@
1---
1---
2+navhome: /docs
2−sort: 1
3+sort: 11
3---
4---
4
5
5# `:funk ~/ "sigfas"`
6# `:funk ~/ "sigfas"`
docs/hoon/twig/sig-hint/gal-thin.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 6
3sort: 6
3---
4---
4
5
docs/hoon/twig/sig-hint/gar-hint.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 5
3sort: 5
3---
4---
4
5
docs/hoon/twig/sig-hint/lus-memo.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 7
3sort: 7
3---
4---
4
5
docs/hoon/twig/sig-hint/pam-dump.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 1
3sort: 1
3---
4---
4
5
docs/hoon/twig/sig-hint/tis-ddup.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 8
3sort: 8
3---
4---
4
5
docs/hoon/twig/sig-hint/wut-warn.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 4
3sort: 4
3---
4---
4
5
docs/hoon/twig/sig-hint/zap-peep.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 9
3sort: 9
3---
4---
4
5
docs/hoon/twig/tis-flow.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 4
3sort: 4
3
4
4---
5---
docs/hoon/twig/tis-flow/bar-new.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 5
3sort: 5
3---
4---
4
5
docs/hoon/twig/tis-flow/col-fix.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 9
3sort: 9
3---
4---
4
5
docs/hoon/twig/tis-flow/dot-set.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 8
3sort: 8
3---
4---
4
5
docs/hoon/twig/tis-flow/fas-var.md+2−1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 6
3sort: 6
3---
4---
4
5
@@ -10,7 +11,7 @@ noun with the subject.
10## Expands to
11## Expands to
11
12
12```
13```
13−?@(p :pin(:name(p q) r) :pin(:cast(:(coat p) q) r)
14+?@(p :pin(:name(p q) r) :pin(:cast(:coat(p q) r)
14```
15```
15
16
16## Syntax
17## Syntax
docs/hoon/twig/tis-flow/gal-rap.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 2
3sort: 2
3---
4---
4
5
docs/hoon/twig/tis-flow/gar-per.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 1
3sort: 1
3---
4---
4
5
docs/hoon/twig/tis-flow/hep-nip.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 4
3sort: 4
3---
4---
4
5
docs/hoon/twig/tis-flow/ket-sip.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 10
3sort: 10
3---
4---
4
5
docs/hoon/twig/tis-flow/lus-pin.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 3
3sort: 3
3---
4---
4
5
docs/hoon/twig/tis-flow/sem-rev.md+2−1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 7
3sort: 7
3---
4---
4
5
@@ -10,7 +11,7 @@ subject, inverted.
10## Expands to
11## Expands to
11
12
12```
13```
13−?@(p :pin(:name(p r) q) :pin(:cast(:(coat p) r) q)
14+?@(p :pin(:name(p r) q) :pin(:cast(:coat(p r) q)
14```
15```
15
16
16## Syntax
17## Syntax
docs/hoon/twig/tis-flow/tar-aka.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 11
3sort: 11
3---
4---
4
5
docs/hoon/twig/wut-test.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 8
3sort: 8
3---
4---
4
5
docs/hoon/twig/wut-test/bar-or.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 9
3sort: 9
3---
4---
4
5
docs/hoon/twig/wut-test/col-if.md+2−1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 1
3sort: 1
3---
4---
4
5
@@ -29,7 +30,7 @@ Regular: *3-fixed*.
29
30
30Short-circuiting in boolean tests works as you'd expect
31Short-circuiting in boolean tests works as you'd expect
31and includes the expected inference. For instance,
32and includes the expected inference. For instance,
32−if you write `:(and a b)`, `b` is only executed if `a` is
33+if you write `:and(a b)`, `b` is only executed if `a` is
33positive, and compiled with that assumption.
34positive, and compiled with that assumption.
34
35
35Note also that all other branching twigs reduce to `:if`.
36Note also that all other branching twigs reduce to `:if`.
docs/hoon/twig/wut-test/dot-lest.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 2
3sort: 2
3---
4---
4
5
docs/hoon/twig/wut-test/gal-deny.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 10
3sort: 10
3---
4---
4
5
docs/hoon/twig/wut-test/gar-sure.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 11
3sort: 11
3---
4---
4
5
docs/hoon/twig/wut-test/hep-case.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 12
3sort: 12
3---
4---
4
5
docs/hoon/twig/wut-test/ket-ifcl.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 5
3sort: 5
3---
4---
4
5
docs/hoon/twig/wut-test/lus-deft.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 13
3sort: 13
3---
4---
4
5
docs/hoon/twig/wut-test/pam-and.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 8
3sort: 8
3---
4---
4
5
docs/hoon/twig/wut-test/pat-ifat.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 4
3sort: 4
3---
4---
4
5
docs/hoon/twig/wut-test/sig-ifno.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 3
3sort: 3
3---
4---
4
5
docs/hoon/twig/wut-test/tis-fits.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 6
3sort: 6
3---
4---
4
5
docs/hoon/twig/wut-test/zap-not.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 7
3sort: 7
3---
4---
4
5
docs/hoon/twig/zap-wild.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 13
3sort: 13
3
4
4---
5---
docs/hoon/twig/zap-wild/gar-wrap.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 2
3sort: 2
3---
4---
4
5
docs/hoon/twig/zap-wild/tis-code.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 3
3sort: 3
3---
4---
4
5
docs/hoon/twig/zap-wild/wut-need.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 4
3sort: 4
3---
4---
4
5
docs/hoon/twig/zap-wild/zap-fail.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 1
3sort: 1
3---
4---
4
5
docs/nock.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 5
3sort: 5
3title: Nock
4title: Nock
4---
5---
docs/nock/definition.md+2−1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 1
3sort: 1
3next: true
4next: true
4title: Definition
5title: Definition
@@ -108,7 +109,7 @@ in the subject.
108
109
109A formula `[1 b]` produces the constant noun `b`.
110A formula `[1 b]` produces the constant noun `b`.
110
111
111−A formula `[2 b c]` treats `b` and `c` is formulas, resolves each
112+A formula `[2 b c]` treats `b` and `c` as formulas, resolves each
112against the subject, then computes Nock again with the product of
113against the subject, then computes Nock again with the product of
113`b` as the subject, `c` as the formula.
114`b` as the subject, `c` as the formula.
114
115
docs/nock/example.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 3
3sort: 3
3next: true
4next: true
4title: Example
5title: Example
docs/nock/explanation.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 2
3sort: 2
3next: true
4next: true
4title: Explanation
5title: Explanation
docs/nock/implementations.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 4
3sort: 4
3title: Implementations
4title: Implementations
4---
5---
docs/nock/implementations/c.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2title: C
3title: C
3sort: 6
4sort: 6
4next: true
5next: true
docs/nock/implementations/clojure.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2title: Clojure
3title: Clojure
3sort: 5
4sort: 5
4next: true
5next: true
docs/nock/implementations/groovy.mdnew file+206
@@ -0,0 +1,206 @@
1+---
2+navhome: /docs
3+title: Groovy
4+sort: 7
5+next: true
6+---
7+
8+# Groovy
9+
10+From [Kohányi Róbert](https://github.com/kohanyirobert/gnock/blob/master/gnock.groovy):
11+
12+```
13+@Memoized
14+def i(def a) {
15+ a.class in [
16+ byte, Byte,
17+ char, Character,
18+ short, Short,
19+ int, Integer,
20+ long, Long,
21+ BigInteger
22+ ] && a >= 0
23+}
24+
25+@Memoized
26+def n(def a) {
27+ def r
28+ n(a, { r = it })
29+ r
30+}
31+
32+@TailRecursive
33+def n(def a, def r) {
34+ if (a in List) {
35+ if (a.size() == 1) {
36+ r(a[0])
37+ } else if (a.size() >= 2) {
38+ n(a[0], { t ->
39+ n(a.size() == 2 ? a[1] : a.tail(), { h ->
40+ r([t, h])
41+ })
42+ })
43+ } else {
44+ throw new IllegalStateException()
45+ }
46+ } else if (i(a)) {
47+ r((BigInteger) a)
48+ } else {
49+ throw new IllegalStateException()
50+ }
51+}
52+
53+@Memoized
54+def wut(def a) {
55+ i(a) ? 1 : 0
56+}
57+
58+@Memoized
59+def lus(def a) {
60+ if (wut(a) == 0) {
61+ throw new IllegalStateException()
62+ }
63+ 1 + a
64+}
65+
66+@Memoized
67+def tis(def a) {
68+ if (wut(a) == 1) {
69+ throw new IllegalStateException()
70+ }
71+ a[0] == a[1] ? 0 : 1
72+}
73+
74+@Memoized
75+def fas(def a) {
76+ def r
77+ fas(a, { r = it })
78+ r
79+}
80+
81+@TailRecursive
82+def fas(def a, def r) {
83+ if (wut(a) == 1) {
84+ throw new IllegalStateException()
85+ }
86+ def h = a[0]
87+ if (!i(h)) {
88+ throw new IllegalStateException()
89+ }
90+ def t = a[1]
91+ if (h == 0) {
92+ throw new IllegalStateException()
93+ } else if (h == 1) {
94+ r(t)
95+ } else {
96+ if (i(t)) {
97+ throw new IllegalStateException()
98+ }
99+ if (h == 2) {
100+ r(t[0])
101+ } else if (h == 3) {
102+ r(t[1])
103+ } else {
104+ fas([h.intdiv(2), t], { p ->
105+ fas([2 + h.mod(2), p], { q ->
106+ r(q)
107+ })
108+ })
109+ }
110+ }
111+}
112+
113+@Memoized
114+def tar(def a) {
115+ def r
116+ tar(a, { r = it})
117+ r
118+}
119+
120+@TailRecursive
121+def tar(def a, def r) {
122+ if (wut(a) == 1) {
123+ throw new IllegalStateException()
124+ }
125+ def s = a[0]
126+ def f = a[1]
127+ if (wut(f) == 1) {
128+ throw new IllegalStateException()
129+ }
130+ def o = f[0]
131+ def v = f[1]
132+ if (wut(o) == 0) {
133+ tar([s, o], { p ->
134+ tar([s, v], { q ->
135+ r([p, q])
136+ })
137+ })
138+ } else {
139+ if (o == 0) {
140+ r(fas([v, s]))
141+ } else if (o == 1) {
142+ r(v)
143+ } else if (o == 3) {
144+ tar([s, v], {
145+ r(wut(it))
146+ })
147+ } else if (o == 4) {
148+ tar([s, v], {
149+ r(lus(it))
150+ })
151+ } else if (o == 5) {
152+ tar([s, v], {
153+ r(tis(it))
154+ })
155+ } else {
156+ if (wut(v) == 1) {
157+ throw new IllegalStateException()
158+ }
159+ def x = v[0]
160+ def y = v[1]
161+ if (o == 2) {
162+ tar([s, x], { p ->
163+ tar([s, y], { q ->
164+ tar([p, q], {
165+ r(it)
166+ })
167+ })
168+ })
169+ } else if (o == 7) {
170+ tar(n([s, 2, x, 1, y]), {
171+ r(it)
172+ })
173+ } else if (o == 8) {
174+ tar(n([s, 7, [[7, [0, 1], x], 0, 1], y]), {
175+ r(it)
176+ })
177+ } else if (o == 9) {
178+ tar(n([s, 7, y, 2, [0, 1], 0, x]), {
179+ r(it)
180+ })
181+ } else if (o == 10) {
182+ if (wut(x) == 1) {
183+ tar([s, y], {
184+ r(it)
185+ })
186+ } else {
187+ tar(n([s, 8, x[1], 7, [0, 3], y]), {
188+ r(it)
189+ })
190+ }
191+ } else {
192+ if (wut(y) == 1) {
193+ throw new IllegalStateException()
194+ }
195+ if (o == 6) {
196+ tar(n([s, 2, [0, 1], 2, [1, y[0], y[1]], [1, 0], 2, [1, 2, 3], [1, 0], 4, 4, x]), {
197+ r(it)
198+ })
199+ } else {
200+ throw new IllegalStateException()
201+ }
202+ }
203+ }
204+ }
205+}
206+```
docs/nock/implementations/haskell.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2title: Haskell
3title: Haskell
3sort: 3
4sort: 3
4next: true
5next: true
docs/nock/implementations/hoon.md+2−1
@@ -1,6 +1,7 @@
1---
1---
2+navhome: /docs
2title: Hoon
3title: Hoon
3−sort: 7
4+sort: 11
4---
5---
5
6
6# Hoon
7# Hoon
docs/nock/implementations/javascript.mdnew file+365
@@ -0,0 +1,365 @@
1+---
2+navhome: /docs
3+title: Javascript
4+sort: 9
5+next: true
6+---
7+
8+# Javascript
9+
10+From [Joe Bryan](https://github.com/joemfb/nock.js/blob/master/nock.js):
11+
12+```js
13+(function (self, factory) {
14+ 'use strict'
15+
16+ if (typeof define === 'function' && define.amd) {
17+ define([], factory)
18+ } else if (typeof module === 'object' && typeof module.exports === 'object') {
19+ module.exports = factory()
20+ } else {
21+ self.nock = factory()
22+ }
23+}(this, function () {
24+ 'use strict'
25+
26+ /**
27+ * Nock is a combinator interpreter on nouns. A noun is an atom or a cell.
28+ * An atom is an unsigned integer of any size; a cell is an ordered pair of nouns.
29+ *
30+ * @see http://urbit.org/docs/nock/definition/
31+ * @see http://media.urbit.org/whitepaper.pdf
32+ */
33+
34+ var useMacros = false
35+
36+ /*
37+ * code conventions:
38+ *
39+ * `n` is a noun,
40+ * `s` is a subject noun,
41+ * `f` is a formula (or cell of formulas)
42+ */
43+
44+ /* operators */
45+
46+ /**
47+ * wut (?): test for atom (1) or cell (0)
48+ *
49+ * ?[a b] 0
50+ * ?a 1
51+ */
52+ function wut (n) {
53+ return typeof n === 'number' ? 1 : 0
54+ }
55+
56+ /**
57+ * lus (+): increment an atom
58+ *
59+ * +[a b] +[a b]
60+ * +a 1 + a
61+ */
62+ function lus (n) {
63+ if (wut(n) === 0) throw new Error('lus cell')
64+ return 1 + n
65+ }
66+
67+ /**
68+ * tis (=): test equality
69+ *
70+ * =[a a] 0
71+ * =[a b] 1
72+ * =a =a
73+ */
74+ function tis (n) {
75+ if (wut(n) === 1) throw new Error('tis atom')
76+ return deepEqual(n[0], n[1]) ? 0 : 1
77+ }
78+
79+ /**
80+ * fas (/): resolve a tree address
81+ *
82+ * /[1 a] a
83+ * /[2 a b] a
84+ * /[3 a b] b
85+ * /[(a + a) b] /[2 /[a b]]
86+ * /[(a + a + 1) b] /[3 /[a b]]
87+ * /a /a
88+ */
89+ function fas (addr, n) {
90+ if (n === undefined) throw new Error('invalid fas noun')
91+ if (addr === 0) throw new Error('invalid fas addr: 0')
92+
93+ if (addr === 1) return n
94+ if (addr === 2) return n[0]
95+ if (addr === 3) return n[1]
96+
97+ return fas(2 + (addr % 2), fas((addr / 2) | 0, n))
98+ }
99+
100+ /* formulas */
101+
102+ /**
103+ * slot (0): resolve a tree address
104+ *
105+ * *[a 0 b] /[b a]
106+ */
107+ function slot (s, f) {
108+ var p = fas(f, s)
109+
110+ if (p === undefined) throw new Error('invalid fas addr: ' + f)
111+
112+ return p
113+ }
114+
115+ /**
116+ * constant (1): return the formula regardless of subject
117+ *
118+ * *[a 1 b] b
119+ */
120+ function constant (s, f) {
121+ return f
122+ }
123+
124+ /**
125+ * evaluate (2): evaluate the product of second formula against the product of the first
126+ *
127+ * *[a 2 b c] *[*[a b] *[a c]]
128+ */
129+ function evaluate (s, f) {
130+ return nock(nock(s, f[0]), nock(s, f[1]))
131+ }
132+
133+ /**
134+ * cell (3): test if the product is a cell
135+ *
136+ * *[a 3 b] ?*[a b]
137+ */
138+ function cell (s, f) {
139+ return wut(nock(s, f))
140+ }
141+
142+ /**
143+ * incr (4): increment the product
144+ *
145+ * *[a 4 b] +*[a b]
146+ */
147+ function incr (s, f) {
148+ return lus(nock(s, f))
149+ }
150+
151+ /**
152+ * eq (5): test for equality between nouns in the product
153+ *
154+ * *[a 5 b] =*[a b]
155+ */
156+ function eq (s, f) {
157+ return tis(nock(s, f))
158+ }
159+
160+ /* macro-formulas */
161+
162+ /**
163+ * ife (6): if/then/else
164+ *
165+ * *[a 6 b c d] *[a 2 [0 1] 2 [1 c d] [1 0] 2 [1 2 3] [1 0] 4 4 b]
166+ */
167+ function macroIfe (s, f) {
168+ return nock(s, [2, [[0, 1], [2, [[1, [f[1][0], f[1][1]]], [[1, 0], [2, [[1, [2, 3]], [[1, 0], [4, [4, f[0]]]]]]]]]]])
169+ }
170+
171+ function ife (s, f) {
172+ var cond = nock(s, f[0])
173+
174+ if (cond === 0) return nock(s, f[1][0])
175+ if (cond === 1) return nock(s, f[1][1])
176+
177+ throw new Error('invalid ife conditional')
178+ }
179+
180+ /**
181+ * compose (7): evaluate formulas composed left-to-right
182+ *
183+ * *[a 7 b c] *[a 2 b 1 c]
184+ */
185+ function macroCompose (s, f) {
186+ return nock(s, [2, [f[0], [1, f[1]]]])
187+ }
188+
189+ function compose (s, f) {
190+ // alternate form:
191+ // return nock(nock(s, f[0]), constant(s, f[1]))
192+ return nock(nock(s, f[0]), f[1])
193+ }
194+
195+ /**
196+ * extend (8): evaluate the second formula against [product of first, subject]
197+ *
198+ * *[a 8 b c] *[a 7 [[7 [0 1] b] 0 1] c]
199+ */
200+ function macroExtend (s, f) {
201+ return nock(s, [7, [[[7, [[0, 1], f[0]]], [0, 1]], f[1]]])
202+ }
203+
204+ function extend (s, f) {
205+ // alternate form:
206+ // return nock([compose(s, [[0, 1], f[0]]), s], f[1])
207+ return nock([nock(s, f[0]), s], f[1])
208+ }
209+
210+ /**
211+ * invoke (9): construct a core and evaluate one of it's arms against it
212+ *
213+ * *[a 9 b c] *[a 7 c 2 [0 1] 0 b]
214+ */
215+ function macroInvoke (s, f) {
216+ return nock(s, [7, [f[1], [2, [[0, 1], [0, f[0]]]]]])
217+ }
218+
219+ function invoke (s, f) {
220+ var prod = nock(s, f[1])
221+ return nock(prod, slot(prod, f[0]))
222+ }
223+
224+ /**
225+ * hint (10): skip first formula, evaluate second
226+ *
227+ * *[a 10 [b c] d] *[a 8 c 7 [0 3] d]
228+ * *[a 10 b c] *[a c]
229+ */
230+ function macroHint (s, f) {
231+ if (wut(f[0]) === 0) return nock(s, [8, [f[0][1], [7, [[0, 3], f[1]]]]])
232+ return nock(s, f[1])
233+ }
234+
235+ function hint (s, f) {
236+ if (wut(f[0]) === 0) {
237+ if (wut(f[0][1]) === 1) throw new Error('invalid hint')
238+ nock(s, f[0][1])
239+ }
240+ return nock(s, f[1])
241+ }
242+
243+ /* indexed formula functions */
244+ var macroFormulas = [slot, constant, evaluate, cell, incr, eq, macroIfe, macroCompose, macroExtend, macroInvoke, macroHint]
245+ var formulas = [slot, constant, evaluate, cell, incr, eq, ife, compose, extend, invoke, hint]
246+
247+ /**
248+ * nock (*)
249+ *
250+ * the nock function
251+ *
252+ * *[a [b c] d] [*[a b c] *[a d]]
253+ * *a *a
254+ */
255+ function nock (s, f) {
256+ if (wut(f[0]) === 0) return [nock(s, f[0]), nock(s, f[1])]
257+
258+ var idx = f[0]
259+
260+ if (idx > 10) throw new Error('invalid formula: ' + idx)
261+
262+ if (useMacros) return macroFormulas[idx](s, f[1])
263+
264+ return formulas[idx](s, f[1])
265+ }
266+
267+ /* construct a JS noun (group an array into pairs, associating right) */
268+ function assoc (x) {
269+ if (!x.length) return x
270+
271+ if (x.length === 1) return assoc(x[0])
272+
273+ return [assoc(x[0]), assoc(x.slice(1))]
274+ }
275+
276+ /* deep equality for arrays or primitives */
277+ function deepEqual (a, b) {
278+ if (a === b) return true
279+
280+ if (!(Array.isArray(a) && Array.isArray(b))) return false
281+ if (a.length !== b.length) return false
282+
283+ for (var i = 0; i < a.length; i++) {
284+ if (!deepEqual(a[i], b[i])) return false
285+ }
286+
287+ return true
288+ }
289+
290+ /* parse a hoon-serialized nock formula and construct a JS noun */
291+ function parseNoun (x) {
292+ if (Array.isArray(x)) return assoc(x)
293+
294+ if (typeof x === 'string') {
295+ var str = x.replace(/[\."']/g, '').split(' ').join(',')
296+ return assoc(JSON.parse(str))
297+ }
298+
299+ return x
300+ }
301+
302+ function nockInterface () {
303+ var args = [].slice.call(arguments)
304+ var subject, formula, noun
305+
306+ if (args.length === 1) {
307+ formula = parseNoun(args[0])
308+ } else if (args.length === 2) {
309+ subject = parseNoun(args[0])
310+ formula = parseNoun(args[1])
311+ } else {
312+ noun = assoc(args)
313+ subject = noun[0]
314+ formula = noun[1]
315+ }
316+
317+ if (!formula) throw new Error('formula required')
318+
319+ if (!subject) {
320+ // !=(~)
321+ subject = [1, 0]
322+ }
323+
324+ return nock(subject, formula)
325+ }
326+
327+ return {
328+ nock: nockInterface,
329+ _nock: nock,
330+ useMacros: function (arg) {
331+ useMacros = arg === undefined || arg
332+ return this
333+ },
334+ util: {
335+ assoc: assoc,
336+ parseNoun: parseNoun,
337+ deepEqual: deepEqual
338+ },
339+ operators: {
340+ wut: wut,
341+ lus: lus,
342+ tis: tis,
343+ fas: fas
344+ },
345+ formulas: {
346+ slot: slot,
347+ constant: constant,
348+ evaluate: evaluate,
349+ cell: cell,
350+ incr: incr,
351+ eq: eq,
352+ macroIfe: macroIfe,
353+ ife: ife,
354+ macroCompose: macroCompose,
355+ compose: compose,
356+ macroExtend: macroExtend,
357+ extend: extend,
358+ macroInvoke: macroInvoke,
359+ invoke: invoke,
360+ macroHint: macroHint,
361+ hint: hint
362+ }
363+ }
364+}))
365+```
docs/nock/implementations/python.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2title: Python
3title: Python
3sort: 1
4sort: 1
4next: true
5next: true
docs/nock/implementations/ruby.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2title: Ruby
3title: Ruby
3sort: 2
4sort: 2
4next: true
5next: true
docs/nock/implementations/scala.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2title: Scala
3title: Scala
3sort: 4
4sort: 4
4next: true
5next: true
docs/nock/implementations/scheme.mdnew file+128
@@ -0,0 +1,128 @@
1+---
2+navhome: /docs
3+title: Scheme
4+sort: 8
5+next: true
6+---
7+
8+# Scheme
9+
10+From [Kohányi Róbert](https://github.com/kohanyirobert/snock/blob/master/snock.ss):
11+
12+```
13+(import (rnrs (6)))
14+
15+(define (i a) a)
16+
17+(define (n a r)
18+ (cond
19+ ((list? a)
20+ (let ((l (length a)))
21+ (cond
22+ ((equal? l 0) (raise 1))
23+ ((equal? l 1) (r (car a)))
24+ (else
25+ (let ((t (cond
26+ ((equal? l 2) (cadr a))
27+ (else (cdr a)))))
28+ (n (car a)
29+ (lambda (p) (n t
30+ (lambda (q) (r (cons p q)))))))))))
31+ ((fixnum? a) (r a))
32+ (else (raise 2))))
33+
34+(define (wut a)
35+ (cond
36+ ((fixnum? a) 1)
37+ (else 0)))
38+
39+(define (lus a)
40+ (cond
41+ ((equal? (wut a) 0) (raise 3))
42+ (else (+ 1 a))))
43+
44+(define (tis a)
45+ (cond
46+ ((equal? (wut a) 1) (raise 4))
47+ ((equal? (car a) (cdr a)) 0)
48+ (else 1)))
49+
50+(define (fas a r)
51+ (cond
52+ ((equal? (wut a) 1) (raise 5))
53+ (else
54+ (let ((h (car a))
55+ (t (cdr a)))
56+ (cond
57+ ((not (fixnum? h)) (raise 6))
58+ ((equal? h 0) (raise 7))
59+ ((equal? h 1) (r t))
60+ ((fixnum? t) (raise 8))
61+ ((equal? h 2) (r (car t)))
62+ ((equal? h 3) (r (cdr t)))
63+ (else
64+ (fas (cons (div h 2) t)
65+ (lambda (p) (fas (cons (+ 2 (mod h 2)) p)
66+ (lambda (q) (r q)))))))))))
67+
68+(define (tar a r)
69+ (cond
70+ ((equal? (wut a) 1) (raise 9))
71+ (else
72+ (let ((s (car a))
73+ (f (cdr a)))
74+ (cond
75+ ((equal? (wut f) 1) (raise 10))
76+ (else
77+ (let ((o (car f))
78+ (v (cdr f)))
79+ (cond
80+ ((equal? (wut o) 0) (tar (cons s o)
81+ (lambda (p) (tar (cons s v)
82+ (lambda (q) (r (cons p q)))))))
83+ ((equal? o 0) (r (fas (cons v s) i)))
84+ ((equal? o 1) (r v))
85+ ((equal? o 3) (tar (cons s v)
86+ (lambda (p) (r (wut p)))))
87+ ((equal? o 4) (tar (cons s v)
88+ (lambda (p) (r (lus p)))))
89+ ((equal? o 5) (tar (cons s v)
90+ (lambda (p) (r (tis p)))))
91+ ((equal? (wut v) 1) (raise 11))
92+ (else
93+ (let ((x (car v))
94+ (y (cdr v)))
95+ (cond
96+ ((equal? o 2) (tar (cons s x)
97+ (lambda (p) (tar (cons s y)
98+ (lambda (q) (tar (cons p q)
99+ (lambda (u) (r u))))))))
100+ ((equal? o 7) (tar (n (list (list s) 2 (list x) 1 (list y)) i)
101+ (lambda (p) (r p))))
102+ ((equal? o 8) (tar (n (list (list s) 7 (list (list 7 (list 0 1) (list x)) 0 1) (list y)) i)
103+ (lambda (p) (r p))))
104+ ((equal? o 9) (tar (n (list (list s) 7 (list y) 2 (list 0 1) 0 (list x)) i)
105+ (lambda (p) (r p))))
106+ ((equal? o 10) (cond
107+ ((equal? (wut x) 1) (tar (cons s y)
108+ (lambda (p) (r p))))
109+ (else (tar (n (list (list s) 8 (list (cdr x)) 7 (list 0 3) (list y)) i)
110+ (lambda (p) (r p))))))
111+ ((equal? (wut y) 1) (raise 12))
112+ ((equal? o 6) (tar (n (list
113+ (list s)
114+ 2
115+ (list 0 1)
116+ 2
117+ (list 1 (list (car y)) (list (cdr y)))
118+ (list 1 0)
119+ 2
120+ (list 1 2 3)
121+ (list 1 0)
122+ 4
123+ 4
124+ (list x))
125+ i)
126+ (lambda (p) (r p))))
127+ (else (raise 13)))))))))))))
128+```
docs/nock/implementations/swift.mdnew file+366
@@ -0,0 +1,366 @@
1+---
2+navhome: /docs
3+title: Swift
4+sort: 10
5+next: true
6+---
7+
8+# Swift
9+
10+```swift
11+import Foundation
12+// 1 :: A noun is an atom or a cell.
13+// 2 :: An atom is a natural number.
14+// 3 :: A cell is an ordered pair of nouns.
15+// 4
16+// 5 :: nock(a) *a
17+// 6 :: [a b c] [a [b c]]
18+// 7
19+// 8 :: ?[a b] 0
20+// 9 :: ?a 1
21+// 10 :: +[a b] +[a b]
22+// 11 :: +a 1 + a
23+// 12 :: =[a a] 0
24+// 13 :: =[a b] 1
25+// 14 :: =a =a
26+// 15
27+// 16 :: /[1 a] a
28+// 17 :: /[2 a b] a
29+// 18 :: /[3 a b] b
30+// 19 :: /[(a + a) b] /[2 /[a b]]
31+// 20 :: /[(a + a + 1) b] /[3 /[a b]]
32+// 21 :: /a /a
33+// 22
34+// 23 :: *[a [b c] d] [*[a b c] *[a d]]
35+// 24
36+// 25 :: *[a 0 b] /[b a]
37+// 26 :: *[a 1 b] b
38+// 27 :: *[a 2 b c] *[*[a b] *[a c]]
39+// 28 :: *[a 3 b] ?*[a b]
40+// 29 :: *[a 4 b] +*[a b]
41+// 30 :: *[a 5 b] =*[a b]
42+// 31
43+// 32 :: *[a 6 b c d] *[a 2 [0 1] 2 [1 c d] [1 0] 2 [1 2 3] [1 0] 4 4 b]
44+// 33 :: *[a 7 b c] *[a 2 b 1 c]
45+// 34 :: *[a 8 b c] *[a 7 [[7 [0 1] b] 0 1] c]
46+// 35 :: *[a 9 b c] *[a 7 c 2 [0 1] 0 b]
47+// 36 :: *[a 10 [b c] d] *[a 8 c 7 [0 3] d]
48+// 37 :: *[a 10 b c] *[a c]
49+// 38
50+// 39 :: *a *a
51+
52+// 1 :: A noun is an atom or a cell.
53+public indirect enum Noun: IntegerLiteralConvertible, ArrayLiteralConvertible, Equatable, Hashable, CustomStringConvertible
54+{
55+ // 2 :: An atom is a natural number.
56+ public typealias ATOM = UIntMax
57+
58+ case Atom(ATOM)
59+ // 3 :: A cell is an ordered pair of nouns.
60+ case Cell(Noun, Noun)
61+ case Invalid
62+
63+ public static var YES: Noun { return .Atom(0) }
64+ public static var NO: Noun { return .Atom(1) }
65+
66+ public init(_ noun: Noun) { self = noun }
67+
68+ // 6 :: [a b c] [a [b c]]
69+ public init(_ nouns: [Noun]) {
70+ self = .Invalid
71+ if nouns.count > 0 {
72+ var reverse = nouns.reverse().generate()
73+ self = reverse.next()!
74+ while let n = reverse.next() {
75+ self = .Cell(n, self)
76+ }
77+ }
78+ }
79+
80+ // protocol IntegerLiteralConvertible
81+ public typealias IntegerLiteralType = ATOM
82+ public init(integerLiteral value: IntegerLiteralType) {
83+ self = .Atom(value)
84+ }
85+
86+ // protocol ArrayLiteralConvertible
87+ public typealias Element = Noun
88+ public init(arrayLiteral elements: Element...) {
89+ self = Noun(elements)
90+ }
91+
92+ // Array subscript
93+ public subscript(axis: ATOM) -> Noun {
94+ return fas(.Cell(.Atom(axis), self))
95+ }
96+
97+ // protocol Hashable
98+ public var hashValue: Int {
99+ //return self.description.hashValue
100+ switch self {
101+ case let .Atom(a):
102+ return a.hashValue
103+ case let .Cell(a, b):
104+ return (5381 + 31 &* a.hashValue) &+ b.hashValue
105+ default:
106+ abort()
107+ }
108+ }
109+
110+ // protocol CustomStringConvertible
111+ public var description: String {
112+ return describe()
113+ }
114+
115+ private func describe(depth: Int = 0) -> String {
116+ var sub = ""
117+ let next = depth+1
118+ switch self {
119+ case .Invalid:
120+ return "[%INVALID%]"
121+ case let .Atom(atom):
122+ return "\(atom)"
123+ case let .Cell(.Cell(a, b), c):
124+ sub = "[\(a.describe(next)) \(b.describe(next))] \(c.describe(next))"
125+ case let .Cell(a, b):
126+ sub = "\(a.describe(next)) \(b.describe(next))"
127+ }
128+ return depth == 0 ? "[\(sub)]" : sub
129+ }
130+}
131+
132+// protocol Equatable
133+public func == (left: Noun, right: Noun) -> Bool
134+{
135+ switch (left, right) {
136+ case let (.Atom(lhs), .Atom(rhs)): return lhs == rhs
137+ case let (.Cell(lp, lq), .Cell(rp, rq)): return lp == rp && lq == rq
138+ case (.Invalid, .Invalid): return true
139+ default: return false
140+ }
141+}
142+
143+public func wut(noun: Noun) -> Noun
144+{
145+ switch noun {
146+ // 8 :: ?[a b] 0
147+ case .Cell:
148+ return Noun.YES
149+ case .Atom:
150+ // 9 :: ?a 1
151+ return Noun.NO
152+ default:
153+ //return wut(noun)
154+ abort()
155+ }
156+}
157+
158+public func lus(noun: Noun) -> Noun
159+{
160+ if case let .Atom(a) = noun {
161+ // 11 :: +a 1 + a
162+ return .Atom(1+a)
163+ }
164+ // 10 :: +[a b] +[a b]
165+ //return lus(noun)
166+ abort()
167+}
168+
169+public func tis(noun: Noun) -> Noun
170+{
171+ if case let .Cell(a, b) = noun {
172+ // 12 :: =[a a] 0
173+ // 13 :: =[a b] 1
174+ return (a == b) ? Noun.YES : Noun.NO
175+ }
176+ // 14 :: =a =a
177+ //return tis(noun)
178+ abort()
179+}
180+
181+public func fas(noun: Noun) -> Noun
182+{
183+ switch noun {
184+ // 16 :: /[1 a] a
185+ case let .Cell(1, a):
186+ return a
187+ // 17 :: /[2 a b] a
188+ case let .Cell(2, .Cell(a, _)):
189+ return a
190+ // 18 :: /[3 a b] b
191+ case let .Cell(3, .Cell(_, b)):
192+ return b
193+ // 19 :: /[(a + a) b] /[2 /[a b]]
194+ // 20 :: /[(a + a + 1) b] /[3 /[a b]]
195+ case let .Cell(.Atom(axis), tree):
196+ let inner = Noun.Atom(axis / 2)
197+ let outer = Noun.Atom(2 + (axis % 2))
198+ return fas(.Cell(outer, fas(.Cell(inner, tree))))
199+ default:
200+ // 21 :: /a /a
201+ //return fas(noun)
202+ abort()
203+ }
204+}
205+
206+public func tar(noun: Noun) -> Noun
207+{
208+ switch noun {
209+ case let .Cell(a, formula):
210+ switch formula {
211+ // 23 :: *[a [b c] d] [*[a b c] *[a d]]
212+ case let .Cell(.Cell(b, c), d):
213+ return .Cell(tar([a, b, c]), tar([a, d]))
214+
215+ // 25 :: *[a 0 b] /[b a]
216+ case let .Cell(0, b):
217+ return fas([b, a])
218+
219+ // 26 :: *[a 1 b] b
220+ case let .Cell(1, b):
221+ return b
222+
223+ // 27 :: *[a 2 b c] *[*[a b] *[a c]]
224+ case let .Cell(2, .Cell(b, c)):
225+ return tar([tar([a, b]), tar([a, c])])
226+
227+ // 28 :: *[a 3 b] ?*[a b]
228+ case let .Cell(3, b):
229+ return wut(tar([a, b]))
230+
231+ // 29 :: *[a 4 b] +*[a b]
232+ case let .Cell(4, b):
233+ return lus(tar([a, b]))
234+
235+ // 30 :: *[a 5 b] =*[a b]
236+ case let .Cell(5, b):
237+ return tis(tar([a, b]))
238+
239+ // 32 :: *[a 6 b c d] *[a 2 [0 1] 2 [1 c d] [1 0] 2 [1 2 3] [1 0] 4 4 b]
240+ case let .Cell(6, .Cell(b, .Cell(c, d))):
241+ return tar([a, 2, [0, 1], 2, [1, c, d], [1, 0], 2, [1, 2, 3], [1, 0], 4, 4, b])
242+
243+ // 33 :: *[a 7 b c] *[a 2 b 1 c]
244+ case let .Cell(7, .Cell(b, c)):
245+ return tar([a, 2, b, 1, c])
246+
247+ // 34 :: *[a 8 b c] *[a 7 [[7 [0 1] b] 0 1] c]
248+ case let .Cell(8, .Cell(b, c)):
249+ return tar([a, 7, [[7, [0, 1], b], 0, 1], c])
250+
251+ // 35 :: *[a 9 b c] *[a 7 c 2 [0 1] 0 b]
252+ case let .Cell(9, .Cell(b, c)):
253+ return tar([a, 7, c, 2, [0, 1], 0, b])
254+
255+ // 36 :: *[a 10 [b c] d] *[a 8 c 7 [0 3] d]
256+ case let .Cell(10, .Cell(.Cell(_, c), d)):
257+ return tar([a, 8, c, 7, [0, 3], d])
258+
259+ // 37 :: *[a 10 b c] *[a c]
260+ case let .Cell(10, .Cell(_, c)):
261+ return tar([a, c]);
262+
263+ default:
264+ //return tar(noun)
265+ abort()
266+ }
267+ default:
268+ //return tar(noun)
269+ abort()
270+ }
271+}
272+
273+
274+public var nock_functions = Dictionary<Noun, Noun -> Noun>()
275+
276+public func dao(formula: Noun) -> Noun->Noun
277+{
278+ if let cached = nock_functions[formula] {
279+ return cached
280+ }
281+
282+ let compiler = { () -> Noun -> Noun in
283+ switch formula {
284+ case let .Cell(.Cell(b, c), d): // Distribution
285+ let (p, q) = (dao(.Cell(b, c)), dao(d))
286+ return { a in .Cell(p(a), q(a)) }
287+
288+ case let .Cell(0, b): // Axis
289+ return { a in fas(.Cell(b, a)) }
290+
291+ case let .Cell(1, b): // Just
292+ return { _ in b }
293+
294+ case let .Cell(2, .Cell(b, c)): // Fire
295+ let (f, g) = (dao(b), dao(c))
296+ return { a in dao(g(a))(f(a)) }
297+
298+ case let .Cell(3, b): // Depth
299+ let f = dao(b)
300+ return { a in wut(f(a)) }
301+
302+ case let .Cell(4, b): // Bump
303+ let f = dao(b)
304+ return { a in lus(f(a)) }
305+
306+ case let .Cell(5, b): // Same
307+ let f = dao(b)
308+ return { a in tis(f(a)) }
309+
310+ case let .Cell(6, .Cell(b, .Cell(c, d))): // If
311+ let (p, q, r) = (dao(b), dao(c), dao(d))
312+ return { a in
313+ switch p(a) {
314+ case Noun.self.YES:
315+ return q(a)
316+ case Noun.self.NO:
317+ return r(a)
318+ default:
319+ return tar(.Cell(a, formula))
320+ }
321+ }
322+
323+ case let .Cell(7, .Cell(b, c)): // Compose
324+ let (f, g) = (dao(b), dao(c))
325+ return { a in g(f(a)) }
326+
327+ case let .Cell(8, .Cell(b, c)): // Push
328+ let (f, g) = (dao(b), dao(c))
329+ return { a in g(.Cell(f(a), a)) }
330+
331+ case let .Cell(9, .Cell(b, c)): // Call
332+ let f = dao(c)
333+ return { a in
334+ let core = f(a)
335+ let arm = dao(fas(.Cell(b, core)))
336+ return arm(core)
337+ }
338+
339+ case let .Cell(10, .Cell(.Cell(_, c), d)): // Hint
340+ let ignore = dao(c)
341+ let f = dao(d)
342+ return { a in ignore(a); return f(a) }
343+
344+ case let .Cell(10, .Cell(_, c)): // Hint
345+ let f = dao(c)
346+ return { a in f(a) }
347+
348+ default:
349+ return { a in tar(.Cell(a, formula)) }
350+ }
351+ }
352+
353+ let r = compiler()
354+ nock_functions[formula] = r
355+ return r
356+}
357+
358+public func nock(n: Noun) -> Noun
359+{
360+ if case let .Cell(a, b) = n {
361+ let f = dao(b)
362+ return f(a)
363+ }
364+ return nock(n)
365+}
366+```
docs/using.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 2
3sort: 2
3---
4---
4
5
docs/using/admin.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2next: true
3next: true
3sort: 3
4sort: 3
4title: Basic operation
5title: Basic operation
docs/using/filesystem.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2next: true
3next: true
3sort: 6
4sort: 6
4title: Filesystem
5title: Filesystem
docs/using/install.md+2−2
@@ -1,8 +1,8 @@
1---
1---
2+navhome: /docs
2next: true
3next: true
3sort: 1
4sort: 1
4title: Install
5title: Install
5−navhome: /main
6---
6---
7
7
8# Install
8# Install
@@ -48,7 +48,7 @@ Which can usually be installed with the following one-liners:
48 sudo dnf install gcc gcc-c++ git gmp-devel openssl-devel openssl ncurses-devel libsigsegv-devel ctags automake autoconf libtool ragel cmake re2c
48 sudo dnf install gcc gcc-c++ git gmp-devel openssl-devel openssl ncurses-devel libsigsegv-devel ctags automake autoconf libtool ragel cmake re2c
49
49
50 # FreeBSD
50 # FreeBSD
51− pkg install git gmake gmp libsigsegv openssl automake autoconf ragel cmake re2c libtool
51+ pkg install git gmake gmp libsigsegv curl python automake autoconf ragel cmake re2c libtool
52
52
53 # Arch
53 # Arch
54 pacman -S gcc gmp libsigsegv openssl automake autoconf ragel cmake re2c libtool ncurses
54 pacman -S gcc gmp libsigsegv openssl automake autoconf ragel cmake re2c libtool ncurses
docs/using/layout.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 8
3sort: 8
3title: Source layout
4title: Source layout
4---
5---
docs/using/messaging.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2next: true
3next: true
3sort: 4
4sort: 4
4title: Messaging (:talk)
5title: Messaging (:talk)
docs/using/setup.md+26−15
@@ -1,8 +1,8 @@
1---
1---
2+navhome: /docs
2next: true
3next: true
3sort: 2
4sort: 2
4title: Setup
5title: Setup
5−navhome: /docs
6---
6---
7
7
8# Getting started
8# Getting started
@@ -11,19 +11,28 @@ On disk your urbit is an append-only log and a checkpoint. Or, in simpler terms
11
11
12## Initialize
12## Initialize
13
13
14−To create an urbit, we must make a pier and assign it an identity. An urbit with an identity is a 'planet', if it was generated by a 'star' (an urbit that makes more urbits. Accordingly, a 'galaxy' is an urbit that makes stars).
14+To create an urbit, we need an identity, called a "ship." A ship
15+is both a network address and a memorable name.
16+
17+You are probably creating one of two kinds of ship, a 32-bit
18+"planet" or a 128-bit "comet."
15
19
16−To make a planet, you need a ticket from a star. If you have a ticket, like `~fortyv-tombyt-tabsen-sonres`, start your planet `~fintud-macrep` like so:
20+If you have an Urbit invitation, you'll have a planet like
21+`~fintud-macrep` and `~fortyv-tombyt-tabsen-sonres`. To create
22+your pier:
17
23
18 $ bin/urbit -w fintud-macrep -t fortyv-tombyt-tabsen-sonres
24 $ bin/urbit -w fintud-macrep -t fortyv-tombyt-tabsen-sonres
19
25
20−This will create a directory `fintud-macrep/` and begin building your urbit. Assembling a planet may take a few minutes.
26+This will create a directory `fintud-macrep/` and begin building
27+your urbit. This may take a few minutes.
21
28
22−If you do not have a ticket, you can still make a 'comet', a parentless urbit drifting thorugh cyberspace. You can specify any name you like.
29+If you do not have a ticket, you can still make a 'comet', a wild
30+urbit drifting through cyberspace. Pick your own directory name,
31+it doesn't matter:
23
32
24− $ bin/urbit -c comet
33+ $ bin/urbit -c mycomet
25
34
26−This will create the directory `comet/` and generate a 64-bit identity for your urbit.
35+This will create the directory `mycomet/` and generate a 128-bit identity for your urbit.
27
36
28## Orientation
37## Orientation
29
38
@@ -50,7 +59,9 @@ Use `^X` (ctrl-x) to change your prompt. Let's join the main Urbit chat channel
50
59
51 ~fitund-macrep:talk() ;join ~doznec/urbit-meta
60 ~fitund-macrep:talk() ;join ~doznec/urbit-meta
52
61
62+`:talk` is stateful, so your urbit will download a backlog.
53−`:talk` is stateful, so your urbit will download a backlog. `/urbit-meta` is the place to ask questions, get help and talk about anything Urbit-related.
63+`/urbit-meta` is the place to ask questions, get help and talk
64+about anything Urbit-related.
54
65
55### Web — `:tree`
66### Web — `:tree`
56
67
@@ -58,7 +69,11 @@ Urbit is also accessible through the web. Try opening:
58
69
59 http://localhost:8080/
70 http://localhost:8080/
60
71
72+in your favorite browser. You'll be prompted to use `+code`.
73+This page was generated by `:tree`, the basic Urbit web
74+interface. You can also access your urbit through
61−in your favorite browser. You'll be prompted to use `+code`. This page was generated by `:tree`, the basic Urbit web interface. You can also access your urbit through `http://fintud-macrep.urbit.org` (where `fintud-macrep` is your planet name).
75+`http://fintud-macrep.urbit.org` (where `fintud-macrep` is your
76+planet name).
62
77
63### Filesystem — `%clay`
78### Filesystem — `%clay`
64
79
@@ -77,10 +92,6 @@ which indicates the command was processed.
77
92
78## Learn more
93## Learn more
79
94
80−We go into much greater detail about using each of these components in our walkthroughs:
95+If you're eager to get started programming you're ready to head over to <a href="../../hoon/demo">the Hoon demo</a>.
81−
82−<list src="."></list>
83−
84−With your urbit up and running, you know enough to start learning to program:
85
96
86−<list src="../hoon/"></list>
97+To learn more about using the system, let's keep going:
docs/using/shell.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2next: true
3next: true
3sort: 5
4sort: 5
4title: Shell (:dojo)
5title: Shell (:dojo)
docs/using/web.md+3−2
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2next: true
3next: true
3sort: 7
4sort: 7
4title: Web
5title: Web
@@ -45,7 +46,7 @@ Now modify `/home/web/test.md` to list the children using the `<list/>` JSX:
45
46
46 This is a simple markdown file.
47 This is a simple markdown file.
47
48
48− <div><list /><div/>
49+ <div><list /></div>
49
50
50To view your file as raw `md`:
51To view your file as raw `md`:
51
52
@@ -87,7 +88,7 @@ Let's quickly step through the default contents of `web/`:
87- `lib/js/urb.js` - Base Urbit JS library. Handles AJAX and polling.
88- `lib/js/urb.js` - Base Urbit JS library. Handles AJAX and polling.
88- `static.md` - Sample static file
89- `static.md` - Sample static file
89- `talk/` - Talk compiled JS / CSS
90- `talk/` - Talk compiled JS / CSS
90−- `talk.hoon` - Page body that loads the `dojo` React module.
91+- `talk.hoon` - Page body that loads the `talk` React module.
91- `tree/` - Tree compiled JS / CSS
92- `tree/` - Tree compiled JS / CSS
92- `tree.hoon` - Page body that loads the `tree` React module.
93- `tree.hoon` - Page body that loads the `tree` React module.
93
94
docs/using/web/blog.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 1
3sort: 1
3title: A simple blog
4title: A simple blog
4next: true
5next: true
docs/using/web/comments.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 2
3sort: 2
3title: Blog comments
4title: Blog comments
4next: true
5next: true
docs/using/web/static.md+1
@@ -1,4 +1,5 @@
1---
1---
2+navhome: /docs
2sort: 3
3sort: 3
3title: A static site
4title: A static site
4---
5---
readme.md+11−4
@@ -1,7 +1,14 @@
1−# Urbit docs
1+Urbit docs
2+==========
2
3
3−These are the urbit docs as they appear on urbit.org.
4+These are the urbit docs as they appear on [urbit.org](urbit.org/docs).
4
5
5−We're currently in the process of factoring this repo out of the [urbit core](http://github.com/urbit/urbit) (as of 1/28/2015).
6+If you'd like to serve the contents from your Urbit just copy `docs/` and `docs.md` into `web/` inside your urbit.
6
7
7−This readme will get updated when that process is complete.
8+
9+Contributing
10+============
11+
12+PRs are more than welcome: both corrections and suggestions.
13+
14+We're almost always available on `:talk`, but you can also email [`urbit@urbit.org`](mailto:urbit@urbit.org) or post to [`urbit-dev`](https://groups.google.com/forum/#!forum/urbit-dev) if you have questions.