on master help sign in
making hoon look okay
commit632f03f77bfd72c21d6ad2abaab34dc3f3e7f6d6 authorGalen Wolfe-Pauly <root@office-for.com> dateTue 19 Apr 2016, 14:02 (11 years ago) parent447c2cb
9 files changed+35−32
docs/programming/hoon/catalog.md+13−12 docs/programming/hoon/catalog/buc-mold/cab-shoe.md+2−1 docs/programming/hoon/cheat-sheets.md+1−1 docs/programming/hoon/examples.md+10−10 docs/programming/hoon/library.md+2−1 docs/programming/hoon/span.md+1−1 docs/programming/hoon/troubleshooting.md+4−3 docs/programming/hoon/twig.md+2−2 docs/programming/nock/reference.md−1
docs/programming/hoon/catalog.md+13−12
@@ -1,5 +1,6 @@
11---
2−sort: 3
2+sort: 10
3+title: Stems catalog
34---
45
56# Stems
@@ -8,67 +9,67 @@ sort: 3
89
910<div class="book">
1011
11−## `$ buc` (mold)
12+## `$ buc` (mold)
1213
1314<list src="buc-mold" dataPreview="true" className="runes" childIsFragment="true"></list>
1415
1516---
1617
17−## `| bar` (core)
18+## `| bar` (core)
1819
1920<list src="bar-core" dataPreview="true" className="runes" childIsFragment="true"></list>
2021
2122---
2223
23−## `: col` (cell)
24+## `: col` (cell)
2425
2526<list src="col-cell" dataPreview="true" className="runes" childIsFragment="true"></list>
2627
2728---
2829
29−## `% cen` (call)
30+## `% cen` (call)
3031
3132<list src="cen-call" dataPreview="true" className="runes" childIsFragment="true"></list>
3233
3334---
3435
35−## `. dot` (nock)
36+## `. dot` (nock)
3637
3738<list src="dot-nock" dataPreview="true" className="runes" childIsFragment="true"></list>
3839
3940---
4041
41−## `^ ket` (cast)
42+## `^ ket` (cast)
4243
4344<list src="ket-cast" dataPreview="true" className="runes" childIsFragment="true"></list>
4445
4546---
4647
47−## `~ sig` (hint)
48+## `~ sig` (hint)
4849
4950<list src="sig-hint" dataPreview="true" className="runes" childIsFragment="true"></list>
5051
5152---
5253
53−## `; sem` (make)
54+## `; sem` (make)
5455
5556<list src="sem-make" dataPreview="true" className="runes" childIsFragment="true"></list>
5657
5758---
5859
59−## `= tis` (flow)
60+## `= tis` (flow)
6061
6162<list src="tis-flow" dataPreview="true" className="runes" childIsFragment="true"></list>
6263
6364---
6465
65−## `? wut` (test)
66+## `? wut` (test)
6667
6768<list src="wut-test" dataPreview="true" className="runes" childIsFragment="true"></list>
6869
6970---
7071
71−## `! zap` (wild)
72+## `! zap` (wild)
7273
7374<list src="zap-wild" dataPreview="true" className="runes" childIsFragment="true"></list>
7475
docs/programming/hoon/catalog/buc-mold/cab-shoe.md+2−1
@@ -1,8 +1,9 @@
11---
22sort: 1
3+preview: Form a mold
34---
45
5−# `:shoe, $_, "buccab", {$shoe p/twig}`
6+# `:shoe $_ "buccab" {$shoe p/twig}`
67
78Form a mold which normalizes to an example.
89
docs/programming/hoon/cheat-sheets.md+1−1
@@ -1,5 +1,5 @@
11---
2−sort: 12
2+sort: 13
33---
44
55# Quick references
docs/programming/hoon/examples.md+10−10
@@ -1,5 +1,5 @@
11---
2−sort: 9
2+sort: 8
33title: Examples
44---
55
@@ -82,14 +82,14 @@ up through the factors we're removing.
8282Line `11`: we start a loop. The product of the loop is cast to
8383`..main`, which is the core we're in (`+1.main`).
8484
85−Lines `12` and `13`: we terminate the loop, returning `..main`,
85+Lines `12` and `13`: we terminate the loop, returning `..main`,
8686if the square of the counter exceeds the range.
8787
8888Line `14`: repeats the loop, incrementing the counter, and
8989replacing the core with a version sieved by `reap`.
9090
9191Lines `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
9393primes). The sample of this gate is the factor to remove.
9494
9595Line `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
235235same core, but the compiler couldn't constant-fold gate samples
236236that use these molds, an efficiency cost.)
237237
238−Line `12` defines the `side` mold, an alias for `atom` (`@`).
238+Line `12` defines the `side` mold, an alias for `atom` (`@`).
239239A side is a half of the board, as a marked/unmarked bitfield.
240240
241241Line `13` defines the `spot` mold, a 2D coordinate.
@@ -246,7 +246,7 @@ output action), as a book (tagged union). There are two forms of
246246(reporting that `'X'` or `'O'` won a game.
247247
248248Lines `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.
250250
251251Lines `21` to `23` define the `game` mold, the game state. This
252252is an `a` side, the next side to move; a `z` side, the other
@@ -266,7 +266,7 @@ to a bit index.
266266
267267Line `31` is the `get` gate, which produces the bit at a `spot`.
268268
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
270270bit at a `spot` set. It works by ORing (`con`) `half` with the
271271binary exponent (`bex`) of the offset (`off`) of the spot.
272272
@@ -331,7 +331,7 @@ side `z`, and replaces `z` with `next`.
331331 ++ spot {x/@ y/@}
332332 ++ fact $% {$tie $~}
333333 {$win p/cord}
334− ==
334+ ==
335335 ++ move $% {$x p/spot}
336336 {$o p/spot}
337337 {$z $~}
@@ -358,8 +358,8 @@ side `z`, and replaces `z` with `next`.
358358 |= act/move
359359 ^- {(unit fact) game}
360360 ?- act
361− {$x *} ?>(w.mag ~(mo on p.act))
362− {$o *} ?<(w.mag ~(mo on p.act))
361+ {$x *} ?>(w.mag ~(mo on p.act))
362+ {$o *} ?<(w.mag ~(mo on p.act))
363363 {$z *} [~ nu]
364364 ==
365365 ::
@@ -376,7 +376,7 @@ side `z`, and replaces `z` with `next`.
376376 ?: ~(win bo next)
377377 [[~ %win ?:(w.mag %x %o)] nu]
378378 [~ mag(w !w.mag, a z.mag, z next)]
379− --
379+ --
380380 --
381381--
382382```
docs/programming/hoon/library.md+2−1
@@ -1,5 +1,6 @@
11---
2−sort: 2
2+sort: 12
3+title: Standard Library
34---
45
56Library
docs/programming/hoon/span.md+1−1
@@ -1,5 +1,5 @@
11---
2−sort: 7
2+sort: 6
33next: true
44title: Type: span
55---
docs/programming/hoon/troubleshooting.md+4−3
@@ -1,5 +1,6 @@
11---
2−sort: 10
2+sort: 9
3+title: Troubleshooting
34---
45
56# Troubleshooting
@@ -53,7 +54,7 @@ Now your code parses but doesn't compile.
5354### Turn on debugging
5455
5556Your 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`;
5758it tells the Hoon compiler to generate tracing twigs.
5859
5960Bear 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.
100101
101102What was the peg and what was the hole? Hoon doesn't tell you by
102103default, 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
104105can use the `~!` rune ("sigzap", `:peep`) to print the type of
105106any twig in your stack trace.
106107
docs/programming/hoon/twig.md+2−2
@@ -1,7 +1,7 @@
11---
2−sort: 8
2+sort: 7
33next: true
4−title: Expression: twig
4+title: Expressions: twig
55---
66
77# Expression: `twig`
docs/programming/nock/reference.md−1
@@ -1,6 +1,5 @@
11---
22sort: 3
3−next: true
43title: Reference
54---
65