on master help sign in
making hoon look okay
632f03fGalen Wolfe-Pauly
docs/programming/hoon/catalog.md+13−12
@@ -1,5 +1,6 @@
1---
1---
2−sort: 3
2+sort: 10
3+title: Stems catalog
3---
4---
4
5
5# Stems
6# Stems
@@ -8,67 +9,67 @@ sort: 3
8
9
9<div class="book">
10<div class="book">
10
11
11−## `$ buc` (mold)
12+## `$ buc` (mold)
12
13
13<list src="buc-mold" dataPreview="true" className="runes" childIsFragment="true"></list>
14<list src="buc-mold" dataPreview="true" className="runes" childIsFragment="true"></list>
14
15
15---
16---
16
17
17−## `| bar` (core)
18+## `| bar` (core)
18
19
19<list src="bar-core" dataPreview="true" className="runes" childIsFragment="true"></list>
20<list src="bar-core" dataPreview="true" className="runes" childIsFragment="true"></list>
20
21
21---
22---
22
23
23−## `: col` (cell)
24+## `: col` (cell)
24
25
25<list src="col-cell" dataPreview="true" className="runes" childIsFragment="true"></list>
26<list src="col-cell" dataPreview="true" className="runes" childIsFragment="true"></list>
26
27
27---
28---
28
29
29−## `% cen` (call)
30+## `% cen` (call)
30
31
31<list src="cen-call" dataPreview="true" className="runes" childIsFragment="true"></list>
32<list src="cen-call" dataPreview="true" className="runes" childIsFragment="true"></list>
32
33
33---
34---
34
35
35−## `. dot` (nock)
36+## `. dot` (nock)
36
37
37<list src="dot-nock" dataPreview="true" className="runes" childIsFragment="true"></list>
38<list src="dot-nock" dataPreview="true" className="runes" childIsFragment="true"></list>
38
39
39---
40---
40
41
41−## `^ ket` (cast)
42+## `^ ket` (cast)
42
43
43<list src="ket-cast" dataPreview="true" className="runes" childIsFragment="true"></list>
44<list src="ket-cast" dataPreview="true" className="runes" childIsFragment="true"></list>
44
45
45---
46---
46
47
47−## `~ sig` (hint)
48+## `~ sig` (hint)
48
49
49<list src="sig-hint" dataPreview="true" className="runes" childIsFragment="true"></list>
50<list src="sig-hint" dataPreview="true" className="runes" childIsFragment="true"></list>
50
51
51---
52---
52
53
53−## `; sem` (make)
54+## `; sem` (make)
54
55
55<list src="sem-make" dataPreview="true" className="runes" childIsFragment="true"></list>
56<list src="sem-make" dataPreview="true" className="runes" childIsFragment="true"></list>
56
57
57---
58---
58
59
59−## `= tis` (flow)
60+## `= tis` (flow)
60
61
61<list src="tis-flow" dataPreview="true" className="runes" childIsFragment="true"></list>
62<list src="tis-flow" dataPreview="true" className="runes" childIsFragment="true"></list>
62
63
63---
64---
64
65
65−## `? wut` (test)
66+## `? wut` (test)
66
67
67<list src="wut-test" dataPreview="true" className="runes" childIsFragment="true"></list>
68<list src="wut-test" dataPreview="true" className="runes" childIsFragment="true"></list>
68
69
69---
70---
70
71
71−## `! zap` (wild)
72+## `! zap` (wild)
72
73
73<list src="zap-wild" dataPreview="true" className="runes" childIsFragment="true"></list>
74<list src="zap-wild" dataPreview="true" className="runes" childIsFragment="true"></list>
74
75
docs/programming/hoon/catalog/buc-mold/cab-shoe.md+2−1
@@ -1,8 +1,9 @@
1---
1---
2sort: 1
2sort: 1
3+preview: Form a mold
3---
4---
4
5
5−# `:shoe, $_, "buccab", {$shoe p/twig}`
6+# `:shoe $_ "buccab" {$shoe p/twig}`
6
7
7Form a mold which normalizes to an example.
8Form a mold which normalizes to an example.
8
9
docs/programming/hoon/cheat-sheets.md+1−1
@@ -1,5 +1,5 @@
1---
1---
2−sort: 12
2+sort: 13
3---
3---
4
4
5# Quick references
5# Quick references
docs/programming/hoon/examples.md+10−10
@@ -1,5 +1,5 @@
1---
1---
2−sort: 9
2+sort: 8
3title: Examples
3title: Examples
4---
4---
5
5
@@ -82,14 +82,14 @@ up through the factors we're removing.
82Line `11`: we start a loop. The product of the loop is cast to
82Line `11`: we start a loop. The product of the loop is cast to
83`..main`, which is the core we're in (`+1.main`).
83`..main`, which is the core we're in (`+1.main`).
84
84
85−Lines `12` and `13`: we terminate the loop, returning `..main`,
85+Lines `12` and `13`: we terminate the loop, returning `..main`,
86if the square of the counter exceeds the range.
86if the square of the counter exceeds the range.
87
87
88Line `14`: repeats the loop, incrementing the counter, and
88Line `14`: repeats the loop, incrementing the counter, and
89replacing the core with a version sieved by `reap`.
89replacing the core with a version sieved by `reap`.
90
90
91Lines `16` and `17`: the `reap` arm, which produces a gate that
91Lines `16` and `17`: the `reap` arm, which produces a gate that
92−removes multiples of a factor from the field (set of possible
92+removes multiples of a factor from the field (set of possible
93primes). The sample of this gate is the factor to remove.
93primes). The sample of this gate is the factor to remove.
94
94
95Line `18`: we declare a variable `count`, an atom, with the
95Line `18`: we declare a variable `count`, an atom, with the
@@ -235,7 +235,7 @@ common pattern. (You could put the molds and the gates in the
235same core, but the compiler couldn't constant-fold gate samples
235same core, but the compiler couldn't constant-fold gate samples
236that use these molds, an efficiency cost.)
236that use these molds, an efficiency cost.)
237
237
238−Line `12` defines the `side` mold, an alias for `atom` (`@`).
238+Line `12` defines the `side` mold, an alias for `atom` (`@`).
239A side is a half of the board, as a marked/unmarked bitfield.
239A side is a half of the board, as a marked/unmarked bitfield.
240
240
241Line `13` defines the `spot` mold, a 2D coordinate.
241Line `13` defines the `spot` mold, a 2D coordinate.
@@ -246,7 +246,7 @@ output action), as a book (tagged union). There are two forms of
246(reporting that `'X'` or `'O'` won a game.
246(reporting that `'X'` or `'O'` won a game.
247
247
248Lines `17` to `20` define the `move` mold, a game move. This is
248Lines `17` to `20` define the `move` mold, a game move. This is
249−either `[%x spot]`, `[%o spot]`, or `[%z ~]` to reset the board.
249+either `[%x spot]`, `[%o spot]`, or `[%z ~]` to reset the board.
250
250
251Lines `21` to `23` define the `game` mold, the game state. This
251Lines `21` to `23` define the `game` mold, the game state. This
252is an `a` side, the next side to move; a `z` side, the other
252is an `a` side, the next side to move; a `z` side, the other
@@ -266,7 +266,7 @@ to a bit index.
266
266
267Line `31` is the `get` gate, which produces the bit at a `spot`.
267Line `31` is the `get` gate, which produces the bit at a `spot`.
268
268
269−Line `32` is the `set` gate, which produces a new side with the
269+Line `32` is the `set` gate, which produces a new side with the
270bit at a `spot` set. It works by ORing (`con`) `half` with the
270bit at a `spot` set. It works by ORing (`con`) `half` with the
271binary exponent (`bex`) of the offset (`off`) of the spot.
271binary exponent (`bex`) of the offset (`off`) of the spot.
272
272
@@ -331,7 +331,7 @@ side `z`, and replaces `z` with `next`.
331 ++ spot {x/@ y/@}
331 ++ spot {x/@ y/@}
332 ++ fact $% {$tie $~}
332 ++ fact $% {$tie $~}
333 {$win p/cord}
333 {$win p/cord}
334− ==
334+ ==
335 ++ move $% {$x p/spot}
335 ++ move $% {$x p/spot}
336 {$o p/spot}
336 {$o p/spot}
337 {$z $~}
337 {$z $~}
@@ -358,8 +358,8 @@ side `z`, and replaces `z` with `next`.
358 |= act/move
358 |= act/move
359 ^- {(unit fact) game}
359 ^- {(unit fact) game}
360 ?- act
360 ?- act
361− {$x *} ?>(w.mag ~(mo on p.act))
361+ {$x *} ?>(w.mag ~(mo on p.act))
362− {$o *} ?<(w.mag ~(mo on p.act))
362+ {$o *} ?<(w.mag ~(mo on p.act))
363 {$z *} [~ nu]
363 {$z *} [~ nu]
364 ==
364 ==
365 ::
365 ::
@@ -376,7 +376,7 @@ side `z`, and replaces `z` with `next`.
376 ?: ~(win bo next)
376 ?: ~(win bo next)
377 [[~ %win ?:(w.mag %x %o)] nu]
377 [[~ %win ?:(w.mag %x %o)] nu]
378 [~ mag(w !w.mag, a z.mag, z next)]
378 [~ mag(w !w.mag, a z.mag, z next)]
379− --
379+ --
380 --
380 --
381--
381--
382```
382```
docs/programming/hoon/library.md+2−1
@@ -1,5 +1,6 @@
1---
1---
2−sort: 2
2+sort: 12
3+title: Standard Library
3---
4---
4
5
5Library
6Library
docs/programming/hoon/span.md+1−1
@@ -1,5 +1,5 @@
1---
1---
2−sort: 7
2+sort: 6
3next: true
3next: true
4title: Type: span
4title: Type: span
5---
5---
docs/programming/hoon/troubleshooting.md+4−3
@@ -1,5 +1,6 @@
1---
1---
2−sort: 10
2+sort: 9
3+title: Troubleshooting
3---
4---
4
5
5# Troubleshooting
6# Troubleshooting
@@ -53,7 +54,7 @@ Now your code parses but doesn't compile.
53### Turn on debugging
54### Turn on debugging
54
55
55Your first step should be to put a `!:` ("zapcol") rune at the
56Your first step should be to put a `!:` ("zapcol") rune at the
56−top of the file. This is like calling the C compiler with `-g`;
57+top of the file. This is like calling the C compiler with `-g`;
57it tells the Hoon compiler to generate tracing twigs.
58it tells the Hoon compiler to generate tracing twigs.
58
59
59Bear in mind that `!:` breaks tail-call optimization. This is a
60Bear in mind that `!:` breaks tail-call optimization. This is a
@@ -100,7 +101,7 @@ means you tried to pound a square peg into a round hole.
100
101
101What was the peg and what was the hole? Hoon doesn't tell you by
102What was the peg and what was the hole? Hoon doesn't tell you by
102default, because moral fiber, and also because in too many cases
103default, because moral fiber, and also because in too many cases
103−trivial errors lead to large intimidating dumps. However, you
104+trivial errors lead to large intimidating dumps. However, you
104can use the `~!` rune ("sigzap", `:peep`) to print the type of
105can use the `~!` rune ("sigzap", `:peep`) to print the type of
105any twig in your stack trace.
106any twig in your stack trace.
106
107
docs/programming/hoon/twig.md+2−2
@@ -1,7 +1,7 @@
1---
1---
2−sort: 8
2+sort: 7
3next: true
3next: true
4−title: Expression: twig
4+title: Expressions: twig
5---
5---
6
6
7# Expression: `twig`
7# Expression: `twig`
docs/programming/nock/reference.md−1
@@ -1,6 +1,5 @@
1---
1---
2sort: 3
2sort: 3
3−next: true
4title: Reference
3title: Reference
5---
4---
6
5