on master help sign in
Merge branch 'master' into lustar-description
commit6b875d40bbf7a015df17272127cb953c02a96320 authorpoprox <51337059+syzygyzer@users.noreply.github.com> dateTue 23 Jun 2020, 13:08 (6 years ago) parenta554f57ac27980
40 files changed+1039−811
glossary/chat.md+1−3 reference/hoon-expressions/rune/bar.md+89−17 reference/hoon-expressions/rune/buc.md+55−12 reference/hoon-expressions/rune/cen.md+10−10 reference/hoon-expressions/rune/col.md+8−8 reference/hoon-expressions/rune/constants.md+4−4 reference/hoon-expressions/rune/dot.md+6−6 reference/hoon-expressions/rune/ket.md+10−10 reference/hoon-expressions/rune/lus.md+4−4 reference/hoon-expressions/rune/mic.md+7−7 reference/hoon-expressions/rune/sig.md+13−13 reference/hoon-expressions/rune/terminators.md+3−3 reference/hoon-expressions/rune/tis.md+14−14 reference/hoon-expressions/rune/wut.md+14−14 reference/hoon-expressions/rune/zap.md+7−7 reference/vane-apis/iris.md+193 tutorials/_index.md+3−3 tutorials/arvo/gall.md+6−13 tutorials/creating-an-invite-pool.md+6−6 tutorials/guide-to-breaches.md+9−9 tutorials/hoon-errors.md+21−21 tutorials/hoon/_index.md+2−2 tutorials/hoon/arms-and-cores.md+1−1 tutorials/hoon/bank-account.md+1−1 tutorials/hoon/conditionals.md+20−12 tutorials/hoon/egg-timer.md+99−59 tutorials/hoon/fibonacci.md+6−6 tutorials/hoon/gates.md+37−36 tutorials/hoon/generators.md+2−145 tutorials/hoon/hoon-syntax.md+54−54 tutorials/hoon/libraries.md+4−4 tutorials/hoon/list-of-numbers.md+11−11 tutorials/hoon/lists.md+51−34 tutorials/hoon/nouns.md+52−45 tutorials/hoon/recursion.md+7−7 tutorials/hoon/setup.md+9−11 tutorials/hoon/style.md+76−75 tutorials/hoon/workbook/traffic-light.md+1−1 tutorials/sail-and-udon.md+100−100 tutorials/ship-troubleshooting.md+23−23
glossary/chat.md+1−3
@@ -12,12 +12,10 @@ A chat is a named collection of messages created by and hosted in a ship's chat-
1212
1313Chats are subscribed to by some number of ships which are permitted to post and retrieve messages from the chat.
1414
15−There are four "kinds" of chats, that use different permission modes:
15+There are two "kinds" of chats, that use different permission modes:
1616
1717 * A `channel` is a chat that is publicly readable and writable, with a blacklist for blocking.
1818 * A `village` is an invite-only chat.
19− * A `journal` is publicly readable and privately writable, with a whitelist for authors.
20− * A `mailbox` is readable by its owner and publicly writable, with a blacklist for blocking.
2119
2220### Further Reading
2321
reference/hoon-expressions/rune/bar.md+89−17
@@ -8,13 +8,81 @@ Core expressions produce cores. A core is a cell of `[battery payload]`.
88The `battery` is code, a battery of Nock formulas. The `payload` is the data
99needed to run those formulas correctly.
1010
11−Four core runes (`|=`, `|.`, `|-`, and `|*`) produce a
12−core with a single arm, named `$`. We can recompute this arm
13−with changes, which useful for recursion among other things:
11+Five core runes (`|=`, `|.`, `|-`, `|*`, and `|$`) produce a
12+core with a single arm, named `$`. As with all arms, we can recompute `$``
13+with changes, which is useful for recursion among other things.
1414
1515## Runes
1616
17−### |_ "barcab"
17+### |$ "barbuc"
18+
19+Declares a mold builder wet gate with one or more molds as its
20+sample.
21+
22+##### Syntax
23+
24+Regular:
25+```hoon
26+|$ a=(lest term) b=spec
27+```
28+
29+AST:
30+```hoon
31+[%brbs sample=(lest term) body=spec]
32+```
33+
34+##### Semantics
35+
36+`|$` is used to declare a wet gate mold builder that is polymorphic in its input molds. `a` is a `lest` of `term` used as
37+identifiers for the input molds. `b` is a structure built from elements of `a`.
38+The output of `|$` is a mold builder obtained by
39+substituting the input molds parameterized by `a` into `b`.
40+
41+##### Expands to
42+
43+```hoon
44+|$ [a b]
45+body
46+```
47+becomes
48+```hoon
49+|* [a=$~(* $-(* *)) b=$~(* $-(* *))]
50+^:
51+body
52+```
53+
54+##### Discussion
55+
56+A mold builder is a wet gate from one or more molds to a mold. A mold is a
57+function from nouns to nouns with types that may be partial, is always
58+idempotent, and usually the identity function on the noun itself.
59+
60+`|$` is a restricted form of `|*`. The use of `|$` over `|*` is one of style, as either could
61+be used to make wet gates that are mold builders. The buc in `|$` is a hint that
62+`|$` is closely related to buc runes, and thus `|$` should be used to make mold builders, while `|*` should be used for any other sort of
63+wet gate. Thus, the second argument of `|$` is frequently a buc
64+rune. For further discussion of wet gates, see the entry for [`|*`](#bartar).
65+
66+Like other single-arm cores, the arm for `|$` is named `$` and this can be used to
67+define recursive structures. Note however that Hoon is evaluated eagerly, and so
68+infinite structures are not permitted.
69+
70+Proper style for `|$` is to enclose the first argument with brackets, even if it
71+is only a single term. The interpeter will accept a single term without brackets
72+just fine, but this style is for consistency with the fact that the first argument is a `lest`.
73+
74+##### Examples
75+
76+```
77+~zod:dojo> =foo |$([a b] [b a])
78+
79+~zod:dojo> =bar (foo [@ @tas])
80+
81+~zod:dojo> (bar %cat 3)
82+[%cat 3]
83+```
84+
85+### `|_` "barcab"
1886
1987Produce a **door** (a core with a sample).
2088
@@ -104,7 +172,7 @@ The `ne` door prints a digit in base 10, 16, 32 or 64:
104172'c'
105173```
106174
107−### |% "barcen"
175+### `|%` "barcen"
108176
109177Produce a core, `[battery payload]`.
110178
@@ -164,7 +232,7 @@ A trivial core:
164232101
165233```
166234
167−### |: "barcol"
235+### `|:` "barcol"
168236
169237Produce a gate with a custom sample.
170238
@@ -212,7 +280,7 @@ This is useful if you want a gate to have a sample of a particular type, but you
21228012
213281```
214282
215−### |. "bardot"
283+### `|.` "bardot"
216284
217285Produce a trap (a core with one arm `$`).
218286
@@ -230,7 +298,7 @@ AST:
230298[%brdt p=hoon]
231299```
232300
233−Semantics:
301+##### Semantics
234302
235303A `|.` expression produces a core with a single arm, `$`. The core isn't explicitly given a sample. `a` is a Hoon expression that defines the computation of the `$` arm.
236304
@@ -280,7 +348,7 @@ trap, since it's a core with an `$` arm.
280348
281349> `$(...)` expands to `%=($ ...)` (["centis"](/docs/reference/hoon-expressions/rune/cen#centis)).
282350
283−### |- "barhep"
351+### `|-` "barhep"
284352
285353Produce a trap (a core with one arm `$`) and evaluate it.
286354
@@ -336,7 +404,7 @@ The classic loop is a decrement:
33640441
337405```
338406
339−### |^ "barket"
407+### `|^` "barket"
340408
341409Produce a core whose battery includes a `$` arm and compute the latter.
342410
@@ -395,7 +463,7 @@ A trivial example:
395463100
396464```
397465
398−### |~ "barsig"
466+### `|~` "barsig"
399467
400468Produce an iron gate.
401469
@@ -434,7 +502,7 @@ See [this discussion of core variance models](@/docs/reference/hoon-expressions/
434502<1|usl {a/@ $~}>
435503```
436504
437−### |* "bartar"
505+### `|*` "bartar"
438506
439507Produce a wet gate (one-armed core with sample).
440508
@@ -454,7 +522,8 @@ AST:
454522
455523##### Semantics
456524
457−A `|*` expression produces a wet gate. `a` defines the gate's sample, and `b` is a Hoon expression that determines the output value of the gate.
525+A `|*` expression produces a wet gate. `a` defines the gate's sample, and `b`
526+is a Hoon expression that determines the output value of the gate.
458527
459528##### Expands to
460529
@@ -481,6 +550,9 @@ with `$()`.
481550
482551> `$(...)` expands to `%=($ ...)` (["centis"](@/docs/reference/hoon-expressions/rune/cen.md#centis)).
483552
553+`|*` can be used to make wet gates that produce structures, but this usage is
554+discouraged in favor of `|$`.
555+
484556##### Examples
485557
486558Wet and dry gates in a nutshell:
@@ -500,7 +572,7 @@ Wet and dry gates in a nutshell:
500572The dry gate does not preserve the type of `a` and `b`; the wet
501573gate does.
502574
503−### |= "bartis"
575+### `|=` "bartis"
504576
505577Produce a gate (a one-armed core with a sample).
506578
@@ -560,7 +632,7 @@ A slightly less trivial gate:
560632430
561633```
562634
563−### |@ "barpat"
635+### `|@` "barpat"
564636
565637Produce a 'wet' core `[battery payload]`.
566638
@@ -593,7 +665,7 @@ A `|@` expression produces a 'wet' core whose payload is the expression's subjec
593665
594666The `|@` rune is just like the `|%` rune except that instead of producing a 'dry' core, it produces a 'wet' one. This allows for type polymorphism of its arms, using 'genericity'. See [Advanced types](@/docs/reference/hoon-expressions/advanced.md).
595667
596−### |? "barwut"
668+### `|?` "barwut"
597669
598670Produce a lead trap.
599671
@@ -633,4 +705,4 @@ See this [discussion of the core variance model](@/docs/reference/hoon-expressio
633705
634706~zod:dojo> => ~ ^+ |?(%a) |.(%b)
635707nest-fail
636−```
708+```
reference/hoon-expressions/rune/buc.md+55−12
@@ -52,7 +52,7 @@ Irregular: `*` makes `%noun`, `^` makes `%cell`, `?` makes
5252
5353## Runes
5454
55−### $_ "buccab"
55+### `$_` "buccab"
5656
5757`[%bscb p=hoon]`: structure that normalizes to an example.
5858
@@ -88,7 +88,7 @@ and produces its **example** instead.
8888[%foobaz %moobaz]
8989```
9090
91−### $% "buccen"
91+### `$%` "buccen"
9292
9393`[%bscn p=(list spec)]`: structure which recognizes a union tagged by head atom.
9494
@@ -123,7 +123,7 @@ type default value.
123123[%baz p=0]
124124```
125125
126−### $: "buccol"
126+### `$:` "buccol"
127127
128128`[%bscl p=(list spec)]`: form a cell type.
129129
@@ -158,7 +158,7 @@ Irregular (structure mode): `[a b c]` is `$:(a b c)`.
158158```
159159
160160
161−### $< "bucgal"
161+### `$<` "bucgal"
162162
163163`[%bsld p=spec q=spec]`: Filters a pre-existing mold to obtain a mold
164164that excludes a particular structure.
@@ -193,7 +193,7 @@ ford: %ride failed to execute:
193193 ```
194194
195195
196−### $> "bucgar"
196+### `$>` "bucgar"
197197
198198`[%bsbn p=spec q=spec]`: Filters a mold to obtain a new mold
199199matching a particular structure.
@@ -238,7 +238,7 @@ ford: %ride failed to execute:
238238 ```
239239
240240
241−### $- "buchep"
241+### `$-` "buchep"
242242
243243`[%bshp p=spec q=spec]`: structure that normalizes to an example gate.
244244
@@ -266,7 +266,8 @@ Since a `$-` reduces to a [`$_`](#buccab), it is not useful for normalizing, jus
266266%baz
267267```
268268
269−### $^ "bucket"
269+
270+### `$^` "bucket"
270271
271272`[%bskt p=spec q=spec]`: structure which normalizes a union tagged by head depth (cell).
272273
@@ -300,11 +301,52 @@ Regular: **2-fixed**.
300301[%baz p=0]
301302```
302303
303−### $~ "bucsig"
304+### $& "bucpam"
305+
306+`[%bspd p=spec q=hoon]`: repair a value of a tagged union type
307+
308+##### Syntax
309+
310+Regular: **2-fixed**.
311+
312+```hoon
313+$&(combined-mold=spec normalizing-gate=hoon)
314+```
315+Here `combined-mold` is a tagged union type (typically made with `$%`) and `normalizing-gate` is a
316+gate which accepts values of `combined-mold` and normalizes them to be of one particular type
317+in `combined-mold`.
318+
319+##### Normalizes to
320+
321+The product of the normalizing gate and sample.
322+
323+##### Defaults to
324+
325+The default of the last type listed in `p`, normalized with the normalizing gate.
326+
327+##### Discussion
328+
329+This rune is used to "upgrade" or "repair" values of a structure, typically from
330+an old version to a new version. For example, this may happen when migrating state after
331+updating an app.
332+
333+##### Examples
334+
335+```hoon
336++$ old [%0 @]
337++$ new [%1 ^]
338++$ combined $%(old new)
339++$ adapting $&(combined |=(?-(-.a %0 [%1 1 +.a], %1 a)))
340+```
341+Here `adapting` is a structure that bunts to `[%1 ^]` but also normalizes from
342+`[%0 @]` if called on such a noun.
343+
344+
345+### `$~` "bucsig"
304346
305347`[%bssg p=hoon q=spec]`: define a custom type default value
306348
307−## Product
349+##### Product
308350
309351Creates a structure (custom type) just like `q`, except its default value is `p`.
310352
@@ -342,6 +384,7 @@ First, let's define a type without using `$~`:
342384[%two 478.560.413.032]
343385
344386> *b
387+
345388%$
346389
347390> *@tas
@@ -363,7 +406,7 @@ Using `$~`:
363406%default-value
364407```
365408
366−### $@ "bucpat"
409+### `$@` "bucpat"
367410
368411`[%bsvt p=spec q=spec]`: structure which normalizes a union tagged by head depth (atom).
369412
@@ -400,7 +443,7 @@ Example:
400443```
401444
402445
403−### $= "buctis"
446+### `$=` "buctis"
404447
405448`[%bsts p=skin q=spec]`: structure which wraps a face around another structure.
406449
@@ -435,7 +478,7 @@ p=%foo
435478ford: %ride failed to execute:
436479```
437480
438−### $? "bucwut"
481+### `$?` "bucwut"
439482
440483`[%bswt p=(list spec)]`: form a type from a union of other types.
441484
reference/hoon-expressions/rune/cen.md+10−10
@@ -10,7 +10,7 @@ These runes reduce to the `%=` rune.
1010
1111## Runes
1212
13−### %_ "cencab"
13+### `%_` "cencab"
1414
1515Resolve a wing with changes, preserving type.
1616
@@ -73,7 +73,7 @@ See [how wings are resolved](@/docs/reference/hoon-expressions/limb/_index.md).
7373! nest-fail
7474```
7575
76−### %: "cencol"
76+### `%:` "cencol"
7777
7878Call a gate with many arguments.
7979
@@ -127,7 +127,7 @@ When `%:` is used in tall-form syntax, the series of expressions after `p` must
12712799
128128```
129129
130−### %. "cendot"
130+### `%.` "cendot"
131131
132132Call a gate (function), inverted.
133133
@@ -168,7 +168,7 @@ The `%.` rune is for evaluating the `$` arm of a gate, i.e., calling a function.
1681686
169169```
170170
171−### %- "cenhep" {#cenhep}
171+### `%-` "cenhep" {#cenhep}
172172
173173Call a gate (function).
174174
@@ -217,7 +217,7 @@ This rune is for evaluating the `$` arm of a gate, i.e., calling a gate as a fun
2172176
218218```
219219
220−### %^ "cenket"
220+### `%^` "cenket"
221221
222222Call gate with triple sample.
223223
@@ -251,7 +251,7 @@ AST:
2512516
252252```
253253
254−### %+ "cenlus"
254+### `%+` "cenlus"
255255
256256Call gate with a cell sample.
257257
@@ -288,7 +288,7 @@ A `%+` expression is for calling a gate with a cell sample. `a` is the gate to
2882886
289289```
290290
291−### %~ "censig"
291+### `%~` "censig"
292292
293293Evaluate an arm in a door.
294294
@@ -340,7 +340,7 @@ See also [`|_`](@/docs/reference/hoon-expressions/rune/bar.md#barcab).
34034020
341341```
342342
343−### %* "centar"
343+### `%*` "centar"
344344
345345Evaluate an expression, then resolve a wing with changes.
346346
@@ -403,7 +403,7 @@ A `%*` expression evaluates some arbitrary Hoon expression, `b`, and then resolv
403403[a=1 b=7 c=10]
404404```
405405
406−### %= "centis"
406+### `%=` "centis"
407407
408408Resolve a wing with changes.
409409
@@ -468,4 +468,4 @@ Here's that again in tall form:
468468[p=42 q=6]
469469~zod:dojo> foo(+3 99)
470470[p=5 99]
471−```
471+```
reference/hoon-expressions/rune/col.md+8−8
@@ -8,7 +8,7 @@ The `:` ("col") expressions are used to produce cells, which are pairs of values
88
99## Runes
1010
11−### :_ "colcab"
11+### `:_` "colcab"
1212
1313`[%clcb p=hoon q=hoon]`; construct a cell, inverted.
1414
@@ -29,7 +29,7 @@ Regular: **2-fixed**.
2929[2 1]
3030```
3131
32−### :: "colcol"
32+### `::` "colcol"
3333
3434Code comment
3535
@@ -48,7 +48,7 @@ Code comment
4848 :: to the input
4949```
5050
51−### :- "colhep"
51+### `:-` "colhep"
5252
5353`[%clhp p=hoon q=hoon]`: construct a cell (2-tuple).
5454
@@ -96,7 +96,7 @@ compiler does), `[a b]` is the same as `:-(a b)`.
9696[~ 1]
9797```
9898
99−### :^ "colket"
99+### `:^` "colket"
100100
101101`[%clkt p=hoon q=hoon r=hoon s=hoon]`: construct a quadruple (4-tuple).
102102
@@ -123,7 +123,7 @@ Regular: **4-fixed**.
123123[5 6 7 8]
124124```
125125
126−### :+ "collus"
126+### `:+` "collus"
127127
128128
129129`[%clls p=hoon q=hoon r=hoon]`: construct a triple (3-tuple).
@@ -150,7 +150,7 @@ Regular: **3-fixed**.
150150[%a ~ 'b']
151151```
152152
153−### :~ "colsig"
153+### `:~` "colsig"
154154
155155`[%clsg p=(list hoon)]`: construct a null-terminated list.
156156
@@ -194,7 +194,7 @@ Regular: **running**.
194194[5 3 4 2 1 ~]
195195```
196196
197−### :* "coltar"
197+### `:*` "coltar"
198198
199199`[%cltr p=(list hoon)]`: construct an n-tuple.
200200
@@ -242,4 +242,4 @@ Regular: **running**.
242242 'a'
243243 ==
244244[5 3 4 1 4 9 0 ~ 'a']
245−```
245+```
reference/hoon-expressions/rune/constants.md+4−4
@@ -45,7 +45,7 @@ We can see the contrast with warm atoms by using the compiler parser function, `
4545[%rock p=%ud q=12]
4646```
4747
48−### `:_ "Paths"`
48+### `:_` "Paths"
4949
5050`[%path p=(list (each @ta hoon))]`: path with interpolation.
5151
@@ -74,7 +74,7 @@ Irregular: `/this/is/a/path`.
7474~
7575```
7676
77−### `:_ "Strings with Interpolation"`
77+### `:_` "Strings with Interpolation"
7878
7979`[%knit p=(list (each @t hoon))]`: text string with interpolation.
8080
@@ -122,7 +122,7 @@ String with interpolated prettyprinting:
122122"hello, %world."
123123```
124124
125−### `:_ "Warm Atoms"` {#warm}
125+### `:_` "Warm Atoms" {#warm}
126126
127127`[%sand p=term q=@]`; a constant, warm atom.
128128
@@ -190,4 +190,4 @@ Irregular. A table of examples:
190190```
191191
192192The `@uv` characters are `0-9`, `a-v`. The `@uw` characters are
193−`0-9`, `a-z`, `A-Z`, `-` and `~`.
193+`0-9`, `a-z`, `A-Z`, `-` and `~`.
reference/hoon-expressions/rune/dot.md+6−6
@@ -8,7 +8,7 @@ Anything Nock can do, Hoon can do also. These runes are used for carrying out N
88
99## Runes
1010
11−### .^ "dotket"
11+### `.^` "dotket"
1212
1313`[%dtkt p=spec q=hoon]`: load from the Arvo namespace with a fake Nock instruction: 'Nock `12`''.
1414
@@ -83,7 +83,7 @@ You can modify the time of the file listing quite simply and ask for a listing f
8383
8484`our` is the value for your ship's name.
8585
86−### .+ "dotlus"
86+### `.+` "dotlus"
8787
8888`[%dtls p=hoon]`: increment an atom with Nock `4`.
8989
@@ -113,7 +113,7 @@ Irregular: `+(6)` is `.+(6)`.
113113nest-fail
114114```
115115
116−### .* "dottar"
116+### `.*` "dottar"
117117
118118`[%dttr p=hoon q=hoon]`: evaluate with Nock `2`.
119119
@@ -156,7 +156,7 @@ therefore possible to use Hoon as a typeless language.
1561561
157157```
158158
159−### .= "dottis" {#dottis}
159+### `.=` "dottis" {#dottis}
160160
161161`[%dtts p=hoon q=hoon]`: test for equality with Nock `5`.
162162
@@ -200,7 +200,7 @@ is a common cause of performance bugs.)
200200nest-fail
201201```
202202
203−### .? "dotwut"
203+### `.?` "dotwut"
204204
205205`[%dtwt p=hoon]`: test for cell or atom with Nock `3`.
206206
@@ -220,4 +220,4 @@ Regular: **1-fixed**.
220220
221221> .?([42 43])
222222%.y
223−```
223+```
reference/hoon-expressions/rune/ket.md+10−10
@@ -13,7 +13,7 @@ it never allows invalid nests, it sometimes rejects valid nests.
1313
1414## Runes
1515
16−### ^| "ketbar"
16+### `^|` "ketbar"
1717
1818`[%ktbr p=hoon]`: convert a gold core to an iron core (contravariant).
1919
@@ -49,7 +49,7 @@ The prettyprinter shows the core metal (`.` gold, `|` iron):
4949<1|gcq [@ @n <250.yur 41.wda 374.hzt 100.kzl 1.ypj %151>]>
5050```
5151
52−### ^: "ketcol"
52+### `^:` "ketcol"
5353
5454`[%ktcl p=spec]`: mold gate for type `p`.
5555
@@ -85,7 +85,7 @@ A mold is an idempotent gate that is guaranteed to produce a noun of that type.
8585ford: %ride failed to execute:
8686```
8787
88−### ^. "ketdot"
88+### `^.` "ketdot"
8989
9090`[%ktdt p=hoon q=hoon]`: typecast on value produced by passing `q` to `p`.
9191
@@ -126,7 +126,7 @@ mint-vain
126126~[22 33]
127127```
128128
129−### ^- "kethep"
129+### `^-` "kethep"
130130
131131`[%kthp p=spec q=hoon]`: typecast by explicit type label.
132132
@@ -170,7 +170,7 @@ infinite loop in the compiler).
170170[~ ~.a]
171171```
172172
173−### ^+ "ketlus"
173+### `^+` "ketlus"
174174
175175`[%ktls p=hoon q=hoon]`: typecast by inferred type.
176176
@@ -189,7 +189,7 @@ Regular: **2-fixed**.
189189'a'
190190```
191191
192−### ^& "ketpam"
192+### `^&` "ketpam"
193193
194194`[%ktpm p=hoon]`: convert a core to a zinc core (covariant).
195195
@@ -242,7 +242,7 @@ ford: %slim failed:
242242ford: %ride failed to compute type:
243243```
244244
245−### ^~ "ketsig"
245+### `^~` "ketsig"
246246
247247`[%ktsg p=hoon]`: fold constant at compile time.
248248
@@ -264,7 +264,7 @@ Regular: **1-fixed**.
264264[%1 p=42]
265265```
266266
267−### ^* "kettar"
267+### `^*` "kettar"
268268
269269`[%kttr p=spec]`: Produce example type value.
270270
@@ -315,7 +315,7 @@ Irregular:
315315""
316316```
317317
318−### ^= "kettis"
318+### `^=` "kettis"
319319
320320`[%ktts p=skin q=hoon]`: Bind name to a value.
321321
@@ -351,7 +351,7 @@ a=1
351351[b=1 c=2 d=[x=3 y4]]
352352```
353353
354−### ^? "ketwut"
354+### `^?` "ketwut"
355355
356356`[%ktwt p=hoon]`: convert any core to a lead core (bivariant).
357357
reference/hoon-expressions/rune/lus.md+4−4
@@ -12,7 +12,7 @@ There are various arm runes you can use to produce different kinds of arms. Nor
1212
1313## Runes
1414
15−### +| "lusbar"
15+### `+|` "lusbar"
1616
1717Chapter label.
1818
@@ -60,7 +60,7 @@ Notice that `p.q` has the label `%numbers`. Contrast with:
6060]
6161```
6262
63−### +$ "lusbuc"
63+### `+$` "lusbuc"
6464
6565Produce a structure arm (type definition).
6666
@@ -98,7 +98,7 @@ nest-fail
9898[%.y 22]
9999```
100100
101−### ++ "luslus"
101+### `++` "luslus"
102102
103103Produce a normal arm.
104104
@@ -133,7 +133,7 @@ Any Hoon expression, `q`, may be used to define the arm computation.
13313312
134134```
135135
136−### +* "lustar"
136+### `+*` "lustar"
137137
138138Defines aliases within doors.
139139
reference/hoon-expressions/rune/mic.md+7−7
@@ -9,7 +9,7 @@ Miscellaneous useful macros.
99
1010## Runes
1111
12−### ;: "miccol"
12+### `;:` "miccol"
1313
1414`[%mccl p=hoon q=(list hoon)]`: call a binary function as an n-ary function.
1515
@@ -59,7 +59,7 @@ Irregular: `:(add a b c)` is `;:(add a b c)`.
595912
6060```
6161
62−### ;+ "miclus"
62+### `;+` "miclus"
6363
6464make a single XML node (Sail)
6565
@@ -118,7 +118,7 @@ One interesting thing about Sail is that it allows you to use complex Hoon expre
118118]
119119```
120120
121−### ;; "micmic"
121+### `;;` "micmic"
122122
123123`[%mcmc p=spec q=hoon]`: normalize with a mold, asserting fixpoint.
124124
@@ -162,7 +162,7 @@ Fails because not a fixpoint:
162162ford: %ride failed to execute:
163163```
164164
165−### ;/ "micfas"
165+### `;/` "micfas"
166166
167167`[%mcnt p=hoon]`: tape as XML element.
168168
@@ -179,7 +179,7 @@ ford: %ride failed to execute:
179179[[%~. [%~. "foo] ~] ~]
180180```
181181
182−### ;~ "micsig"
182+### `;~` "micsig"
183183
184184`[%mcsg p=hoon q=(list hoon)]`: glue a pipeline together with a
185185product-sample adapter.
@@ -283,7 +283,7 @@ A more complicated example:
283283"96acd"
284284```
285285
286−### ;* "mictar"
286+### `;*` "mictar"
287287
288288make a list of XML nodes from complex Hoon expression (Sail)
289289
@@ -335,7 +335,7 @@ If you need a complex Hoon expression to produce a `marl`, use the `;*` rune. O
335335]
336336```
337337
338−### ;= "mictis"
338+### `;=` "mictis"
339339
340340make a list of XML nodes (Sail)
341341
reference/hoon-expressions/rune/sig.md+13−13
@@ -7,7 +7,7 @@ Runes that use Nock `11` to pass non-semantic info to the interpreter.
77
88## Runes
99
10−### ~> "siggar"
10+### `~>` "siggar"
1111
1212`[%sggr p=$@(term [p=term q=hoon]) q=hoon]`: raw hint, applied
1313to computation.
@@ -42,7 +42,7 @@ Running the compiler:
4242[%10 p=[p=97 q=[%4 p=[%1 p=2]]] q=[%1 p=42]]
4343```
4444
45−### ~| "sigbar"
45+### `~|` "sigbar"
4646
4747
4848`[%sgbr p=hoon q=hoon]`: tracing printf.
@@ -72,7 +72,7 @@ ford: build failed
7272ford: build failed
7373```
7474
75−### ~$ "sigbuc"
75+### `~$` "sigbuc"
7676
7777`[%sgbc p=term q=hoon]`: profiling hit counter.
7878
@@ -95,7 +95,7 @@ Regular: **2-fixed**.
95953
9696```
9797
98−### ~_ "sigcab"
98+### `~_` "sigcab"
9999
100100`[%sgcb p=hoon q=hoon]`: user-formatted tracing printf.
101101
@@ -124,7 +124,7 @@ ford: build failed
124124ford: build failed
125125```
126126
127−### ~% "sigcen"
127+### `~%` "sigcen"
128128
129129`[%sgcn p=term q=wing r=(list [term hoon]) s=hoon]`: jet registration.
130130
@@ -214,7 +214,7 @@ Here we label the entire `++aesc` core for optimization. You can see the
214214jet in `jets/e/aesc.c`.
215215
216216
217−### ~< "siggal"
217+### `~<` "siggal"
218218
219219
220220`[%sggl p=$@(term [p=term q=hoon]) q=hoon]`: raw hint, applied to
@@ -244,7 +244,7 @@ rather about its product.
244244[%7 p=[%1 p=42] q=[%10 p=[p=97 q=[%4 p=[%0 p=1]]] q=[%0 p=1]]]
245245```
246246
247−### ~+ "siglus"
247+### `~+` "siglus"
248248
249249`[%sgls p=hoon]`: cache a computation.
250250
@@ -284,7 +284,7 @@ This should work fine:
284284573.147.844.013.817.084.101
285285```
286286
287−### ~/ "sigfas"
287+### `~/` "sigfas"
288288
289289`[%sgfs p=term q=hoon]`: jet registration for gate with
290290registered context.
@@ -311,7 +311,7 @@ From the kernel:
311311 $(a (dec a), b +(b))
312312```
313313
314−### ~& "sigpam"
314+### `~&` "sigpam"
315315
316316`[%sgpm p=hoon q=hoon]`: debugging printf.
317317
@@ -346,7 +346,7 @@ Regular: **2-fixed**.
346346~
347347```
348348
349−### ~= "sigtis"
349+### `~=` "sigtis"
350350
351351`[%sgts p=hoon q=hoon]`: detect duplicate.
352352
@@ -378,7 +378,7 @@ This code traverses a tree and replaces all instances of `32` with
378378
379379Without `~=`, it would build a copy of a completely unchanged tree. Sad!
380380
381−### ~? "sigwut"
381+### `~?` "sigwut"
382382
383383`[%sgwt p=hoon q=hoon r=hoon]`: conditional debug printf.
384384
@@ -416,7 +416,7 @@ Regular: **4-fixed**.
416416~
417417```
418418
419−### ~! "sigzap"
419+### `~!` "sigzap"
420420
421421`[%sgzp p=hoon q=hoon]`: print type on compilation fail.
422422
@@ -446,4 +446,4 @@ Regular: **2-fixed**.
446446 a
447447! @t
448448! find.a
449−```
449+```
reference/hoon-expressions/rune/terminators.md+3−3
@@ -7,7 +7,7 @@ The `--` and `==` are used as terminators: `--` for core expressions, and `==` f
77
88## Runes
99
10−### -- "hephep"
10+### `--` "hephep"
1111
1212##### Syntax
1313
@@ -36,7 +36,7 @@ The `|%`, `|_`, and `|^` runes are used to create cores that can have arbitraril
363624
3737```
3838
39−### == "tistis"
39+### `==` "tistis"
4040
4141##### Syntax
4242
@@ -75,4 +75,4 @@ Certain runes are used to create expressions that may include arbitrarily many s
7575 e 21
7676 ==
7777[a=13 b=15 c=17 d=19 e=21]
78−```
78+```
reference/hoon-expressions/rune/tis.md+14−14
@@ -24,7 +24,7 @@ different situations. Hence the whole family of `=` runes.
2424
2525## Runes
2626
27−### => "tisgar"
27+### `=>` "tisgar"
2828
2929`[%tsgr p=hoon q=hoon]`: compose two expressions.
3030
@@ -46,7 +46,7 @@ Regular: **2-fixed**.
4646[6 6]
4747```
4848
49−### =| "tisbar"
49+### `=|` "tisbar"
5050
5151
5252`[%tsbr p=spec q=hoon]`: combine a default type value with the subject.
@@ -78,7 +78,7 @@ Speaking more loosely, `=|` usually "declares a variable" which is "uninitialize
78787
7979```
8080
81−### =: "tiscol"
81+### `=:` "tiscol"
8282
8383`[%tscl p=(list (pair wing hoon)) q=hoon]`: change multiple legs in the subject.
8484
@@ -107,7 +107,7 @@ This rune is like `=.`, but for modifying the values of multiple legs of the sub
107107[b=3 c=4]
108108```
109109
110−### =, "tiscom"
110+### `=,` "tiscom"
111111
112112`[%tscm p=hoon q=hoon]`: expose namespace
113113
@@ -142,7 +142,7 @@ With a dojo-defined face:
142142[2 4]
143143```
144144
145−### =. "tisdot"
145+### `=.` "tisdot"
146146
147147`[%tsdt p=wing q=hoon r=hoon]`: change one leg in the subject.
148148
@@ -178,7 +178,7 @@ a new subject just like the old one except for a changed value at `p`. Note tha
178178nest-fail
179179```
180180
181−### =- "tishep"
181+### `=-` "tishep"
182182
183183`[%tshp p=hoon q=hoon]`: combine a new noun with the subject, inverted.
184184
@@ -207,7 +207,7 @@ Regular: **2-fixed**.
2072078
208208```
209209
210−### =^ "tisket"
210+### `=^` "tisket"
211211
212212`[%tskt p=skin q=wing r=hoon s=hoon]`: pin the head of a pair; change
213213a leg with the tail.
@@ -247,7 +247,7 @@ random number, so we use `=^`:
247247[99 46]
248248```
249249
250−### =< "tisgal"
250+### `=<` "tisgal"
251251
252252`[%tsgl p=hoon q=hoon]`: compose two expressions, inverted.
253253
@@ -284,7 +284,7 @@ Irregular: `foo:baz` is `=<(foo baz)`.
284284[6 6]
285285```
286286
287−### =+ "tislus"
287+### `=+` "tislus"
288288
289289
290290`[%tsls p=hoon q=hoon]`: combine a new noun with the subject.
@@ -307,7 +307,7 @@ Loosely speaking, `=+` is the simplest way of "declaring a variable."
307307
308308##### Examples
309309
310−### =; "tismic"
310+### `=;` "tismic"
311311
312312`[%tsmc p=skin q=hoon r=hoon]`: combine a named noun with the subject, possibly with type annotation; inverted order.
313313
@@ -336,7 +336,7 @@ Regular: **3-fixed**.
3363368
337337```
338338
339−### =/ "tisfas"
339+### `=/` "tisfas"
340340
341341`[%tsfs p=skin q=hoon r=hoon]`: combine a named noun with the subject, possibly with type annotation.
342342
@@ -385,7 +385,7 @@ Regular: **3-fixed**.
3853858
386386```
387387
388−### =~ "tissig"
388+### `=~` "tissig"
389389
390390
391391`[%tssg p=(list hoon)]`: compose many expressions.
@@ -421,7 +421,7 @@ Regular: **running**.
4214213
422422```
423423
424−### =* "tistar"
424+### `=*` "tistar"
425425
426426`[%tstr p=term q=hoon r=hoon]`: define a macro.
427427
@@ -454,7 +454,7 @@ The difference between macroing and pinning is that pinning changes the subject,
454454[2 2]
455455```
456456
457−### =? "tiswut"
457+### `=?` "tiswut"
458458
459459`[$tswt p=wing q=hoon r=hoon s=hoon]`: conditionally change one leg in the subject.
460460
reference/hoon-expressions/rune/wut.md+14−14
@@ -30,7 +30,7 @@ side is taken), it fails with an error.
3030
3131## Runes
3232
33−### ?> "wutgar"
33+### `?>` "wutgar"
3434
3535`[%wtgr p=hoon q=hoon]`: positive assertion.
3636
@@ -68,7 +68,7 @@ nest-fail
6868123
6969```
7070
71−### ?| "wutbar"
71+### `?|` "wutbar"
7272
7373`[%wtbr p=(list hoon)]`: logical OR.
7474
@@ -107,7 +107,7 @@ Irregular: `|(foo bar baz)` is `?|(foo bar baz)`.
107107%.n
108108```
109109
110−### ?: "wutcol" {#wutcol}
110+### `?:` "wutcol" {#wutcol}
111111
112112`[%wtcl p=hoon q=hoon r=hoon]`: branch on a boolean test.
113113
@@ -155,7 +155,7 @@ Note also that all other branching expressions reduce to `?:`.
1551554
156156```
157157
158−### ?. "wutdot"
158+### `?.` "wutdot"
159159
160160`[%wtdt p=hoon q=hoon r=hoon]`: branch on a boolean test, inverted.
161161
@@ -192,7 +192,7 @@ As is usual with inverted forms, use `?.` when the yes-case expression is much t
192192'but see how \'r is much heavier than \'q?'
193193```
194194
195−### ?- "wuthep"
195+### `?-` "wuthep"
196196
197197`[%wthp p=wing q=(list (pair spec value))]`: switch against a union, with no default.
198198
@@ -254,7 +254,7 @@ will throw `mint-vain`.
254254! nest-fail
255255```
256256
257−### ?^ "wutket"
257+### `?^` "wutket"
258258
259259`[%wtkt p=wing q=hoon r=hoon]`: branch on whether a wing
260260of the subject is a cell.
@@ -287,7 +287,7 @@ The type of the wing, `p`, must not be known to be either an atom or a cell, or
2872873
288288```
289289
290−### ?< "wutgal"
290+### `?<` "wutgal"
291291
292292`[%wtgl p=hoon q=hoon]`: negative assertion.
293293
@@ -325,7 +325,7 @@ nest-fail
325325[12 14]
326326```
327327
328−### ?+ "wutlus"
328+### `?+` "wutlus"
329329
330330`[%wtls p=wing q=hoon r=(list (pair spec hoon))]`: switch against
331331a union, with a default.
@@ -382,7 +382,7 @@ If there is a case that is never taken you'll get a `mint-vain` error.
382382240
383383```
384384
385−### ?& "wutpam"
385+### `?&` "wutpam"
386386
387387`[%wtpm p=(list hoon)]`: logical AND.
388388
@@ -421,7 +421,7 @@ Irregular: `&(foo bar baz)` is `?&(foo bar baz)`.
421421%.n
422422```
423423
424−### ?~ "wutsig"
424+### `?~` "wutsig"
425425
426426`[%wtsg p=wing q=hoon r=hoon]`: branch on whether a wing of the subject is null.
427427
@@ -448,7 +448,7 @@ It's bad style to use `?~` to test for any zero atom. Use it only for a true nu
4484481
449449```
450450
451−### ?= "wuttis"
451+### `?=` "wuttis"
452452
453453`[%wtts p=spec q=wing]`: test pattern match.
454454
@@ -484,7 +484,7 @@ A common error is `find.$`, meaning `p` is not a type.
484484%.y
485485```
486486
487−### ?@ "wutpat"
487+### `?@` "wutpat"
488488
489489`[%wtpt p=wing q=hoon r=hoon]`: branch on whether a wing of the subject is an atom.
490490
@@ -516,7 +516,7 @@ The type of the wing, `p`, must not be known to be either an atom or a cell, or
5165164
517517```
518518
519−### ?! "wutzap"
519+### `?!` "wutzap"
520520
521521`[%wtzp p=hoon]`: logical NOT.
522522
@@ -548,4 +548,4 @@ Irregular: `!foo` is `?!(foo)`.
548548
549549~zod:dojo> !(gth 5 6)
550550%.y
551−```
551+```
reference/hoon-expressions/rune/zap.md+7−7
@@ -6,7 +6,7 @@ aliases = ["docs/reference/hoon-expressions/rune/zap/"]
66+++
77## Runes
88
9−### !> "zapgar"
9+### `!>` "zapgar"
1010
1111`[%zpgr p=hoon]`: wrap a noun in its type.
1212
@@ -36,7 +36,7 @@ If you want just the type value, use a 'type spear'. This is `-:!>`, i.e., the
3636#t/@ud
3737```
3838
39−### !< "zapgal"
39+### `!<` "zapgal"
4040
4141`[%zpld p=spec q=hoon]`
4242
@@ -72,7 +72,7 @@ nest-fail
7272[0 1]
7373```
7474
75−### !: "zapcol"
75+### `!:` "zapcol"
7676
7777`[%dbug p=hoon]`: turn on stack trace
7878
@@ -104,7 +104,7 @@ ford: %ride failed to execute:
104104ford: %ride failed to execute:
105105```
106106
107−### !. "zapdot"
107+### `!.` "zapdot"
108108
109109Turn off stack trace for a subexpression `p`
110110
@@ -148,7 +148,7 @@ ford: %ride failed to execute:
148148ford: %ride failed to execute:
149149```
150150
151−### != "zaptis"
151+### `!=` "zaptis"
152152
153153`[%zpts p=hoon]`: make the Nock formula for a Hoon expression.
154154
@@ -189,7 +189,7 @@ Don't confuse the `!=` rune with:
189189
190190The syntax difference is that a test for equality takes two subexpressions, and the `!=` rune only one.
191191
192−### !? "zapwut"
192+### `!?` "zapwut"
193193
194194`[%zpwt p=@ q=hoon]`: restrict Hoon version.
195195
@@ -215,7 +215,7 @@ Regular: **2-fixed**.
215215! exit
216216```
217217
218−### !! "zapzap"
218+### `!!` "zapzap"
219219
220220`[%zpzp ~]`: crash.
221221
reference/vane-apis/iris.mdnew file+193
@@ -0,0 +1,193 @@
1++++
2+title = "Iris Public API"
3+weight = 5
4+template = "doc.html"
5++++
6+
7+# Iris
8+
9+In this document we describe the public interface for Iris. Namely, we describe
10+each `task` that Iris can be `%pass`ed, and which `gift`(s) Iris can `%give` in
11+return.
12+
13+## Returns to Unix
14+
15+Much of what Iris does is translating `task`s from other vanes into `card`s
16+meant for Unix via the `%request` and `%cancel-request` `task`s. What this means in practice is that Iris may be `%pass`ed a
17+`task` via some `duct`, which in response Iris then `%give`s a `gift` to Unix
18+via another `duct`. This `gift` will actually be a response to the `%born`
19+`task` that Iris was `%pass`ed when the Urbit was resumed, which came along the
20+duct to Unix.
21+
22+
23+## Tasks
24+
25+### `%born`
26+
27+Each time you start your Urbit the Arvo kernel calls the `%born` `task` for
28+Iris. This causes Iris to cancel any outstanding http requests and resets all
29+connection states.
30+
31+#### Accepts
32+
33+```hoon
34+[ ~ ]
35+```
36+
37+#### Returns
38+
39+In response to a `%born` `task` Iris `give`s a `%http-response %cancel` `gift`
40+to each outstanding connection.
41+
42+
43+### `%cancel-request`
44+
45+This `task` cancels a previous fetch. Iris knows which request is meant based on the
46+`duct` that the `task` comes on.
47+
48+ We note that `%cancel-request` is also a `gift` that Iris can `%give`.
49+
50+#### Accepts
51+
52+```hoon
53+[ ~ ]
54+```
55+
56+#### Returns
57+
58+```hoon
59+[%cancel-request id=@ud]
60+```
61+Receiving this `task` causes Iris to `%give`s a `%cancel-request` `gift` to Unix,
62+which then cancels the request in the runtime. See [Returns to Unix](#returns-to-unix).
63+
64+`id` is obtained via a `(map duct @ud)`, with the `duct` corresponding to one along
65+which the `%cancel-request` `task` came with.
66+
67+
68+### `%crud`
69+
70+`%crud` is called whenever an error involving Iris occurs. It produces a crash
71+report in response.
72+
73+#### Accepts
74+
75+```hoon
76+[p=@tas q=(list tank)]
77+```
78+
79+`p` is the type of error, `q` is the error message.
80+
81+#### Returns
82+
83+Iris does not `%give` a `gift` in response to a `%crud` `task`, but it does
84+`%slip` Dill a `%flog` `task` instructing it to print the error.
85+
86+
87+### `%receive`
88+
89+The `%receive` `task` is used to receive a response from Unix to an `http-request` that
90+was made.
91+
92+#### Accepts
93+
94+```hoon
95+[id=@ud =http-event:http]
96+```
97+
98+`id` is the identification number assigned by Iris to the http connection under
99+consideration. `http-event` is a packet that contains a header and data.
100+
101+#### Returns
102+
103+The response depends on what kind of packet `http-event` is: `%start`,
104+`%continue`, or `%cancel` and whether the `complete` flag is `%.y` or `%.n`.
105+
106+If the packet says to `%start` or `%continue` and `complete=%.n`, Iris will `%give` a
107+`%http-response %progress` `gift`.
108+
109+If the packet says to `%start` or `%continue` and `complete=%.y`, Iris will
110+`%give` a `%http-response %finished` `gift`.
111+
112+If the packet says to `%cancel`, Iris will `%give` a `%http-response %cancel`
113+`gift` in return. The `complete` flag is unused here.
114+
115+
116+### `%request`
117+
118+`%request` is used to fetch a remote resource. `%request` is also a `gift` Iris
119+can `%give`.
120+
121+#### Accepts
122+
123+```hoon
124+[=request:http =outbound-config]
125+```
126+
127+A `$request` consists of the following:
128+ - `=method`, the http method, which is one of `CONNECT`, `DELETE`, `GET`,
129+ `HEAD`, `OPTIONS`, `POST`, `PUT`, and `TRACE`.
130+ - `url=@t`, the URL being requested
131+ - `=header-list`, a list of headers to pass with the request,
132+ - `body=(unit octs)`, optional data to include in the request.
133+
134+ A `$outbound-config` contains the number of redirects and retries that Iris
135+ will attempt. By default this is 5 redirects (the recommended limit for the
136+ http standard) and 3 retries.
137+
138+#### Returns
139+
140+```hoon
141+[id=@ud request=request:http]
142+```
143+Iris will `%give` a `%request` `gift` to Unix in response to a `%request`
144+`task`. See [Returns to Unix](#returns-to-unix). This `gift`
145+contains the `request` in the original `task` as well as the ID number assigned
146+by Iris for that particular http connection, which is extracted from the input `task`.
147+
148+
149+### `%trim`
150+
151+This `task` is sent by the interpreter to free up memory. It has no effect on Iris.
152+
153+#### Accepts
154+
155+```hoon
156+[ ~ ]
157+```
158+
159+#### Returns
160+
161+This `task` returns no `gift`s.
162+
163+
164+### `%vega`
165+
166+This `task` informs the vane that the kernel has been upgraded. Iris does not do
167+anything in response to this.
168+
169+#### Accepts
170+
171+```hoon
172+[ ~ ]
173+```
174+
175+#### Returns
176+
177+This `task` returns no `gift`s.
178+
179+
180+### `%wegh`
181+
182+This `task` asks Iris to product a memory usage report.
183+
184+#### Accepts
185+
186+This `task` has no arguments.
187+
188+#### Returns
189+
190+When Iris is `%pass`ed this `task`, it will `%give` a `%mass` `gift` in response
191+containing Iris' current memory usage.
192+
193+
tutorials/_index.md+3−3
@@ -14,14 +14,14 @@ Arvo is a clean-slate system software stack defined as a deterministic computer.
1414
1515## [Hoon Tutorial](@/docs/tutorials/hoon/_index.md)
1616
17−Hoon is a high-level, statically typed, functional programming language, custom-designed for use with Urbit. For a functional language it has a surprisingly imperative style, and mastering it doesn’t require knowing any advanced mathematics. The Hoon Tutorial is the best place to start if you want to learn Urbit.
17+Hoon is a high-level, statically typed, functional programming language, custom-designed for use with Urbit. For a functional language it has a surprisingly imperative style, and mastering it doesn't require knowing any advanced mathematics. The Hoon Tutorial is the best place to start if you want to learn Urbit.
1818
1919## [Nock](@/docs/tutorials/nock/_index.md)
2020
21−Nock is the low-level functional programming language that is interpreted by Vere. You don’t need to know Nock to write Hoon, or even to work on most parts of Vere. But if you want to understand the foundations of Urbit and are mathematically-inclined, dive right in.
21+Nock is the low-level functional programming language that is interpreted by Vere. You don't need to know Nock to write Hoon, or even to work on most parts of Vere. But if you want to understand the foundations of Urbit and are mathematically-inclined, dive right in.
2222
2323## [Vere](@/docs/tutorials/vere/_index.md)
2424
2525The Nock runtime system, written in C.
2626
27−Keep reading if you’re planning to work on the Urbit interpreter, you’re a language implementation geek, or you don’t really understand anything until you’ve seen the actual structs.
27+Keep reading if you're planning to work on the Urbit interpreter, you're a language implementation geek, or you don't really understand anything until you've seen the actual structs.
tutorials/arvo/gall.md+6−13
@@ -153,17 +153,12 @@ Here's a skeleton example of an implementation:
153153::
154154++ on-load
155155 |= =old-state=vase
156− =/ old-state !<(@ old-state-vase)
157− ?~ old-state
158− ~& %prep-lost
159− `this
160− ~& %prep-found
161− `this(state old-state)
156+ `this(state !<(@ old-state-vase))
162157::
163158++ on-poke
164159 |= [=mark =vase]
165− ~& state=state
166− ~& got-poked-with-data=mark]
160+ ~& > state=state
161+ ~& got-poked-with-data=mark
167162 =. state +(state)
168163 `this
169164::
@@ -366,14 +361,12 @@ represent a value which has a type that isn't known at compile time. A
366361vase has three operations:
367362
368363- `!>` is a unary rune that lifts a statically typed value to a
369− dynamically-typed `vase`. For example, `!>('hi')` gives `[[%atom %t ~]
370− 26.984']`, which has type `[type *]`.
364+ dynamically-typed `vase`. For example, `!>('hi')` gives `[#t/@t q=26.984]`.
371365
372366- `!<` is a binary rune that takes a mold and a dynamically typed `vase`
373367 and reduces it to a statically typed value. If the `vase` does not in
374− fact have the type of the mold you give it, then it produces `~`, else
375− it produces `[~ value]`. For example, `!<(@t !>('hi'))` produces `[~
376− 'hi']` while `!<(^ !>('hi'))` produces `~`.
368+ fact have the type of the mold you give it, then it nest-fails, else
369+ it produces `value`. For example, `!<(@t !>('hi'))` produces `'hi'` while `!<(^ !>('hi'))` causes a nest fail..
377370
378371- The compiler takes text and converts it to a `vase` of the compiled
379372 code. Agents shouldn't need this directly, but Gall uses this to
tutorials/creating-an-invite-pool.md+6−6
@@ -4,13 +4,13 @@ weight = 9
44template = "doc.html"
55+++
66
7−If you’re a star owner, you have the ability to create **invite pools**. These invite pools let you give your friends a piece of the network in the form of planets. This document will give you an explanation of how to create an invite pool and how to share it with your friends using our tool [Bridge](https://bridge.urbit.org).
7+If you're a star owner, you have the ability to create **invite pools**. These invite pools let you give your friends a piece of the network in the form of planets. This document will give you an explanation of how to create an invite pool and how to share it with your friends using our tool [Bridge](https://bridge.urbit.org).
88
99For more general tips on using your star, check out the [Star and Galaxy Operations page](https://urbit.org/using/operations/stars-and-galaxies/).
1010
1111## Anatomy of an Invite Pool
1212
13−An invite pool is a set of planet invites that can be distributed via email; each invite is worth one planet when redeemed. An invite pool can be as big as you’d like, providing that you have enough planets left to spawn. All invite pools must be created by a star, but they must be given to a planet. If you’re interested in how this works technically, take a look at the [DelegatedSending.sol contract](https://github.com/urbit/azimuth/blob/master/contracts/DelegatedSending.sol).
13+An invite pool is a set of planet invites that can be distributed via email; each invite is worth one planet when redeemed. An invite pool can be as big as you'd like, providing that you have enough planets left to spawn. All invite pools must be created by a star, but they must be given to a planet. If you're interested in how this works technically, take a look at the [DelegatedSending.sol contract](https://github.com/urbit/azimuth/blob/master/contracts/DelegatedSending.sol).
1414
1515Keep in mind that all planets will have access to the invite pool until the invite pool is exhausted.
1616
@@ -22,17 +22,17 @@ Giving your friends a piece of Urbit only takes a few minutes: send an invite po
2222
23231. Log into Bridge using your ownership address for your star.
2424
25−2. Get the name (like `~poldec-tonteg`) of the planet to whom you’d like to give invites, it can be one you control or a friend’s.
25+2. Get the name (like `~poldec-tonteg`) of the planet to whom you'd like to give invites, it can be one you control or a friend's.
2626
27−3. Click “Manage Invite Pools” to assign an invite pool to the planet. You may receive a notification that you need to assign your spawn proxy to the address of the Delegated Sending contract. This is so that the contract can send invites on your behalf when the recipient claims them.
27+3. Click "Manage Invite Pools" to assign an invite pool to the planet. You may receive a notification that you need to assign your spawn proxy to the address of the Delegated Sending contract. This is so that the contract can send invites on your behalf when the recipient claims them.
2828
2929![](https://media.urbit.org/docs/invite-pool/browser-point.png)
3030
31−4. Enter the planet name and the number of invites you’d like to assign them.
31+4. Enter the planet name and the number of invites you'd like to assign them.
3232
3333![](https://media.urbit.org/docs/invite-pool/browser-create-pool.png)
3434
35−5. If you control the planet that you gave the invite pool to, it should be accessible from the Bridge homepage. Click the Planet, then “Invite” to create invites for your friends.
35+5. If you control the planet that you gave the invite pool to, it should be accessible from the Bridge homepage. Click the Planet, then "Invite" to create invites for your friends.
3636
3737![](https://media.urbit.org/docs/invite-pool/browser-invite.png)
3838
tutorials/guide-to-breaches.md+9−9
@@ -10,15 +10,15 @@ There are two kinds of breaches: **personal breaches** and **network breaches**.
1010
1111## Personal Breaches
1212
13−Ships on the Ames network sometimes need to reset their continuity. A personal breach is when an individual ship announces to the network: “I forgot who I am, let’s start over from scratch.” That is, it clears its own event log and sends an announcement to the network, asking all ships that have communicated with it to reset its networking information in their state. This makes it as though the ship was just started for the first time again, since everyone on the network has forgotten about it.
13+Ships on the Ames network sometimes need to reset their continuity. A personal breach is when an individual ship announces to the network: "I forgot who I am, let's start over from scratch." That is, it clears its own event log and sends an announcement to the network, asking all ships that have communicated with it to reset its networking information in their state. This makes it as though the ship was just started for the first time again, since everyone on the network has forgotten about it.
1414
15−Personal breaches often fix connectivity issues, but should only be used as a last resort. Before performing a personal breach, look at alternative fixes in the [Ship Troubleshooting](../ship-troubleshooting) guide. Also reach out for help in `~/~dopzod/urbit-help`, or, failing that, in the `#ship-starting-support` channel in our [Discord server](https://discord.gg/n9xhMdz) to see if there is another option.
15+Personal breaches often fix connectivity issues, but should only be used as a last resort. Before performing a personal breach, look at alternative fixes in the [Ship Troubleshooting](../ship-troubleshooting) guide. Also reach out for help in `~/~dopzod/urbit-help`, or, failing that, in the `#ship-starting-support` channel in our [Discord server](https://discord.gg/n9xhMdz) to see if there is another option.
1616
1717To perform a personal breach, follow the steps below.
1818
1919- Go to [bridge.urbit.org](https://bridge.urbit.org) and log into your identity.
20−- Go to the `Admin` section. Then go to `Edit Permisions`, then `Networking Keys`.
21−- Check the `Breach Continuity` box. Click `Reset Networking Keys`, and then click `Send Transaction`.
20+- Click on `OS: Urbit OS Settings` at the bottom, then click `Reset Networking Keys`.
21+- Check the `Breach Continuity` box. Click `Reset Networking Keys`, and then click `Send Transaction` and wait for the progress bar to appear.
2222- Click `Download Arvo Keyfile`.
2323- Delete or archive your old pier.
2424- Create a new pier by booting your ship with your new keyfile.
@@ -28,17 +28,17 @@ There are two types of personal breaches: changing private keys, and changing
2828the Ethereum address that holds the Urbit ID.
2929
3030Performing a personal breach on your ship increments an integer value called
31−your ship’s _life_ by one, which refers to your ship’s [Azimuth](@/docs/tutorials/concepts/azimuth.md) _key
31+your ship's _life_ by one, which refers to your ship's [Azimuth](@/docs/tutorials/concepts/azimuth.md) _key
3232revision number_. This value is utilized by
3333Ames and Jael to ensure that you are
3434communicating with a ship created using its most recent set of keys. Your
35−ship’s life is written at the end of the name of its keyfile, e.g.
35+ship's life is written at the end of the name of its keyfile, e.g.
3636`sampel-palnet-4.key`. Changing the Etherum address that holds the Urbit ID,
37−called _reticketing_, also increments a number called the ship’s _rift_ by one.
38−Rift refers to your ship’s Azimuth _continuity number_.
37+called _reticketing_, also increments a number called the ship's _rift_ by one.
38+Rift refers to your ship's Azimuth _continuity number_.
3939
4040You can check your current life and rift number by running the
41−`+keys our` generator in Dojo. You can inspect another ship’s life and rift can be checked by
41+`+keys our` generator in Dojo. You can inspect another ship's life and rift can be checked by
4242running `+keys ~sampel-palnet`.
4343
4444
tutorials/hoon-errors.md+21−21
@@ -10,19 +10,19 @@ on debugging and verbose mode, and how to use debugging printfs.
1010
1111## Syntax errors
1212
13−When you get a syntax error, you’ll see a message like:
13+When you get a syntax error, you'll see a message like:
1414
1515```
1616syntax error at [10 12]
1717```
1818
1919This is a line and column number; more exactly, the line and
20−column of the first byte the parser couldn’t interpret as part of
20+column of the first byte the parser couldn't interpret as part of
2121a correct Hoon file. These values are always correct.
2222
2323Usually, the line and column tell you everything you need to
2424know. But the worst-case scenario for a syntax error is that,
25−somewhere above, you’ve confused Hoon’s tall form by using the
25+somewhere above, you've confused Hoon's tall form by using the
2626wrong fanout for a rune. For example, `%+` ([**cenlus**](@/docs/reference/hoon-expressions/rune/cen.md#cenlus),
2727a function call whose sample is a cell) has three subhoons:
2828
@@ -32,29 +32,29 @@ a function call whose sample is a cell) has three subhoons:
3232baz
3333```
3434
35−But if you make a mistake and write …
35+But if you make a mistake and write ...
3636
3737```hoon
3838%+ foo
3939bar
4040```
4141
42−… the parser will eat the next reference below and try to treat it as a
42+... the parser will eat the next reference below and try to treat it as a
4343part of the `%+`. This can cause a cascading error somewhere
4444below, usually stopped by a `==` or `--`.
4545
46−When this happens, don’t panic! Binary search actually works
46+When this happens, don't panic! Binary search actually works
4747quite well. Any reference can be stubbed out as `!!`. Find the
4848prefix of your file that compiles, then work forward until
4949the actual error appears.
5050
5151## Semantic errors
5252
53−Now your code parses but doesn’t compile.
53+Now your code parses but doesn't compile.
5454
5555### Turn on debugging or verbose mode
5656
57−Your first step should be to put a `!:` (“zapcol”) rune at the
57+Your first step should be to put a `!:` ("zapcol") rune at the
5858top of the file. This is like calling the C compiler with `-g`;
5959it tells the Hoon compiler to generate tracing references.
6060
@@ -69,7 +69,7 @@ stack trace. An extensive stack trace tutorial is [below](#stack-trace-tutorial)
6969
7070### Error trace
7171
72−If you have `!:` on, you’ll see an error trace, like:
72+If you have `!:` on, you'll see an error trace, like:
7373
7474```
7575/~zod/home/0/gen/hello:<[7 3].[11 21]>
@@ -86,7 +86,7 @@ failed to compile, then the cause of the error (`nest-fail`).
8686
8787Hoon does not believe in inundating you with possibly irrelevant
8888debugging information. Your first resort is always to just look
89−at the code and try to figure out what’s wrong. This practice
89+at the code and try to figure out what's wrong. This practice
9090strengthens your Hoon muscles.
9191
9292(Consider the opposite extreme; imagine if you had a magic bot
@@ -95,8 +95,8 @@ wasted on compiler errors. Con: you never learn Hoon.)
9595
9696## Common errors
9797
98−Moral fiber is all very well and good, but sometimes you’re
99−stumped. Couldn’t the compiler help a little? These messages do
98+Moral fiber is all very well and good, but sometimes you're
99+stumped. Couldn't the compiler help a little? These messages do
100100mean something. Here are the three most common:
101101
102102### `nest-fail`
@@ -104,7 +104,7 @@ mean something. Here are the three most common:
104104This is a type mismatch (`nest` is the Hoon typechecker). It
105105means you tried to pound a square peg into a round hole.
106106
107−What was the peg and what was the hole? Hoon doesn’t tell you by
107+What was the peg and what was the hole? Hoon doesn't tell you by
108108default, because moral fiber, and also because in too many cases
109109trivial errors lead to large intimidating dumps. However, you
110110can use the `~!` rune ([**sigzap**](@/docs/reference/hoon-expressions/rune/sig.md#sigzap)) to print the type of any hoon in your stack trace.
@@ -118,13 +118,13 @@ your code to be:
118118(foo bar)
119119```
120120
121−You’ll get the same `nest-fail`, but this will show the type of
121+You'll get the same `nest-fail`, but this will show the type of
122122`bar`, then the type of the sample of the `foo` gate.
123123
124124### `find.foo`
125125
126−A `find.foo` error means limb `foo` wasn’t found in the subject.
127−In other words, “undeclared variable.”
126+A `find.foo` error means limb `foo` wasn't found in the subject.
127+In other words, "undeclared variable".
128128
129129The most common subspecies of `find` error is `find.$`, meaning
130130the empty name `$` was not found. This often happens when you
@@ -135,15 +135,15 @@ function.
135135### `mint-vain` and `mint-lost`
136136
137137These are errors caused by type inference in pattern matching.
138−`mint-vain` means this hoon is never executed. `mint-lost` means there’s a case in a `?-` ([**wuthep**](@/docs/reference/hoon-expressions/rune/wut.md#wuthep)) that isn’t handled.
138+`mint-vain` means this hoon is never executed. `mint-lost` means there's a case in a `?-` ([**wuthep**](@/docs/reference/hoon-expressions/rune/wut.md#wuthep)) that isn't handled.
139139
140140## Runtime crashes
141141
142−If your code crashes at runtime or overflows the stack, you’ll
143−see a stack trace that looks just like the trace above. Don’t
142+If your code crashes at runtime or overflows the stack, you'll
143+see a stack trace that looks just like the trace above. Don't
144144confuse runtime crashes with compilation errors, though.
145145
146−If your code goes into an infinite loop, kill it with `ctrl-c` (you’ll
146+If your code goes into an infinite loop, kill it with `ctrl-c` (you'll
147147need to be developing on the local console; otherwise, the
148148infinite loop will time out either too slowly or too fast). The
149149stack trace will show what your code was doing when interrupted.
@@ -165,7 +165,7 @@ The worst possibility, of course, is that your code runs but does
165165the wrong thing. This is relatively unusual in a typed
166166functional language, but it still happens.
167167
168−`~&` ([**sigpam**](@/docs/reference/hoon-expressions/rune/sig.md#sigpam)) is Hoon’s debugging printf.
168+`~&` ([**sigpam**](@/docs/reference/hoon-expressions/rune/sig.md#sigpam)) is Hoon's debugging printf.
169169This pretty-prints its argument:
170170
171171```hoon
tutorials/hoon/_index.md+2−2
@@ -6,12 +6,12 @@ template = "sections/docs/hoon.html"
66aliases = ["/docs/byte/0/", "/docs/byte", "/docs/learn/hoon/hoon-tutorial/"]
77+++
88
9−This series is designed to teach you Hoon without assuming you have an extensive programming background. In fact, you should be able to follow much of it even if you have no programming experience at all, though of course experience helps. We strongly encourage you to try out all the examples of each lesson. These lessons are meant for the beginner but they aren't meant to be skimmed. Each lesson falls into one of two categories: **readings**, which are prose-heavy explanations of Hoon fundamentals, and **walkthroughs**, which are line-by-line explanations of example programs. Walkthroughs are found between readings, offering a practical implementation of the concepts taught in the reading before.
9+This series is designed to teach you Hoon without assuming you have an extensive programming background. In fact, you should be able to follow much of it even if you have no programming experience at all, though of course experience helps. We strongly encourage you to try out all the examples of each lesson. These lessons are meant for the beginner but they aren't meant to be skimmed. Each lesson falls into one of two categories: **readings**, which are prose-heavy explanations of Hoon fundamentals, and **walkthroughs**, which are line-by-line explanations of example programs. Walkthroughs are found between readings, offering a practical implementation of the concepts taught in the reading before.
1010
1111Before you start, we recommend reading [Why Hoon?](https://urbit.org/blog/why-hoon/), a blog post by a Tlon engineer that justifies the existence and use of this peculiar language. This explainer gives useful context to all types of learners, but those new to programming will need to use Google frequently for the jargon.
1212
1313Chapter 1 introduces and explains the fundamental concepts you need in order to understand Hoon's semantics.
1414
15−Hoon is a 'subject-oriented' programming language -- every expression of Hoon is evaluated relative to a **subject**. The subject is a piece of data that represents the environment, or the context, of an expression. After reading Chapter 1 you should understand what the subject is and how to refer to its various parts. In this chapter you'll also learn about **[cores](/docs/glossary/core/)**, which are an important data structure in Hoon. Once you get the hang of [cores](/docs/glossary/core/) you'll be able to write your own functions in Hoon.
15+Hoon is a "subject-oriented" programming language -- every expression of Hoon is evaluated relative to a **subject**. The subject is a piece of data that represents the environment, or the context, of an expression. After reading Chapter 1 you should understand what the subject is and how to refer to its various parts. In this chapter you'll also learn about **[cores](/docs/glossary/core/)**, which are an important data structure in Hoon. Once you get the hang of [cores](/docs/glossary/core/) you'll be able to write your own functions in Hoon.
1616
1717Chapter 2 covers the type system, and writing apps, and the workings of the Arvo kernel.
tutorials/hoon/arms-and-cores.md+1−1
@@ -181,7 +181,7 @@ To reinforce your newfound understanding of arms and cores, let's go over the va
181181
182182### Address-Based Wings
183183
184−In the [previous lesson](@../the-subject-and-its-legs.md), you saw how the following expressions return legs based on an address in the subject: `+n`, `.`, `-`, `+`, `+>`, `+<`, `->`, `-<`, `&`, `|` etc. When these resolve to the part of the subject containing an arm, they **don't** evaluate the arm. They simply return the indicated noun fragment of the subject, as if it were a leg.
184+In the [previous lesson](@/docs/tutorials/hoon/the-subject-and-its-legs), you saw how the following expressions return legs based on an address in the subject: `+n`, `.`, `-`, `+`, `+>`, `+<`, `->`, `-<`, `&`, `|` etc. When these resolve to the part of the subject containing an arm, they **don't** evaluate the arm. They simply return the indicated noun fragment of the subject, as if it were a leg.
185185
186186Let's use `-.c` to look at the head of `c`, i.e., the battery of the core:
187187
tutorials/hoon/bank-account.md+1−1
@@ -75,6 +75,6 @@ Each of these arms produces a gate which takes an `@ud` argument. Each of these
7575+>.$(balance (add balance amount))
7676```
7777
78−`+>` is [wing syntax](@/docs/reference/hoon-expressions/limb/wing.md). This particularly wing construction looks for the the tail of the tail (the third element) in `$`, the subject of the gate we are in, which is the entire `new-account` door. We change `balance` to be the result of adding `balance` and `amount` and produce the door as the result. `withdraw` functions the same way only doing subtraction instead of addition.
78+`+>` is [wing syntax](@/docs/reference/hoon-expressions/limb/wing.md). This particular wing construction looks for the tail of the tail (the third element) in `$`, the subject of the gate we are in. The `withdraw` and `deposit` arms create gates with the entire `new-account` door as the context in their cores' `[battery sample context]`, in the "tail of the tail" slot. We change `balance` to be the result of adding `balance` and `amount` and produce the door as the result. `withdraw` functions the same way only doing subtraction instead of addition.
7979
8080It's important to notice that the sample, `balance`, is stored as part of the door rather than existing outside of it.
tutorials/hoon/conditionals.md+20−12
@@ -5,7 +5,7 @@ template = "doc.html"
55aliases = ["/docs/learn/hoon/hoon-tutorial/conditionals/"]
66+++
77
8−In this lesson, we will write a generator that takes an integer and checks if it is an even number between 1 and 100. This will help demonstrate how boolean (true or false) conditional expressions work in Hoon.
8+In this lesson, we will write a generator that takes an integer and checks if it is an even number between `1` and `100`. This will help demonstrate how boolean (`true` or `false`) conditional expressions work in Hoon.
99
1010```hoon
1111:- %say
@@ -24,54 +24,61 @@ On the very first line, with `:- %say` we are beginning to create a generator o
2424|= [* [n=@ud ~] ~]
2525```
2626
27−The code above builds a gate. The gate's first argument is a cell provided by Dojo that contains some system information we're not going to use, so we use `*` to indicate "any [noun](/docs/glossary/noun/)." The next cell is our arguments provided to the generator upon invocation at the `dojo`. Here we only want one `@ud` with the face `n`.
27+The code above builds a gate. The gate's first argument is a cell provided by Dojo that contains some system information we're not going to use, so we use `*` to indicate "any [noun](/docs/glossary/noun/)". The next cell is our arguments provided to the generator upon invocation at the Dojo. Here we only want one `@ud` with the face `n`.
2828
2929```hoon
3030:- %noun
3131```
3232
33−This code is the third line of the `%say` "boilerplate," and it produces a `cask` with the head of `%noun`. We could use any `mark` here, but `%noun` is the most generic type, able to fit any data.
33+This code is the third line of the `%say` "boilerplate", and it produces a `cask` with the head of `%noun`. We could use any `mark` here, but `%noun` is the most generic type, able to fit any data.
3434
3535```hoon
3636^- ?
3737```
38−This line casts the output as a `flag`, which is a type whose values are `%.y` and `%.n` representing "yes" and "no". These behave as boolean values.
3938
40−Let's look at the conditional.
39+This line casts the output as a `flag`, which is a type whose values are `%.y` and `%.n` representing "yes" and "no". These behave as boolean values (`true` or `false`).
40+
41+Let's look at the conditional:
4142
4243```hoon
4344?& (gte n 1)
4445```
4546
46−`?&` (pronounced "wut-pam") takes in a list of Hoon expressions, terminated by `==`, that evaluate to a `flag` and returns the logical "AND" of these `flag`s. Most runes take a fixed number of children, but the handful that do not (such as `?&`) end their list of children with a terminating rune. In our context, that means that if the product of each of the children of `?&` is `%.y`, then the product of the entire `?&` expression is `%.y` as well. Otherwise, the product of the conditional `?&` is `%.n`.
47+`?&` (pronounced "wut-pam") takes in a list of Hoon expressions, terminated by `==`, that evaluate to a `flag` and returns the logical "AND" of these flags. Most runes take a fixed number of children, but the handful that do not (such as `?&`) end their list of children with a terminating rune. In our context, that means that if the product of each of the children of `?&` is `%.y`, then the product of the entire `?&` expression is `%.y` as well. Otherwise, the product of the conditional `?&` is `%.n`.
4748
48−The first child of `?&` is `(gte n 1)`. It is good practice to put the first boolean test of a conditional on the same line as the conditional as we have done here. This utilizes the standard library function `gte` which stands for "greater than or equal to". `(gte a b)` returns `%.y` if `a` is greater than or equal to `b`, and `%.n` otherwise.
49+The first child of `?&` is `(gte n 1)`. It is good practice to put the first boolean test of a conditional on the same line as the conditional, as we have done here. This utilizes the standard library function `gte` which stands for "greater than or equal to". `(gte a b)` returns `%.y` if `a` is greater than or equal to `b`, and `%.n` otherwise.
4950
5051Next we have:
52+
5153```hoon
5254 (lte n 100)
5355```
56+
5457`lte` is the standard library function for "less than or equal to". `(lte a b)` returns `%.y` if `a` is less than `b`, and `%.n` otherwise.
5558
56−The last boolean test we have is
59+The last boolean test we have is:
60+
5761```hoon
5862 =(0 (mod n 2))
5963```
60−This checks to see if `0` is equal to `(mod n 2)` - in other words, checking if `n` is even. It produces `%.y` if `n` is even and `%.n` if `n` is odd.
64+
65+This checks to see if `0` is equal to `(mod n 2)` -- in other words, checking if `n` is even. It produces `%.y` if `n` is even and `%.n` if `n` is odd.
6166
6267It is good practice in Hoon to put "lighter" lines at the top and "heavier" lines at the bottom, which is why we have put `=(0 (mod n 2))` last in the list of conditionals.
6368
64−Finally we have a terminator.
69+Finally we have a terminator:
70+
6571```hoon
6672==
6773```
74+
6875This marks the end of the list of children of `?&`.
6976
7077### Other Runes
7178
7279We only utilized one "wut" rune in our walkthrough, but there are many others. Here are a few more examples:
7380
74−- `?:` (pronounced "wut-col") is the simplest "wut" rune. It takes three children, also called sub-expressions. The first child is a boolean test, so it looks for a `%.y` or a `%.n`. The second child is a yes-branch, which is what we arrive at if the aforementioned boolean test evaluates to `%.y`. The third child is a no-branch, which we arrive at if the boolean test evaluates to `%.n`. These branches can contain any sort of Hoon expression, including further conditional expressions. Instead of the `?&` expression in our `%say` generator above, we could have written
81+- `?:` (pronounced "wut-col") is the simplest "wut" rune. It takes three children, also called subexpressions. The first child is a boolean test, so it looks for a `%.y` or a `%.n`. The second child is a yes-branch, which is what we arrive at if the aforementioned boolean test evaluates to `%.y`. The third child is a no-branch, which we arrive at if the boolean test evaluates to `%.n`. These branches can contain any sort of Hoon expression, including further conditional expressions. Instead of the `?&` expression in our `%say` generator above, we could have written:
7582
7683```hoon
7784?: ?& (gte n 1)
@@ -81,7 +88,8 @@ We only utilized one "wut" rune in our walkthrough, but there are many others. H
8188 %.y
8289%.n
8390```
84−Of course, doing so would be needlessly obfuscating - we mention this only to illustrate that these two Hoon expressions have the same product.
91+
92+Of course, doing so would be needlessly obfuscating -- we mention this only to illustrate that these two Hoon expressions have the same product.
8593
8694- `?!` ("wut-zap") is the logical "NOT" operator, which inverts the truth value of its single child. Instead of `(lte n 100)` in our `%say` generator above, we could have written `?! (gth n 100)`. Again, this would be bad practice, we only present this as an example.
8795
tutorials/hoon/egg-timer.md+99−59
@@ -5,115 +5,155 @@ template = "doc.html"
55aliases = ["/docs/learn/hoon/hoon-tutorial/egg-timer/"]
66+++
77
8−The Arvo operating system is divided up into modules called vanes. Gall is the vane responsible for providing an API for building stateful applications in Urbit. Gall is a complex system that takes a lot of getting used to, so let's dip our toes in with a simple egg-timer app.
8+The Arvo operating system is divided up into modules called vanes. Gall is the vane responsible for providing an API for building stateful applications in Urbit. Gall is a complex system that takes a lot of getting used to, so let's dip our toes in with a simple egg-timer app.
99
10+The following code sample should be saved as `/home/app/egg-timer.hoon`
11+After committing: `|start %egg-timer` and poke with `:egg-timer ~s10`
1012
1113```hoon
14+/+ default-agent
1215|%
13−+$ move (pair bone card)
14−+$ card [%wait path @da]
16++$ card card:agent:gall
1517--
16−|_ [bowl:gall ~]
17−++ poke-noun
18− |= t=@dr
19− ^+ [*(list move) +>.$]
20− :_ +>.$ :_ ~
21− [ost %wait /egg-timer (add now t)]
22−++ wake
23− |= [=wire error=(unit tang)]
24− ^+ [*(list move) +>.$]
18+::
19+^- agent:gall
20+|_ =bowl:gall
21++* this .
22+ def ~(. (default-agent this %.n) bowl)
23+::
24+++ on-poke
25+ |= [=mark =vase]
26+ ^- (quip card _this)
27+ =/ t !<(@dr vase)
28+ :_ this
29+ [%pass /egg-timer %arvo %b %wait (add now.bowl t)]~
30+::
31+++ on-arvo
32+ ^+ on-arvo:*agent:gall
33+ |= [=wire =sign-arvo]
34+ ^- (quip card _this)
2535 ~& "Timer went off!"
26− [~ +>.$]
36+ [~ this]
37+::
38+++ on-init on-init:def
39+++ on-save on-save:def
40+++ on-load on-load:def
41+++ on-watch on-watch:def
42+++ on-leave on-leave:def
43+++ on-peek on-peek:def
44+++ on-agent on-agent:def
45+++ on-fail on-fail:def
2746--
2847```
2948
30−The first thing to notice is that we are creating a `core` (`|%`) and a `door` (`|_`). This is a typical style of Gall programming where your types are defined in the first `core` and your application is defined in the following `door`.
49+The first thing to notice is that we are creating a core (`|%`) and a door (`|_`). This is a typical style for Gall programming wherein types are defined in the first core and your application is defined in the following door.
50+Our door will have type `agent:gall` as specified in `sys/zuse.hoon`
3151
3252```hoon
3353|%
34−+$ move (pair bone card)
35−+$ card [%wait path @da]
54++$ card card:agent:gall
3655--
3756```
3857
39−The `core` here defines two types: `move` and `card`. A `move` is a `pair` of `bone` and `card`. A `bone` is a Gall-only type that identifies app event chains by mapping atoms to them. We define `card` to be a request to Arvo to do something for us. In this case, the only valid `card` will be `%wait` which we'll discuss in a bit.
58+The core here defines only one type: `card`.
59+A `card` is a request to Arvo to do something for us. In this case, the only card used will be a `%wait` request to Behn which we'll discuss later.
4060
41−It's important to note that the names `move` and `card` are technically arbitrary; you can call them whatever you'd like. By convention, however, you will see them called `move` and `card` practically everywhere.
61+It's important to note that the name `card` is technically arbitrary. By convention, however, you will see it called `card` practically everywhere.
4262
43−The sample of the `door` is:
63+The sample of the door(`|_`) is:
4464
4565```hoon
46−[bowl:gall ~]
66+=bowl:gall
4767```
4868
49−You can find the full definition of `bowl` in `sys/zuse.hoon`, but for now it's enough to know that this is the default app state and includes various faces for information. Below are some important such faces:
69+You can find the full definition of `bowl` in `sys/zuse.hoon`, but for now it's enough to know that includes contextual data used by Gall with particular faces. Below are some important such faces:
5070
5171- `our` The ship this code is running on
5272- `src` The ship the current event originated from
53−- `ost` A reference to the current chain of events
5473- `eny` Guaranteed-fresh entropy
5574- `now` The current time
5675
57−The `door` we've made has two [arms](/docs/glossary/arm/) `poke-noun` and `wake`. Gall is capable of dispatching `pokes`, or requests, to an app based on the mark of the data given along with that poke. These are sent to the [arm](/docs/glossary/arm/) with the name that matches the mark of the data. Here we use the generic `noun` mark:
76+We give `bowl:gall` the face `bowl`.
77+Additionally, we use `+*` to create two structures for future use:
5878
5979```hoon
60−++ poke-noun
61− |= t=@dr
62− ^+ [*(list move) +>.$]
63− :_ +>.$ :_ ~
64− [ost %wait /egg-timer (add now t)]
80++* this .
81+ def ~(. (default-agent this %.n) bowl)
6582```
83+`this` is our current context(the door).
84+`def` uses `default-agent` to produce a standard `gall:agent` door, from which we will instance default definitions for our unused arms.
6685
67−In the above code, we create a [gate](/docs/glossary/gate/) that takes a single `@dr` argument. `@dr` is an aura for a 128-bit relative date. Here are a few examples.
68−
69−- `~s17` 17 seconds
70−- `~m20` 20 minutes
71−- `~d42` 42 days
72−
73−As a matter of good type hygiene, we explicitly cast the output of this gate with `^+` to ensure we are producing the correct thing for Gall to handle. `^+` is the rune for casting by example. Our example is a cell: `list` of `move`, which we `bunt` with `*`, is the head; `+>.$`, the enclosing [core](/docs/glossary/core/) which is our `door`, is the tail.
74−
75−Next we're going to use the `:_` rune which is just the inverted form a `:-` the cell construction rune. We use it twice so the actual data will end up looking something like:
86+All Gall agents have a fixed set of 10 arms. In this trivial case, we will specify only two and use the default definitions from `default-agent` for the remaining arms.
7687
7788```hoon
78−[[[ost %wait /egg-timer (add now t)] ~] +>.$]
89+++ on-poke
90+ |= [=mark =vase]
91+ ^- (quip card _this)
92+ =/ t !<(@dr vase)
93+ :_ this
94+ [%pass /egg-timer %arvo %b %wait (add now.bowl t)]~
7995```
8096
81−`ost` is the `bone`, the opaque reference to a chain of events, that comes from `bowl`, so we're going to continue to use it here. `%wait` is the name of the `move`, in this case a request to the Behn vain to start a timer for us.
97+The `++on-poke` arm evaluates to a gate which takes a sample `[mark vase]`. `mark` is a type specification and `vase` is a cell of `[specification value]`
98+Note: since `++on-poke` may take many different samples, it would be prudent to add a `%noun` mark check here.
99+In this example, we assume that our sample will contain a `@dr` and pull it from the `vase` with `=/ t !<(@dr vase)`
100+`@dr` is an aura for a 128-bit relative date. Here are a few examples.
82101
83−After `%wait`, we have the `path`, a `list` of `cords` that serves as the unique identifier for this `move`:
102+- `~s17` 17 seconds
103+- `~m20` 20 minutes
104+- `~m13s37` 13 minutes, 37 seconds
105+- `~d42` 42 days
84106
85−```
86−/egg-timer
87−```
88−
89−The `/` here is an irregular syntax to make a `path`.
107+As a matter of good type hygiene, we explicitly cast the output of this gate with `^-` to ensure we are producing the correct structure for Gall to handle.
108+Our specification is `(quip card _this)` which produces a type, `[(list card) _this]`. Note that `_this` is irregular form of `$_(this)` which normalizes to the type of `this`, our door.
90109
91−The final part of this `move` is:
110+Next we use the `:_` rune which is the inverted form of `:-`, the cell construction rune.
92111
112+```hoon
113+:_ this
114+ [%pass /egg-timer %arvo %b %wait (add now.bowl t)]~
93115```
94−(add now t)
95−```
116+Our card should follow the basic form `[%pass /my/wire a-note]`
117+In this case, our card will ask Arvo to `%pass` a note along the wire `/egg-timer` to Behn(`%b`) containing a `%wait` request.
118+Behn will start a timer for us, and will respond along our wire, `/egg-timer`.
96119
97−`now` is the current time of type `@da`, and `t` was declared as `@dr`. Because they are both atoms, we can add `now` and `t` these two to get an atom that is `t` units of time into the future from `now`. That produced atom can be interpreted as a `@da`.
120+`now.bowl` is the current time of type `@da`, and `t` was declared as `@dr`. Because they are both atoms, we can add `now` and `t` to produce an atom that is `t` units of time into the future from `now`. That produced atom can be interpreted as a `@da`.
121+The calculated time will be passed via Arvo to Behn with instruction to `%wait @da`, i.e., to set a timer.
98122
99−That's all for our `poke-noun` arm. But what about when the timer goes off? Behn will create a `gift`, a similar construct to how we created a `card`, only this time it will end up being dispatched back to us via Gall in the `++wake` arm. Any app that wants to use a timer trigger needs to have an arm called `++wake`.
123+That's all for our `++on-poke` arm. But what about when the timer goes off? Behn will create a `gift`, a similar construct to our `card` which will be dispatched back to us via Gall in the `++on-arvo` arm.
100124
101125```hoon
102−++ wake
103− |= [=wire error=(unit tang)]
104− ^+ [*(list move) +>.$]
126+++ on-arvo
127+ ^+ on-arvo:*agent:gall
128+ |= [=wire =sign-arvo]
129+ ^- (quip card _this)
105130 ~& "Timer went off!"
106− [~ +>.$]
131+ [~ this]
107132```
133+`++on-arvo` evaluates to a gate whose sample is a cell of `wire` and `sign-arvo` here given default faces. The syntax of `=wire` is a shortcut for `wire=wire`; it's a common pattern to shadow the name of a type when you only have one instance of the type and are not going to refer to the type itself.
134+A `wire` is an alias for a path. Our `wire` will be the path we provided in our `++on-poke` card. If we needed to do something particular depending on which request triggered this Arvo card, we could use the wire to do so.
108135
109−`wake` is a `gate` that has two arguments: a `wire`, and a `(unit tang)` with the face `error`. The syntax of `=wire` is a shortcut for `wire=wire`; it's a common pattern to shadow the name of a type when you only have one instance of the type and are not going to refer to the type itself. A `wire` is just an alias for `path`. Our `wire` will be the `path` that we gave original `move`. If we needed to do something based on which request caused this gate to be called, we could use the wire to do so. In this case, we don't do perform such a dispatch.
110−
111−Next we have the same cast we used in `++poke-noun` to make sure we are producing the correct thing for Gall. These casts are not strictly necessary, as the type system can infer what the type will be, but they can be very useful both for debugging our own code and for someone else trying to determine what our code should be producing.
136+Note: since multiple vanes can send many sorts of cards via `++on-arvo`, it would be prudent to check if `sign-arvo` is `[%b %wake *]`. Since our trivial example assumes the card is `%wake` from Behn, we will forgo that better practice here.
112137
138+Next we have the same cast we used in `++on-poke` to make sure we produce the correct type for Gall. `(quip card _this)` resolves to a type `[(list card) _this]`
113139```
114140~& "Timer went off!"
115141```
116142
117−`~&` is the debugging printf rune. Here we're using it to output a message. We could, however, modify this line of code to do any other computation we would want to happen when `++wait` gets called.
143+`~&` is the debugging printf rune. Here we're using it to output a message. We could, however, modify this line of code to do any other computation when `++on-arvo` is called.
144+
145+We need to produce a noun of type `(quip card _this)` i.e., `[(list card) _this]`.
146+In this case, we will not produce any card or change application state. Therefore we simply produce a cell of a null list and our original context, `[~ this]`.
118147
119−Finally, we need to produce our `move`. Here the effect is simply `[~ +>.$]`, since we have no `move` to make and we are not changing the state of our app. We just use the `door` without changing its sample.
148+```hoon
149+++ on-init on-init:def
150+++ on-save on-save:def
151+++ on-load on-load:def
152+++ on-watch on-watch:def
153+++ on-leave on-leave:def
154+++ on-peek on-peek:def
155+++ on-agent on-agent:def
156+++ on-fail on-fail:def
157+--
158+```
159+Finally, we define the remaining 8 unused but required Gall Agent armsas instances of the default arms provided in `/lib/default-agent.hoon`.
tutorials/hoon/fibonacci.md+6−6
@@ -5,7 +5,7 @@ template = "doc.html"
55aliases = ["/docs/learn/hoon/hoon-tutorial/fibonacci/"]
66+++
77
8−In this example, we will write a generator that produces a list of Fibonacci numbers up to `n`.
8+In this example, we will write a generator that produces a list of [Fibonacci numbers](https://en.wikipedia.org/wiki/Fibonacci_number) up to `n`.
99
1010```hoon
1111|= n=@ud
@@ -21,21 +21,21 @@ In this example, we will write a generator that produces a list of Fibonacci num
2121==
2222```
2323
24−On the first line, we use `|=` to produce a [gate](/docs/glossary/gate/) which takes an `@ud` that's stored in the face `n`. This `n` sample that we give our [gate](/docs/glossary/gate/) determines how long our Fibonacci sequence is. When the list that our program builds has `n` members, the program ends.
24+On the first line, we use `|=` to produce a [gate](/docs/glossary/gate/) which takes an `@ud` that's stored in the face `n`. This `n` sample that we give our [gate](/docs/glossary/gate/) determines how long our Fibonacci sequence is. When the list that our program builds has `n` items, the program ends.
2525
2626```hoon
2727%- flop
2828```
2929
30−In the line above, we use `flop` on the output of the rest of the program. `flop` is a standard library function to reverse a list.
30+In the line above, we use `flop` on the output of the rest of the program. `flop` is a [standard library](https://urbit.org/docs/reference/library/) function to reverse a list.
3131
32−Why are we using this instead of just producing the list in the order we want it in the first place? Because with lists, adding an element to the end is a computationally expensive operation that gets more expensive the longer the list is, due to the fact that you need to traverse to the end of the tree. Adding an element to the front, however, is cheap. [In Big-O Notation](https://en.wikipedia.org/wiki/Big_O_notation), adding to the end of a list is O(n) and the front is O(1).
32+Why are we using this instead of just producing the list in the order we want it in the first place? Because with lists, adding an element to the end is a computationally expensive operation that gets more expensive the longer the list is, due to the fact that you need to traverse to the end of the tree. Adding an element to the front, however, is cheap. [In Big-O notation](https://en.wikipedia.org/wiki/Big_O_notation), adding to the end of a list is O(n) and the front is O(1).
3333
3434```hoon
3535=+ [i=0 p=0 q=1 r=*(list @ud)]
3636```
3737
38−Here we declare several values that we are going to use during the execution of our program. The only one of these that is noteworthy is `r`: we're using `*` to bunt, or get the default value for, the mold `(list @ud)`.
38+Here we declare several values that we are going to use during the execution of our program. The only one that is noteworthy is `r`: we're using `*` to bunt, or get the default value for, the mold `(list @ud)`.
3939
4040```hoon
4141|- ^+ r
@@ -47,7 +47,7 @@ With this code, we define `|-`, the _trap_ that acts as a recursion point and co
4747?: =(i n) r
4848```
4949
50−In the code above, `?:` checks whether the first child, `=(i n)`, our terminating case, is true or false. If it is true, it branches to `r` and the program ends. If it is false, the program continues to the code below.
50+In the code above, `?:` checks whether the first child, `=(i n)` (our terminating case), is `true` or `false`. If it is `true`, it branches to `r` and the program ends. If it is `false`, the program continues to the code below.
5151
5252```hoon
5353%= $
tutorials/hoon/gates.md+37−36
@@ -4,17 +4,18 @@ weight = 6
44template = "doc.html"
55aliases = ["/docs/learn/hoon/hoon-tutorial/gates/"]
66+++
7+
78In this lesson you're going to learn about Hoon functions.
89
910## What is a Function?
1011
11−The word 'function' is used in various ways, but let's start by talking about them in the [mathematical sense](https://en.wikipedia.org/wiki/Function_%28mathematics%29). Roughly put, a function takes one or more arguments (i.e., input values) and returns a value. The return value depends solely on the argument(s), and nothing else. For example, we can understand multiplication as a function: it takes two numbers and returns another number. It doesn't matter where you ask, when you ask, or what kind of hat you're wearing when you ask. If you pass the same two numbers (e.g., `3` and `4`), you get the same answer returned every time (`12`).
12+The word "function" is used in various ways, but let's start by talking about them in the [mathematical sense](https://en.wikipedia.org/wiki/Function_%28mathematics%29). Roughly put, a function takes one or more arguments (i.e., input values) and returns a value. The return value depends solely on the argument(s), and nothing else. For example, we can understand multiplication as a function: it takes two numbers and returns another number. It doesn't matter where you ask, when you ask, or what kind of hat you're wearing when you ask. If you pass the same two numbers (e.g., `3` and `4`), you get the same answer returned every time (`12`).
1213
13−That output value depends solely upon input value(s) is an important property of functions. This property is called [referential transparency](https://en.wikipedia.org/wiki/Referential_transparency), and we make use of it throughout the Urbit software stack.
14+That output value depends solely upon input value(s) is an important property of functions. This property is called [referential transparency](https://en.wikipedia.org/wiki/Referential_transparency), and we make use of it throughout the Urbit software stack.
1415
15−Functions are implemented in Hoon with a special kind of [core](/docs/glossary/core/) called a **gate**. In this lesson you'll learn what a [gate](/docs/glossary/gate/) is and how a gate represents a function. Along the way you'll build some example gates of your own.
16+Functions are implemented in Hoon with a special kind of [core](/docs/glossary/core/) called a **gate**. In this lesson you'll learn what a [gate](/docs/glossary/gate/) is and how a gate represents a function. Along the way you'll build some example gates of your own.
1617
17−You've already used two functions from the Hoon standard library: `add` and `mul`. These are implemented with gates, and you call them from the dojo in the following way:
18+You've already used two functions from the Hoon standard library: `add` and `mul`. These are implemented with gates, and you call them from the Dojo in the following way:
1819
1920```
2021> (add 2 3)
@@ -28,7 +29,7 @@ You've already used two functions from the Hoon standard library: `add` and `mul
2829
2930A core is a cell: `[battery payload]`.
3031
31−A gate is a core with two distinctive properties: (1) the battery of a gate contains exactly one [arm](/docs/glossary/arm/), which has the special name `$`. The `$` [arm](/docs/glossary/arm/) contains the instructions for the function in question. And (2), the payload of a gate consists of a cell of `[sample context]`. The sample is the part of the payload that stores the 'argument' (i.e., input value) of the function call. The context contains all other data that is needed for computing the `$` [arm](/docs/glossary/arm/) of the gate correctly.
32+A gate is a core with two distinctive properties: (1) the battery of a gate contains exactly one [arm](/docs/glossary/arm/), which has the special name `$`. The `$` [arm](/docs/glossary/arm/) contains the instructions for the function in question. And (2), the payload of a gate consists of a cell of `[sample context]`. The sample is the part of the payload that stores the "argument" (i.e., input value) of the function call. The context contains all other data that is needed for computing the `$` [arm](/docs/glossary/arm/) of the gate correctly.
3233
3334```
3435Gate: [$ [Sample Context]]
@@ -44,11 +45,11 @@ As a tree, a gate looks like the following:
4445 Sample Context
4546```
4647
47−Like all arms, `$` is computed with its parent core as the subject. When `$` is computed, the resulting value is called the 'product' of the gate. No other data is used to calculate the product other than the data in the gate itself.
48+Like all arms, `$` is computed with its parent core as the subject. When `$` is computed, the resulting value is called the "product" of the gate. No other data is used to calculate the product other than the data in the gate itself.
4849
4950## Creating Your First Gate
5051
51−Let's make a gate that takes any unsigned integer (i.e., an [atom](/docs/glossary/atom/)) as its sample and returns that value plus one as the product. To do this we'll use the `|=` rune. We'll bind this gate to the face `inc` for 'increment':
52+Let's make a gate that takes any unsigned integer (i.e., an [atom](/docs/glossary/atom/)) as its sample and returns that value plus one as the product. To do this we'll use the `|=` rune. We'll bind this gate to the face `inc` for "increment":
5253
5354```
5455> =inc |=(a=@ (add 1 a))
@@ -63,21 +64,21 @@ Let's make a gate that takes any unsigned integer (i.e., an [atom](/docs/glossar
6364124
6465```
6566
66−The gate works as promised -- it takes any number `n` and returns `n + 1`. Let's take a closer look at what the `|=` is doing.
67+The gate works as promised -- it takes any number `n` and returns `n+1`. Let's take a closer look at what the `|=` is doing.
6768
6869### The `|=` Rune
6970
70−We typically use the `|=` rune to create a gate. In the expression above the `|=` is immediately followed by a set of parentheses containing two subexpressions: `a=@` and `(add 1 a)`. The first defines the gate's sample (input value type), and the second defines the gate's product (value).
71+We typically use the `|=` rune to create a gate. In the expression above the `|=` is immediately followed by a set of parentheses containing two subexpressions: `a=@` and `(add 1 a)`. The first defines the gate's sample (input value type), and the second defines the gate's product (value).
7172
72−In the example gate above, `inc`, the sample is defined by `a=@`. This means that the sample is defined as an atom, `@`, meaning that the gate will take as input anything of that type. The sample is given the face `a`. With the face it's easier to refer to the sample in later code, if desired.
73+In the example gate above, `inc`, the sample is defined by `a=@`. This means that the sample is defined as an atom, `@`, meaning that the gate will take as input anything of that type. The sample is given the face `a`. With the face it's easier to refer to the sample in later code, if desired.
7374
74−In `inc`, the product is defined by `(add 1 a)`. There's not much to it -- it returns the value of `a + 1`!
75+In `inc`, the product is defined by `(add 1 a)`. There's not much to it -- it returns the value of `a+1`!
7576
76−The second subexpression after the `|=` rune is used to build the gate's `$` arm. That's where all the computations go.
77+The second subexpression after the `|=` rune is used to build the gate's `$` arm. That's where all the computations go.
7778
7879## Anatomy of a Gate
7980
80−A gate is a one-armed core with a sample: `[$ [Sample Context]]`. Let's go over these parts a little more carefully, using `inc` as our example.
81+A gate is a one-armed core with a sample: `[$ [Sample Context]]`. Let's go over these parts a little more carefully, using `inc` as our example.
8182
8283```
8384> inc
@@ -93,27 +94,27 @@ A gate is a one-armed core with a sample: `[$ [Sample Context]]`. Let's go over
9394
9495The arm of a gate encodes the instructions for the Hoon function in question.
9596
96−The pretty printer represents the `$` arm of `inc` as `1.jgn`. To see the actual [noun](/docs/glossary/noun/) of the `$` arm, enter `+2:inc` into the dojo:
97+The pretty printer represents the `$` arm of `inc` as `1.jgn`. To see the actual [noun](/docs/glossary/noun/) of the `$` arm, enter `+2:inc` into the Dojo:
9798
9899```
99100> +2:inc
100101[8 [9 8 0 4.095] 9 2 [0 4] [[7 [0 3] 1 1] 0 14] 0 11]
101102```
102103
103−This is un-computed Nock. You don't need to understand any of this.
104+This is un-computed Nock. You don't need to understand any of this.
104105
105−It's worth pointing out that the arm name, `$`, can be used like any other name. We can compute `$` directly with `$:inc` in the dojo:
106+It's worth pointing out that the arm name, `$`, can be used like any other name. We can compute `$` directly with `$:inc` in the Dojo:
106107
107108```
108109> $:inc
1091101
110111```
111112
112−This result may seem a bit strange. We didn't call `inc` or in any other way pass it a number. Yet using `$` to evaluate `inc`'s arm seems to work -- sort of, anyway. Why is it giving us `1` as the return value? We can answer this question after we understand gate samples a little better.
113+This result may seem a bit strange. We didn't call `inc` or in any other way pass it a number. Yet using `$` to evaluate `inc`'s arm seems to work -- sort of, anyway. Why is it giving us `1` as the return value? We can answer this question after we understand gate samples a little better.
113114
114115### The Sample
115116
116−The sample of a gate is the address reserved for storing the argument(s) to the Hoon function. The sample is always at the head of the gate's tail, i.e., `+6`.
117+The sample of a gate is the address reserved for storing the argument(s) to the Hoon function. The sample is always at the head of the gate's tail, i.e., `+6`.
117118
118119Let's look at the gate for `inc` again, paying particular attention to its sample:
119120
@@ -127,27 +128,27 @@ Let's look at the gate for `inc` again, paying particular attention to its sampl
127128>
128129```
129130
130−We see `a/@`. This may not be totally clear, but it should make _some_ sense. This is the pretty-printer's way of indicating an atom with the face `a`. Let's take a closer look:
131+We see `a/@`. This may not be totally clear, but it should make _some_ sense. This is the pretty-printer's way of indicating an atom with the face `a`. Let's take a closer look:
131132
132133```
133134> +6:inc
134135a=0
135136```
136137
137−We see now that the sample of `inc` is the value `0`, and has `a` as a face. This is a placeholder value for the function argument. If you evaluate the `$` arm of `inc` without passing it an argument the placeholder value is used for the computation, and the return value will thus be `0 + 1`:
138+We see now that the sample of `inc` is the value `0`, and has `a` as a face. This is a placeholder value for the function argument. If you evaluate the `$` arm of `inc` without passing it an argument the placeholder value is used for the computation, and the return value will thus be `0+1`:
138139
139140```
140141> $:inc
1411421
142143```
143144
144−The placeholder value is sometimes called a **bunt** value. The bunt value is determined by the input type; for atoms, `@`, the bunt value is `0`.
145+The placeholder value is sometimes called a **bunt** value. The bunt value is determined by the input type; for atoms, `@`, the bunt value is `0`.
145146
146−The face value of `a` comes from the way we defined the gate above: `|=(a=@ (add 1 a))`. It was so we could use `a` to refer to the sample to generate the product with `(add 1 a)`.
147+The face value of `a` comes from the way we defined the gate above: `|=(a=@ (add 1 a))`. It was so we could use `a` to refer to the sample to generate the product with `(add 1 a)`.
147148
148149### The Context
149150
150−The context of a gate contains other data that may be necessary for the `$` arm to evaluate correctly. The context always located at the tail of the tail of the gate, i.e., `+7` of the gate. There is no requirement that the context have any particular arrangement, though often it does.
151+The context of a gate contains other data that may be necessary for the `$` arm to evaluate correctly. The context is always located at the tail of the tail of the gate, i.e., `+7` of the gate. There is no requirement for the context to have any particular arrangement, though often it does.
151152
152153Let's look at the context of `inc`:
153154
@@ -164,28 +165,28 @@ Let's look at the context of `inc`:
164165]
165166```
166167
167−This is exactly the default dojo subject, from before we put `inc` into the subject. The `|=` expression defines the context as whatever the subject is. This guarantees that the context has all the information it needs to have for the `$` arm to work correctly.
168+This is exactly the default Dojo subject, from before we put `inc` into the subject. The `|=` expression defines the context as whatever the subject is. This guarantees that the context has all the information it needs to have for the `$` arm to work correctly.
168169
169170### Exercise 1.4.1a
170171
171−Write a gate that takes an atom, `a=@`, and which returns double the value of `a`. Bind this gate to `double` and test it in the dojo. A solution is given at the end of this lesson.
172+Write a gate that takes an atom, `a=@`, and which returns double the value of `a`. Bind this gate to `double` and test it in the Dojo. A solution is given at the end of this lesson.
172173
173174## Gates Define Functions of the Sample
174175
175−The value of a function's output depends solely upon the input value. This is one of the features that make functions desirable in many programming contexts. It's worth going over how Hoon function calls implement this feature.
176+The value of a function's output depends solely upon the input value. This is one of the features that make functions desirable in many programming contexts. It's worth going over how Hoon function calls implement this feature.
176177
177−In Hoon one can use `(gate arg)` syntax to make a function call. For example,
178+In Hoon, one can use `(gate arg)` syntax to make a function call. For example:
178179
179180```
180181> (inc 234)
181182235
182183```
183184
184−The name of the gate is `inc`. How is the `$` arm of `inc` evaluated? When a function call occurs, a copy of the `inc` gate is created, but with one modification; the sample is replaced with the function argument. Then the `$` arm is computed against this modified version of the `inc` gate.
185+The name of the gate is `inc`. How is the `$` arm of `inc` evaluated? When a function call occurs, a copy of the `inc` gate is created, but with one modification; the sample is replaced with the function argument. Then the `$` arm is computed against this modified version of the `inc` gate.
185186
186−Remember that the default or 'bunt' value of the sample of `inc` is `0`. In the function call above, a copy of the `inc` gate is made but with a sample value of `234`. When `$` is computed against this modified core, the product is `235`.
187+Remember that the default or "bunt" value of the sample of `inc` is `0`. In the function call above, a copy of the `inc` gate is made but with a sample value of `234`. When `$` is computed against this modified core, the product is `235`.
187188
188−Notice that neither the arm nor the context is modified before the arm is evaluated. That means that the only part of the gate that changes before the arm evaluation is the sample. Hence, we may understand each gate as defining a function whose argument is the sample. If you call a gate with the same sample, you'll get the same value returned to you every time.
189+Notice that neither the arm nor the context is modified before the arm is evaluated. That means that the only part of the gate that changes before the arm evaluation is the sample. Hence, we may understand each gate as defining a function whose argument is the sample. If you call a gate with the same sample, you'll get the same value returned to you every time.
189190
190191Let's unbind `inc` to keep the subject tidy:
191192
@@ -198,7 +199,7 @@ Let's unbind `inc` to keep the subject tidy:
198199
199200### Modifying the Context of a Gate
200201
201−It _is_ possible to modify the context of a gate when you make a function call; or, to be more precise, it's possible to call a mutant copy of the gate in which the context is modified. To illustrate this let's use another example gate. Let's write a gate which uses a value from the context to generate the product. Bind `b` to the value `10`:
202+It _is_ possible to modify the context of a gate when you make a function call; or, to be more precise, it's possible to call a mutant copy of the gate in which the context is modified. To illustrate this let's use another example gate. Let's write a gate which uses a value from the context to generate the product. Bind `b` to the value `10`:
202203
203204```
204205> =b 10
@@ -222,7 +223,7 @@ Now let's write a gate called `ten` that adds `b` to the input value:
22222335
223224```
224225
225−We can unbind `b` from the dojo subject, and `ten` works just as well because it's using a copy of `b` stored its context:
226+We can unbind `b` from the Dojo subject, and `ten` works just as well because it's using a copy of `b` stored its context:
226227
227228```
228229> =b
@@ -233,11 +234,11 @@ We can unbind `b` from the dojo subject, and `ten` works just as well because it
233234> (ten 35)
23423545
235236
236−> b.+6.ten
237+> b.+14.ten
23723810
238239```
239240
240−We can use `ten(b 25)` to produce a variant of `ten`. Calling this mutant version of `ten` causes a different value to be returned than we'd get with a normal `ten` call:
241+We can use `ten(b 25)` to produce a variant of `ten`. Calling this mutant version of `ten` causes a different value to be returned than we'd get with a normal `ten` call:
241242
242243```
243244> (ten(b 25) 10)
@@ -256,9 +257,9 @@ Before finishing the lesson let's unbind `ten`:
256257> =ten
257258```
258259
259−## Exercise 1.4.1a Solution
260+## Exercise 1.4.1a: Answer
260261
261−Write a gate that takes an atom, `a=@`, and which returns double the value of `a`. Bind this gate to `double` and test it in the dojo.
262+Write a gate that takes an atom, `a=@`, and which returns double the value of `a`. Bind this gate to `double` and test it in the Dojo.
262263
263264```
264265> =double |=(a=@ (mul 2 a))
tutorials/hoon/generators.md+2−145
@@ -11,7 +11,7 @@ input and produce an output, then disappear. Generators might make sense for
1111listing directory contents, or running unit tests, or fetching the contents of a
1212URL.
1313
14−There are four kinds of generators: naked, `%say`, `%get`, and `%ask`.
14+There are three kinds of generators: naked, `%say`, and `%ask`. There also used to be a fourth type of generator, `%get`, but this kind is no longer in use.
1515
1616### Naked Generators
1717
@@ -454,150 +454,7 @@ This is a [known issue](https://github.com/urbit/arvo/issues/840) to be resolved
454454
455455### `%get` generators
456456
457−`%get` generators are used for making HTTP requests through `eyre`. For this
458−section we'll assume knowledge of generators covered in previous sections, so
459−we can jump in with an example:
460−
461−```hoon
462−/- sole
463−/+ generators
464−=, generators
465−:- %get
466−|= [* [url=tape ~] ~]
467−^- (sole-request:sole (cask json))
468−%+ curl (scan url auri:de-purl:html)
469−|= hit/httr:eyre
470−?~ r.hit !!
471−=/ my-json (de-json:html q.u.r.hit)
472−?~ my-json !!
473−=, dejs:format
474−%+ produce %json
475−%. %title
476−%~ got by
477−%- (om same)
478−u.my-json
479−```
480−
481−The above generator was written with the
482−[Studio Ghibli API](https://ghibliapi.herokuapp.com/). It uses this API to
483−print the title of a Studio Ghibli film.
484−
485−```hoon
486−/- sole
487−/+ generators
488−=, generators
489−```
490−
491−Here we import types from `/sur/sole.hoon` and gates from
492−`/lib/generators.hoon`. We also use `=,` to expose the namespace of
493−`generators` that we just imported.
494−
495−```hoon
496−:- %get
497−|= [* [url=tape ~] ~]
498−```
499−
500−Like with `%say` and `%ask` generators, we must include the "boilerplate":
501−code that produces a generator-specific `cell`. The head of that cell is `%get`,
502−and the tail is a gate that takes a `tape` of the URL that we are trying
503−to access.
504−
505−```hoon
506−^- (sole-request:sole (cask json))
507−```
508−
509−Here we make sure our gate is producing a `sole-request` which contains a `cask`
510−of the type `json`.
511−
512−
513−```hoon
514−%+ curl (scan url auri:de-purl:html)
515−|= hit/httr:eyre
516−```
517−
518−Here we can see the call to `curl`, the sample of which will parse our url and
519−make sure it's in the proper format.
520−
521−The second part of the `curl` call is the `gate` that will get called with the
522−result provided by the actual HTTP request.
523−
524−```hoon
525−?~ r.hit !!
526−```
527−
528−Here we verify that the `r` face of our response is not null before
529−continuing. If it is null, the generator will crash, as there is nothing left to
530−do.
531−
532−```hoon
533−=/ my-json (de-json:html q.u.r.hit)
534−```
535−
536−Here we verify that data was returned to us in the `json` Hoon type.
537−`q.u.r.hit` is the actual data we care about as a `cord`. `hit` is actually an
538−entire response object, including headers, which we don't care about for this
539−example. `de-json` out of `html` will parse the `cord` and produce a `json` type
540−for us that we can then use to inspect the data.
541−
542−```hoon
543−?~ my-json !!
544−=, dejs:format
545−```
546−
547−After parsing the JSON structure we want to make sure we got back a valid `json`
548−type. To do that, we test for null and crash if that test passes. If it doesn't
549−pass, we use `=,` on the `dejs:format` core so that we can more easily pull arms
550−out of it.
551−
552−```hoon
553−%+ produce %json
554−%. %title
555−%~ got by
556−```
557−
558−Now we come to our `produce` call. Recall that `produce` is used in all the
559−non-naked generators to output the final result. Here we want to produce a
560−`cask` of `json`, so we use the mark `%json` to indicate that.
561−
562−Next we have what may be an unfamiliar rune: `%.`. This rune is simply `%-` with
563−the argument order reversed. `%title` is the argument passed to the next gate
564−that is called. `by` is the core that is the `map` engine. A Hoon `map` is a
565−key-value pair structure, sometimes referred to as a dictionary in other
566−languages. `got` is the arm in `by` that will produce a gate that we can call to
567−access members of a given `map`.
568−
569−> The idiomatic way to write Hoon is to have the
570− "heaviest" code paths lowest in the program, which is why `%.`
571− is preferred in this case over `%-`. Use of this style is recommended, as it
572− results in code that is much easier to read.
573−
574−At the moment, however, we do not have a `map`, but instead have a `json` type.
575−
576−```hoon
577−%- (om same)
578−u.my-json
579−```
580−
581−Here we use `om`, which is an arm in `dejs:format` that will take a `json` and
582−return a `map`. `same` is a wet gate from the standard library that takes an
583−argument of any type and returns it as that type. We could use any other gate to
584−modify the data if that were useful for the particular data we are going to be
585−processing, but here we want the data exactly as it is.
586−
587−Since `my-json` is a `unit` of `json`, the actual data we are looking for is in
588−`u.my-json`. We take this and give it to the gate produced by the call to `om`.
589−This gate is going to transform our data by taking in the `json` structure and
590−producing a `map`. Then we can look up keys in this map using `got` from
591−the `by` core.
592−
593−`%.` performs the same function as `%-`, the rune used to call a function,
594−except with the arguments reversed so that the function is last and
595−the arguments of that function come first. It's used here to keep with the
596−principle that heaviest, or most complex, expressions should go to the bottom.
597−
598−The key we are looking up in our new `map` we've created from `my-json` is
599−`%title`, which is an element in the original source, to produce the final
600−result of the generator.
457+`%get` generators no longer exist. They were once used for making HTTP requests through `eyre`. Such functionality is no longer supported with generators.
601458
602459## Conclusion
603460
tutorials/hoon/hoon-syntax.md+54−54
@@ -7,22 +7,22 @@ aliases = ["/docs/learn/hoon/hoon-tutorial/hoon-syntax/"]
77
88The study of Hoon can be divided into two parts: syntax and semantics.
99
10−The [syntax](https://en.wikipedia.org/wiki/Syntax_%28programming_languages%29 ) of a programming language is the set of rules that determine what counts as admissible code in that language. It determines which characters may be used in the source, and also how these characters may be assembled to constitute a program. Attempting to run a program that doesn't follow these rules will result in a syntax error.
10+The [syntax](https://en.wikipedia.org/wiki/Syntax_%28programming_languages%29 ) of a programming language is the set of rules that determine what counts as admissible code in that language. It determines which characters may be used in the source, and also how these characters may be assembled to constitute a program. Attempting to run a program that doesn’t follow these rules will result in a syntax error.
1111
12−The [semantics](https://en.wikipedia.org/wiki/Semantics_%28computer_science%29 ) of a programming language concerns the meaning of the various parts of that language's code.
12+The [semantics](https://en.wikipedia.org/wiki/Semantics_%28computer_science%29 ) of a programming language concerns the meaning of the various parts of that language’s code.
1313
14−In this lesson we will give a general overview of Hoon's syntax. By the end of it, you should be familiar with all the basic elements of Hoon code.
14+In this lesson we will give a general overview of Hoon’s syntax. By the end of it, you should be familiar with all the basic elements of Hoon code.
1515
1616## Hoon Characters
1717
18−Hoon source files are composed almost entirely of the [printable ASCII characters](https://en.wikipedia.org/wiki/ASCII%23Printable_characters). Hoon does not accept any other characters in source files except for [UTF-8](https://en.wikipedia.org/wiki/UTF-8) in quoted strings. Hard tab characters are illegal; use two spaces instead.
18+Hoon source files are composed almost entirely of the [printable ASCII characters](https://en.wikipedia.org/wiki/ASCII%23Printable_characters). Hoon does not accept any other characters in source files except for [UTF-8](https://en.wikipedia.org/wiki/UTF-8) in quoted strings. Hard tab characters are illegal; use two spaces instead.
1919
2020```
2121> "You can put ½ in quotes, but not elsewhere!"
2222"You can put ½ in quotes, but not elsewhere!"
2323
24−> 'You can put ½ in single quotes too.'
25−'You can put ½ in single quotes too.'
24+> 'You can put ½ in single quotes, too.'
25+'You can put ½ in single quotes, too.'
2626
2727> "Some UTF-8: ἄλφα"
2828"Some UTF-8: ἄλφα"
@@ -30,7 +30,7 @@ Hoon source files are composed almost entirely of the [printable ASCII character
3030
3131### Reading Hoon Aloud
3232
33−Hoon code makes heavy use of non-alphanumeric symbols. Reading off code aloud using the proper names of ASCII symbols is tedious, so we've mapped syllables to symbols:
33+Hoon code makes heavy use of non-alphanumeric symbols. Reading off code aloud using the proper names of ASCII symbols is tedious, so we’ve mapped syllables to symbols:
3434
3535```
3636ace [1 space] gap [>1 space, nl] pat @
@@ -47,25 +47,25 @@ fas / pam &
4747gal < par )
4848```
4949
50−Learning and using these names of non-alphanumeric symbols is entirely optional; you can become an expert Hoon programmer without them. Many Hoon programmers find them helpful, however, particularly when talking to someone else who knows them.
50+Learning and using these names of non-alphanumeric symbols is entirely optional; you can become an expert Hoon programmer without them. Many Hoon programmers find them helpful, however, particularly when talking to someone else who knows them.
5151
52−Note that the list includes two separate whitespace forms: `ace` for a single space; `gap` is either 2+ spaces or a newline. In Hoon, the only whitespace significance is the distinction between `ace` and `gap` -- i.e., the distinction between one space and more than one.
52+Note that the list includes two separate whitespace forms: `ace` for a single space; `gap` is either 2+ spaces or a newline. In Hoon, the only whitespace significance is the distinction between `ace` and `gap` -- i.e., the distinction between one space and more than one.
5353
5454## Expressions of Hoon
5555
56−An [expression](https://en.wikipedia.org/wiki/Expression_%28computer_science%29 ) is a combination of characters that the language interprets and evaluates as producing a value. Hoon programs are made up entirely of expressions.
56+An [expression](https://en.wikipedia.org/wiki/Expression_%28computer_science%29 ) is a combination of characters that the language interprets and evaluates as producing a value. Hoon programs are made up entirely of expressions.
5757
58−Hoon expressions can be either basic or complex. Basic expressions of Hoon are fundamental, meaning that they can't be broken down into smaller expressions. Complex expressions are made up of smaller expressions (which are called **subexpressions**).
58+Hoon expressions can be either basic or complex. Basic expressions of Hoon are fundamental, meaning that they can’t be broken down into smaller expressions. Complex expressions are made up of smaller expressions (which are called **subexpressions**).
5959
60−There are many categories of Hoon expressions: [noun](/docs/glossary/noun/) literals, wing expressions, type expressions, and rune expressions. Let's go over each.
60+There are many categories of Hoon expressions: [noun](/docs/glossary/noun/) literals, wing expressions, type expressions, and rune expressions. Let’s go over each.
6161
6262### Noun Literals
6363
64−A noun is either an [atom](/docs/glossary/atom/) or a cell. An [atom](/docs/glossary/atom/) is an unsigned integer and a cell is a pair of nouns.
64+A noun is either an [atom](/docs/glossary/atom/) or a cell. An [atom](/docs/glossary/atom/) is an unsigned integer and a cell is a pair of nouns.
6565
66−There are [literal](https://en.wikipedia.org/wiki/Literal_%28computer_programming%29 ) expressions for each kind of noun. A noun literal is just a notation for representing a fixed noun value.
66+There are [literal](https://en.wikipedia.org/wiki/Literal_%28computer_programming%29 ) expressions for each kind of noun. A noun literal is just a notation for representing a fixed noun value.
6767
68−We start with atom literals. Each of these is a basic expression of Hoon that evaluates to itself. Examples:
68+We start with atom literals. Each of these is a basic expression of Hoon that evaluates to itself. Examples:
6969
7070```
7171> 1
@@ -84,9 +84,9 @@ We start with atom literals. Each of these is a basic expression of Hoon that e
8484~zod
8585```
8686
87−Recall from [Lesson 1.2](@/docs/tutorials/hoon/nouns.md) that even though atoms are unsigned integers, they can be pretty-printed in different ways. The way an atom is to be represented depends on its aura. The literal syntax for each of the hard-coded auras will be explained further in [Lesson 2.1](@/docs/tutorials/hoon/atoms-auras-and-simple-cell-types.md).
87+Recall from [Lesson 1.2](@/docs/tutorials/hoon/nouns.md) that even though atoms are unsigned integers, they can be pretty-printed in different ways. The way an atom is to be represented depends on its aura. The literal syntax for each of the hard-coded auras will be explained further in [Lesson 2.1](@/docs/tutorials/hoon/atoms-auras-and-simple-cell-types.md).
8888
89−Cell literals can be written in Hoon using `[ ]`. Cell literals are complex, because other expressions are put inside the square brackets. Examples:
89+Cell literals can be written in Hoon using `[ ]`. Cell literals are complex, because other expressions are put inside the square brackets. Examples:
9090
9191```
9292> [6 7]
@@ -102,7 +102,7 @@ Cell literals can be written in Hoon using `[ ]`. Cell literals are complex, be
102102[123 [~zod ~ten] .1.2837]
103103```
104104
105−You can also put complex expressions inside square brackets to make a cell. These are valid expressions but they aren't cell literals, naturally:
105+You can also put complex expressions inside square brackets to make a cell. These are valid expressions but they aren’t cell literals, naturally:
106106
107107```
108108> [(add 22 33) (mul 22 33)]
@@ -111,9 +111,9 @@ You can also put complex expressions inside square brackets to make a cell. The
111111
112112### Wings
113113
114−A wing expression is a series of limb expressions separated by `.`. A deeper explanation can be found on the [wing](@/docs/reference/hoon-expressions/limb/wing.md) and [limb](@/docs/reference/hoon-expressions/limb/limb.md) reference pages.
114+A wing expression is a series of limb expressions separated by `.`. A deeper explanation can be found on the [wing](@/docs/reference/hoon-expressions/limb/wing.md) and [limb](@/docs/reference/hoon-expressions/limb/limb.md) reference pages.
115115
116−Let's start with the base case: a single limb. A limb expression is a trivial wing expression -- there is only one limb in the series. Some one-limb wings:
116+Let’s start with the base case: a single limb. A limb expression is a trivial wing expression -- there is only one limb in the series. Some one-limb wings:
117117
118118- `+2`
119119- `-`
@@ -124,9 +124,9 @@ Let's start with the base case: a single limb. A limb expression is a trivial w
124124- `add`
125125- `mul`
126126
127−As a special limb we also have `$`. This is the name of the [arm](/docs/glossary/arm/) in special one-armed [cores](/docs/glossary/core/) called "gates". (We'll cover the role of `$` in [Lesson 1.4](@/docs/tutorials/hoon/gates.md).)
127+As a special limb we also have `$`. This is the name of the [arm](/docs/glossary/arm/) in special one-armed [cores](/docs/glossary/core/) called “gates”. (We’ll cover the role of `$` in [Lesson 1.4](@/docs/tutorials/hoon/gates.md).)
128128
129−Wing expressions with multiple limbs are complex expressions. Examples:
129+Wing expressions with multiple limbs are complex expressions. Examples:
130130
131131- `+2.+3.+4`
132132- `-.+.+`
@@ -139,29 +139,29 @@ Wing expressions with multiple limbs are complex expressions. Examples:
139139
140140### Type Expressions
141141
142−Hoon is a statically typed language. You'll learn more about the type system later in the chapter. For now, just know that Hoon's type system uses special symbols to indicate certain fundamental types: `~` (null), `*` (noun), `@` (atom), `^` (cell), and `?` (flag). Each of these symbols can be used as a stand-alone expression of Hoon. In the case of `@` there may be a series of letters following it, to indicate an atom aura; e.g., `@s`, `@rs`, `@tas`, and `@tD`.
142+Hoon is a statically typed language. You’ll learn more about the type system later in the chapter. For now, just know that Hoon’s type system uses special symbols to indicate certain fundamental types: `~` (null), `*` (noun), `@` (atom), `^` (cell), and `?` (flag). Each of these symbols can be used as a stand-alone expression of Hoon. In the case of `@` there may be a series of letters following it, to indicate an atom aura; e.g., `@s`, `@rs`, `@tas`, and `@tD`.
143143
144−They may also be put in brackets to indicate compound types, e.g., `[@ ^]`, `[@ud @sb]`, `[[? *] ^]`. (Technically these expressions don't _always_ indicate compound types. In certain contexts they're interpreted in a different way. We'll address this variation of meaning in [Lesson 2.3](@/docs/tutorials/hoon/structures-and-complex-types.md).)
144+They may also be put in brackets to indicate compound types, e.g., `[@ ^]`, `[@ud @sb]`, `[[? *] ^]`. (Technically these expressions don’t _always_ indicate compound types. In certain contexts they’re interpreted in a different way. We’ll address this variation of meaning in [Lesson 2.3](@/docs/tutorials/hoon/structures-and-complex-types.md).)
145145
146146### Rune Expressions
147147
148−A **rune** is just a pair of ASCII characters (a digraph). You've already seen some runes in Chapter 1: `|=`,`|%`, and `|_`. We usually pronounce runes by combining their characters' names, e.g.: 'ket-hep' for `^-`, 'bar-tis' for `|=`, and 'bar-cen' for `|%`. As stated previously, these names are entirely optional.
148+A **rune** is just a pair of ASCII characters (a digraph). You’ve already seen some runes in Chapter 1: `|=`,`|%`, and `|_`. We usually pronounce runes by combining their characters’ names, e.g.: “ket-hep” for `^-`, “bar-tis” for `|=`, and “bar-cen” for `|%`. As stated previously, these names are entirely optional.
149149
150−Expressions with a rune at the beginning are rune expressions. Most runes are used at the beginning of a complex expression, but there are exceptions. For example, the runes `--` and `==` are used at the end of certain expressions.
150+Expressions with a rune at the beginning are rune expressions. Most runes are used at the beginning of a complex expression, but there are exceptions. For example, the runes `--` and `==` are used at the end of certain expressions.
151151
152−Runes are classified by family (with the exceptions of `--` and `==`). The first of the two symbols indicates the family -- e.g., the `^-` rune is in the `^` family of runes, and the `|=` and `|%` runes are in the `|` family. The runes of particular family usually have related meanings. Two simple examples: the runes in the `|` family are all used to create cores, and the runes in the `:` family are all used to create cells.
152+Runes are classified by family (with the exceptions of `--` and `==`). The first of the two symbols indicates the family -- e.g., the `^-` rune is in the `^` family of runes, and the `|=` and `|%` runes are in the `|` family. The runes of particular family usually have related meanings. Two simple examples: the runes in the `|` family are all used to create cores, and the runes in the `:` family are all used to create cells.
153153
154−Rune expressions are usually complex, which means they usually have one or more subexpressions. The appropriate syntax varies from rune to rune; after all, they're used for different purposes. To see the syntax rules for a particular rune, consult the [rune reference](@/docs/reference/hoon-expressions/rune/_index.md). Nevertheless, there are some general principles that hold of all rune expressions.
154+Rune expressions are usually complex, which means they usually have one or more subexpressions. The appropriate syntax varies from rune to rune; after all, they’re used for different purposes. To see the syntax rules for a particular rune, consult the [rune reference](@/docs/reference/hoon-expressions/rune/_index.md). Nevertheless, there are some general principles that hold of all rune expressions.
155155
156−Runes generally do not need to be closed. In other languages you'll see an abundance of terminators, such as opening and closing parentheses, and this way of doing this is largely absent from Urbit. That's because all runes take a fixed number of children. Children can themselves be runes (with more children), and Hoon programs work by chaining through these series of children until a value -- not another rune -- is arrived at. This makes Hoon code nice and neat to look at.
156+Runes generally do not need to be closed. In other languages you’ll see an abundance of terminators, such as opening and closing parentheses, and this way of doing this is largely absent from Urbit. That’s because all runes take a fixed number of children. Children can themselves be runes (with more children), and Hoon programs work by chaining through these series of children until a value -- not another rune -- is arrived at. This makes Hoon code nice and neat to look at.
157157
158−#### Tall and Flat Forms
158+#### Tall and Wide Forms
159159
160−There are two rune syntax forms: **tall** and **flat**. Tall form is usually used for multi-line expressions, and flat form is used for one-line expressions. Most runes can be used in either of tall or flat forms. Tall form expressions may contain flat form subexpressions, but flat form expressions may not contain tall form.
160+There are two rune syntax forms: **tall** and **wide**. Tall form is usually used for multi-line expressions, and wide form is used for one-line expressions. Most runes can be used in either of tall or wide forms. Tall form expressions may contain wide form subexpressions, but wide form expressions may not contain tall form.
161161
162−The spacing rules differ in the two forms. In tall form, each rune and subexpression must be separated from the others by a `gap` -- that is, by two or more spaces, or a line break. In flat form the rune is immediately followed by parentheses `( )`, and the various subexpressions inside the parentheses must be separated from the others by an `ace` -- that is, by a single space.
162+The spacing rules differ in the two forms. In tall form, each rune and subexpression must be separated from the others by a `gap` -- that is, by two or more spaces, or a line break. In wide form the rune is immediately followed by parentheses `( )`, and the various subexpressions inside the parentheses must be separated from the others by an `ace` -- that is, by a single space.
163163
164−Seeing an example will help you understand the difference. The `:-` rune is used to produce a cell. Accordingly, it is followed by two subexpressions: the first defines the head of the cell, and the second defines the tail. Here are three different ways to write a `:-` expression in tall form:
164+Seeing an example will help you understand the difference. The `:-` rune is used to produce a cell. Accordingly, it is followed by two subexpressions: the first defines the head of the cell, and the second defines the tail. Here are three different ways to write a `:-` expression in tall form:
165165
166166```
167167> :- 11 22
@@ -177,22 +177,22 @@ Seeing an example will help you understand the difference. The `:-` rune is use
177177[11 22]
178178```
179179
180−These all do the same thing. The first example shows that, if you want to, you can write 'tall' form code on a single line. Notice that there are two spaces between the `:-` rune and `11`, and also between `11` and `22`. This is the minimum spacing necessary between the various parts of a tall form expression -- any fewer will result in a syntax error.
180+These all do the same thing. The first example shows that, if you want to, you can write tall form code on a single line. Notice that there are two spaces between the `:-` rune and `11`, and also between `11` and `22`. This is the minimum spacing necessary between the various parts of a tall form expression -- any fewer will result in a syntax error.
181181
182−Usually one or more line breaks are used to break up a tall form expression. This is especially useful when the subexpressions are themselves long stretches of code. The same `:-` expression in flat-form is:
182+Usually one or more line breaks are used to break up a tall form expression. This is especially useful when the subexpressions are themselves long stretches of code. The same `:-` expression in wide form is:
183183
184184```
185185> :-(11 22)
186186[11 22]
187187```
188188
189−This is the preferred way to write an expression on a single line. The rune itself is followed by a set of parentheses, and the subexpressions inside are separated by a single space. Any more spacing than that results in a syntax error.
189+This is the preferred way to write an expression on a single line. The rune itself is followed by a set of parentheses, and the subexpressions inside are separated by a single space. Any more spacing than that results in a syntax error.
190190
191−Nearly all rune expressions can be written in either form, but there are exceptions. `|%` and `|_` expressions, for example, can only be written in tall form. (Those are a bit too complicated to fit comfortably on one line anyway.)
191+Nearly all rune expressions can be written in either form, but there are exceptions. `|%` and `|_` expressions, for example, can only be written in tall form. (Those are a bit too complicated to fit comfortably on one line anyway.)
192192
193193#### Nesting Runes
194194
195−Since runes take a fixed number of children, one can visualize how Hoon expressions are built by thinking of each rune being followed by a series of boxes to be filled - one for each of its children. Let us illustrate this with the `:-` rune.
195+Since runes take a fixed number of children, one can visualize how Hoon expressions are built by thinking of each rune being followed by a series of boxes to be filled -- one for each of its children. Let us illustrate this with the `:-` rune.
196196
197197![](https://media.urbit.org/docs/hoon-syntax/cell1.png)
198198
@@ -204,7 +204,7 @@ This, of course, evaluates to the cell `[2 3]`. This next figure corresponds to
204204
205205![](https://media.urbit.org/docs/hoon-syntax/cell3.png)
206206
207−This evaluates to `[[2 3] 4]`, and we can think of the second `:-` as being "nested" inside of the first `:-`.
207+This evaluates to `[[2 3] 4]`, and we can think of the second `:-` as being “nested” inside of the first `:-`.
208208
209209What Hoon expression does the following figure correspond to, and what does it evaluate to?
210210
@@ -213,17 +213,17 @@ What Hoon expression does the following figure correspond to, and what does it e
213213Right. This represents the Hoon expression `:- 2 :- 3 4`,
214214and evaluates to `[2 [3 4]]`. Remember, though, that if you input this into dojo it will print as `[2 3 4]`.
215215
216−Thinking in terms of these "LEGO block" diagrams, as well as the more literal binary tree diagrams utilized in [Lesson 1.2](@/docs/tutorials/hoon/nouns.md), can be a helpful learning and debugging tactic.
216+Thinking in terms of these “LEGO block” diagrams, as well as the more literal binary tree diagrams utilized in [Lesson 1.2](@/docs/tutorials/hoon/nouns.md), can be a helpful learning and debugging tactic.
217217
218−##### Exercise 1.3.a.
218+##### Exercise 1.3a
219219
220220Draw binary trees corresponding to the above figures. Determine a one-to-one correspondence between linearly ordered nested boxes (i.e. what is depicted in the above figures) and binary trees. You will need to make use of the convention `[a [b c]] = [a b c]`.
221221
222222#### Irregular Forms
223223
224−Some runes are used so frequently that they have irregular counterparts that are easier to write and which mean precisely the same thing. Irregular rune syntax is hence a form of [syntactic sugar](https://en.wikipedia.org/wiki/Syntactic_sugar). All irregular rune syntax is flat. (It follows from this that all tall form expressions are regular.)
224+Some runes are used so frequently that they have irregular counterparts that are easier to write and which mean precisely the same thing. Irregular rune syntax is hence a form of [syntactic sugar](https://en.wikipedia.org/wiki/Syntactic_sugar). All irregular rune syntax is wide. (It follows from this that all tall form expressions are regular.)
225225
226−Let's look at another example. The `.=` rune takes two subexpressions, evaluates them, and tests the results for equality. If they're equal it produces `%.y` for 'yes'; otherwise `%.n` for 'no'. In tall form:
226+Let’s look at another example. The `.=` rune takes two subexpressions, evaluates them, and tests the results for equality. If they’re equal it produces `%.y` for “yes”; otherwise `%.n` for “no”. In tall form:
227227
228228```
229229> .= 22 11
@@ -234,7 +234,7 @@ Let's look at another example. The `.=` rune takes two subexpressions, evaluate
234234%.y
235235```
236236
237−And in flat form:
237+And in wide form:
238238
239239```
240240> .=(22 11)
@@ -254,7 +254,7 @@ The irregular form of the `.=` rune is just `=( )`:
254254%.y
255255```
256256
257−The examples above have another irregular form: `(add 11 11)`. This is the irregular form of `%+`, which calls a [gate](/docs/glossary/gate/) (i.e., a Hoon function) with two arguments for the sample.
257+The examples above have another irregular form: `(add 11 11)`. This is the irregular form of `%+`, which calls a [gate](/docs/glossary/gate/) (i.e., a Hoon function) with two arguments for the sample.
258258
259259```
260260> %+ add 11 11
@@ -283,7 +283,7 @@ You can find other irregular forms in the irregular expression [reference docume
283283
284284### Expressions That Are Only Irregular
285285
286−There are certain irregular expressions that aren't syntactic sugar for regular form equivalents -- they're solely irregular. There isn't much in general that can be said about these because they're all different, but we can look at some examples.
286+There are certain irregular expressions that aren’t syntactic sugar for regular form equivalents -- they’re solely irregular. There isn’t much in general that can be said about these because they’re all different, but we can look at some examples.
287287
288288Below we use the `` ` `` symbol to create a cell whose head is null, `~`.
289289
@@ -319,9 +319,9 @@ To see other irregular expressions, check the irregular expression [reference do
319319
320320## The Standard Library
321321
322−The Hoon standard library is a compilation of generally useful Hoon gates (functions). You've seen these already: in expressions like `(add 11 11)`, `add` is a function from the standard library.
322+The Hoon standard library is a compilation of generally useful Hoon gates (functions). You’ve seen these already: in expressions like `(add 11 11)`, `add` is a function from the standard library.
323323
324−It's important to know about standard library functions, because they make certain tasks much easier, and spare you from having to write the code itself. If you did not use the `add` library function, for example, you would have to write out code like this every time you wanted to find the sum of two numbers:
324+It’s important to know about standard library functions, because they make certain tasks much easier, and spare you from having to write the code itself. If you did not use the `add` library function, for example, you would have to write out code like this every time you wanted to find the sum of two numbers:
325325
326326```hoon
327327++ add
@@ -336,12 +336,12 @@ Standard library functions are often built with other standard library functions
336336
337337## Reference Materials
338338
339−The Hoon syntax can be intimidating for the uninitiated, so it's good to remember where you can look up expressions. The [reference section](@/docs/reference/_index.md) itself is a good place to find the reference materials that you need. These children sections are likely to be useful:
339+The Hoon syntax can be intimidating for the uninitiated, so it’s good to remember where you can look up expressions. The [Reference](@/docs/reference/_index.md) section itself is a good place to find the materials that you need. These children sections are likely to be useful:
340340
341341- The [Runes](@/docs/reference/hoon-expressions/rune/_index.md) page will show you how to use any Hoon rune.
342−- The [Cheat sheet](@/docs/reference/cheat-sheet.md) is a more compact place to look up rune expressions.
343−- The [Standard library](@/docs/reference/library/table-of-contents.md) section has its sub-pages arranged by category. So arithmetic functions, for example, are all found on the same page.
344−- The [Hoon Style Guide](@/docs/tutorials/hoon/style.md) will show you how to write your Hoon code so that it's idiomatic and easily understood by others.
342+- The [Cheat Sheet](@/docs/reference/cheat-sheet.md) is a more compact place to look up rune expressions.
343+- The [Standard Library](@/docs/reference/library/table-of-contents.md) section has its sub-pages arranged by category. So arithmetic functions, for example, are all found on the same page.
344+- The [Hoon Style Guide](@/docs/tutorials/hoon/style.md) will show you how to write your Hoon code so that it’s idiomatic and easily understood by others.
345345
346346### Debugging
347347
@@ -349,8 +349,8 @@ When you have an error in your Hoon code, one of two things can happen. Either t
349349
350350There are a couple useful runes associated with debugging:
351351
352−`!:` (zapcol), if written at the top of a Hoon file, turns on a full debugging stack-trace. It's good practice to use whenever you're learning.
352+`!:` (zapcol), if written at the top of a Hoon file, turns on a full debugging stack-trace. It’s good practice to use whenever you’re learning.
353353
354354`~&` (sigpam) is used to print its argument every time that argument executes. So, if you wanted to see how many times your program executed `foo`, you would write `foo bar`. Then, when your program runs, it will print `foo` on a new line of output every time the program comes across it by recursion.
355355
356−But there are more. Check out the aforementioned [troubleshooting](@/docs/tutorials/hoon-errors.md) page to see other handy debugging runes and how to use them.
356+But there are more. Check out the aforementioned [Troubleshooting](@/docs/tutorials/hoon-errors.md) page to see other handy debugging runes and how to use them.
tutorials/hoon/libraries.md+4−4
@@ -103,9 +103,9 @@ The `?+` rune is the rune to switch against a value with a default. The default
103103 |-
104104 ?: (gth i 4)
105105 mydeck
106− =/ j 1
106+ =/ j 2
107107 |-
108− ?. (lte j 13)
108+ ?. (lte j 14)
109109 ^$(i +(i))
110110 %= $
111111 j +(j)
@@ -153,9 +153,9 @@ Next, with `=/ random ~(. og entropy)`, we feed the `og` core the entropy it n
153153
154154`?: =(remaining 1)` checks if have only one card remaining. If that's true, we produce a cell of `shuffled` and the one card left in `unshuffled`. We use the `:_` rune here, so that the "heavier" hoon is at the bottom of the expression.
155155
156−If the above conditional evaluates to false, we are going to do a little work. `=^` is a rune that pins the head of a pair and changes the leg with a tail. It's useful for interacting with the `og` core arms, as many of them produce a pair of a random numbers and the next state of the core. We're going to put the random number in the subject with the face `index` and change `random` to be the next core.
156+If the above conditional evaluates to false, we are going to do a little work. `=^` is a rune that pins the head of a pair and changes a leg in the subject with the tail. It's useful for interacting with the `og` core arms, as many of them produce a pair of a random numbers and the next state of the core. We're going to put the random number in the subject with the face `index` and change `random` to be the next core.
157157
158−With completed, we use `%^` to call `$` to recurse back up to `|-` with a few changes.
158+With completed, we use `%=` to call `$` to recurse back up to `|-` with a few changes.
159159
160160`shuffled` gets the `darc` from `unshuffled` at `index` added to the front of it.
161161
tutorials/hoon/list-of-numbers.md+11−11
@@ -20,11 +20,11 @@ Below is a simple Hoon program that takes a single number `n` from the user as i
2020$(count (add 1 count)) :: 8
2121```
2222
23−As we mentioned in the previous lesson, the easiest way to use such a program is to run it as a _generator_. Mount your desk `|mount %` (if you didn't do it before), saving a file in the `/home/gen` directory of your ship and commiting these changes `|commit %home` allows you to run it from your ship's Dojo (command line) as a generator. Save the above code there as `list.hoon`. Now you can run it in the Dojo as so:
23+As we mentioned in the previous lesson, the easiest way to use such a program is to run it as a _generator_. Mount your desk `|mount %` (if you didn't do it before), saving a file in the `/home/gen` directory of your ship and commiting these changes `|commit %home` allows you to run it from your ship's Dojo (command line) as a generator. Save the above code there as `list.hoon`. Now you can run it in the Dojo with the command below (remember, without the `>`):
2424
25−`~your-ship:> +list 5`
25+`> +list 5`
2626
27−Try it! You can choose any natural number to put after `+list`, but it can't be zero or blank. The `+` lets the Dojo know that it's looking for a generator with the name that follows. You don't write out the `.hoon` part of the file name when running it in the Dojo.
27+Try it! You can choose any natural number to put after `+list`, but it can't be `0` or blank. The `+` lets the Dojo know that it's looking for a generator with the name that follows. You don't write out the `.hoon` part of the file name when running it in the Dojo.
2828
2929But what do all these squiggly symbols in the program _do_? It probably isn't immediately clear. Let's go through each component of this code.
3030
@@ -42,7 +42,7 @@ In our example program, we use comments with line numbers for convenient referen
4242
4343There's a few things going on in our first line. The first part of it, `|=`, is a kind of **rune**. Runes are the building blocks of all Hoon code, represented as a pair of non-alphanumeric ASCII characters. Runes form expressions; runes are used how keywords are used in other languages. In other words, all computations in Hoon ultimately require runes. Runes and other Hoon expressions are all separated from one another by either two spaces or a line break.
4444
45−All runes take a fixed number of "children." Children can themselves be runes with children, and Hoon programs work by chaining through these until a value -- not another rune -- is arrived at. For this reason, we very rarely need to close expressions. Keep this scheme in mind when examining Hoon code.
45+All runes take a fixed number of "children". Children can themselves be runes with children, and Hoon programs work by chaining through these until a value -- not another rune -- is arrived at. For this reason, we very rarely need to close expressions. Keep this scheme in mind when examining Hoon code.
4646
4747The specific purpose of the `|=` rune is to create a **gate**. A [gate](/docs/glossary/gate/) is what would be called a function in other languages: it takes an input, performs a specified computation, and then produces an output.
4848
@@ -58,7 +58,7 @@ Our program is simple, so the _entire program_ is the gate that's being created
5858
5959This line begins with the `=/` rune, which stores a value with a name and specifies its type. It takes three children.
6060
61−`count=@` (the first child) stores `1` (the second child) as `count` and as specifies that has the `@` type.
61+`count=@` (the first child) stores `1` (the second child) as `count` and specifies that it has the `@` type.
6262
6363We're using `count` to keep track of what numbers we're including in the list we're building. We'll use it later in the program.
6464
@@ -87,11 +87,11 @@ In this case, the rune specifies that our gate's output must be `(list @)` -- th
8787 ~
8888```
8989
90−`?:` is a rune that evaluates whether its first child is true or false. If that child is true, the program branches to the second child. If it's false, it branches to the third child. `?:` takes three children.
90+`?:` is a rune that evaluates whether its first child is `true` or `false`. If that child is `true`, the program branches to the second child. If it's `false`, it branches to the third child. `?:` takes three children.
9191
92−`=(end count)` checks if the user's input equals to the `count` value that we're incrementing to build the list. If these values are equal, we want to end the program, because our list has been built out to where it needs to be. Note that this expression is, in fact, a rune expression, just written a different way than you've seen so far. `=(end count)` is an _irregular form_ of `.= end count`, different in looks but identical in operation. `.=` is a rune that checks for the equality of its two children, and produces a "true" or "false" based on what it finds.
92+`=(end count)` checks if the user's input equals to the `count` value that we're incrementing to build the list. If these values are equal, we want to end the program, because our list has been built out to where it needs to be. Note that this expression is, in fact, a rune expression, just written a different way than you've seen so far. `=(end count)` is an _irregular form_ of `.= end count`, different in looks but identical in operation. `.=` is a rune that checks for the equality of its two children, and produces a `true` or `false` based on what it finds.
9393
94−`~` simply represents the "null" value. The program branches here if on line 5 it finds that `end` equals `count`. Lists in Hoon always end with `~`, so we need this to be the last thing we put in our list.
94+`~` simply represents the `null` value. The program branches here if on line 5 it finds that `end` equals `count`. Lists in Hoon always end with `~`, so we need this to be the last thing we put in our list.
9595
9696## Line 7
9797
@@ -105,15 +105,15 @@ In our case, `:- count` creates a cell out of whatever value is stored in `coun
105105$(count (add 1 count))
106106```
107107
108−The above code is, once again, a compact way of writing a rune expression. All you need to know is that this line of code restarts the program at `|-`, except with the value stored in `count` incremented by 1. The construction of `(count (add 1 count))` tells the computer, "replace the value of count with count+1".
108+The above code is, once again, a compact way of writing a rune expression. All you need to know is that this line of code restarts the program at `|-`, except with the value stored in `count` incremented by `1`. The construction of `(count (add 1 count))` tells the computer, "replace the value of `count` with `count+1`".
109109
110−You'll notice that we use an unfamiliar word here: `add`. Unlike `count` and `end`, `add` is not defined anywhere in our program. That's because it's a gate that's predefined in the Hoon **standard library**. The standard library is filled with pre-defined gates that are generally useful, and these gates can be used just like something that you defined in your own program. You can see this gate, and other mathematical operators, in [section 1a](@/docs/reference/library/1a.md) of the standard-library documentation.
110+You'll notice that we use an unfamiliar word here: `add`. Unlike `count` and `end`, `add` is not defined anywhere in our program. That's because it's a gate that's predefined in the Hoon **standard library**. The standard library is filled with pre-defined gates that are generally useful, and these gates can be used just like something that you defined in your own program. You can see this gate, and other mathematical operators, in [section 1a](@/docs/reference/library/1a.md) of the standard library documentation.
111111
112112## Explanation
113113
114114If you aren't clear on how the program is building the list, that's okay.
115115
116−Our program works by having each iteration of the list creating a cell. In each of these cells, the head -- the cell's first position -- is filled with the current-iteration value of `count`. The tail of the cell, its second position, is filled with _the product of a new iteration of our code_ that starts at `|-`. This iteration will itself create another cell, the head of which will be filled by the incremented value of `count`, and the tail of which will start another iteration. This process continues until `?:` branches to `~` (null). When that happens, the list is terminated and the program doesn't have anything else to do, so it ends. So, a built-out list of nested cells can be visualized like this:
116+Our program works by having each iteration of the list creating a cell. In each of these cells, the head -- the cell's first position -- is filled with the current-iteration value of `count`. The tail of the cell, its second position, is filled with _the product of a new iteration of our code_ that starts at `|-`. This iteration will itself create another cell, the head of which will be filled by the incremented value of `count`, and the tail of which will start another iteration. This process continues until `?:` branches to `~` (`null`). When that happens, the list is terminated and the program doesn't have anything else to do, so it ends. So, a built-out list of nested cells can be visualized like this:
117117
118118```
119119 [1 [2 [3 [4 ~]]]]
tutorials/hoon/lists.md+51−34
@@ -5,11 +5,9 @@ template = "doc.html"
55aliases = ["/docs/learn/hoon/hoon-tutorial/lists/"]
66+++
77
8−# Lists
9−
108A **list** is a type of [noun](/docs/glossary/noun/) that you'll frequently encounter when reading and writing Hoon. A list can be thought of as an ordered arrangement of zero or more elements terminated by a `~` (null).
119
12−So a list can be either null or non-null. When the list contains only `~` and no items, it's the null list. Most lists are, however, non-null lists, which have items preceding the `~`. Non-null lists, called _lests_, are cells in which the head is the first list item, and the tail is the rest of the list. The tail is itself a list, and if such a list is also non-null, the head of this sub-list is the second item in the greater list, and so on. To illustrate, let's look at a list `[1 2 3 4 ~]` with the cell-delineating brackets left in:
10+So a list can be either null or non-null. When the list contains only `~` and no items, it's the null list. Most lists are, however, non-null lists, which have items preceding the `~`. Non-null lists, called _lests_, are cells in which the head is the first list item, and the tail is the rest of the list. The tail is itself a list, and if such a list is also non-null, the head of this sublist is the second item in the greater list, and so on. To illustrate, let's look at a list `[1 2 3 4 ~]` with the cell-delineating brackets left in:
1311
1412`[1 [2 [3 [4 ~]]]]`
1513
@@ -44,7 +42,7 @@ Let's make a list whose items are of the `@t` string type:
4442<|Urbit will rescue the internet|>
4543```
4644
47−The head of a list has the face `i` and the tail has the face `t`. (For the sake of neatness, these faces aren't shown by the Hoon pretty printer.) To use the `i` and `t` faces of a list, you must first prove that the list is non-null by using the conditional family of runes, `?`:
45+The head of a list has the face `i` and the tail has the face `t`. (For the sake of neatness, these faces aren't shown by the Hoon pretty printer.) To use the `i` and `t` faces of a list, you must first prove that the list is non-null by using the conditional family of runes, `?`:
4846
4947```
5048> =>(b=`(list @)`[1 2 3 4 5 ~] i.b)
@@ -58,15 +56,15 @@ find-fork-d
5856~[2 3 4 5]
5957```
6058
61−It's important to note that performing tests like `?~ mylist` will actually transform `mylist` into a `lest`, a non-null list. Because `lest` is a different type than `list`, performing such tests can come back to bite you later in non-obvious ways when you try to use some standard library functions meant for `list`s.
59+It's important to note that performing tests like `?~ mylist` will actually transform `mylist` into a `lest`, a non-null list. Because `lest` is a different type than `list`, performing such tests can come back to bite you later in non-obvious ways when you try to use some standard library functions meant for lists.
6260
63−You can construct lists of any type. `(list @)` indicates a list of atoms, `(list ^)` indicates a list of cells, `(list [@ ?])` indicates a list of cells whose head is an atom and whose tail is a flag, etc.
61+You can construct lists of any type. `(list @)` indicates a list of atoms, `(list ^)` indicates a list of cells, `(list [@ ?])` indicates a list of cells whose head is an atom and whose tail is a flag, etc.
6462
6563## Tapes and Cords
6664
67−While a list can be of any type, there are some special types of lists that are built into Hoon. The tape is the most common example.
65+While a list can be of any type, there are some special types of lists that are built into Hoon. The `tape` is the most common example.
6866
69−Hoon has two kinds of strings: cords and tapes. Cords are atoms with aura `@t`, and they're pretty-printed between `''` marks.
67+Hoon has two kinds of strings: cords and tapes. Cords are atoms with aura `@t`, and they're pretty-printed between `''` marks.
7068
7169```
7270> 'this is a cord'
@@ -98,9 +96,9 @@ You can also use the words `cord` and `tape` for casting:
9896
9997## List Functions in the Hoon Standard Library
10098
101−Lists are a commonly used data structure. Accordingly, there are several functions in the [Hoon standard library](/docs/reference/library/) intended to make lists easier to use.
99+Lists are a commonly used data structure. Accordingly, there are several functions in the [Hoon standard library](/docs/reference/library/) intended to make lists easier to use.
102100
103−For a complete list of these functions, check out the standard library reference for lists [here](/docs/reference/library/2b/). Here we'll look at a few of these functions.
101+For a complete list of these functions, check out the standard library reference for lists [here](/docs/reference/library/2b/). Here we'll look at a few of these functions.
104102
105103### `flop`
106104
@@ -119,18 +117,18 @@ The `flop` function takes a list and returns it in reverse order:
119117
120118#### `flop` Exercise 1.5a
121119
122−Without using `flop`, write a [gate](/docs/glossary/gate/) that takes a `(list @)` and returns it in reverse order. There is a solution at the bottom of this lesson.
120+Without using `flop`, write a [gate](/docs/glossary/gate/) that takes a `(list @)` and returns it in reverse order. There is a solution at the bottom of this lesson.
123121
124122### `sort`
125123
126−The `sort` function uses the 'quicksort' algorithm to sort a list. It takes a list to sort and a gate that serves as a comparator. For example, if you want to sort the list `~[37 62 49 921 123]` from least to greatest, you would pass that list along with the `lth` gate (for 'less than'):
124+The `sort` function uses the "quicksort" algorithm to sort a list. It takes a list to sort and a gate that serves as a comparator. For example, if you want to sort the list `~[37 62 49 921 123]` from least to greatest, you would pass that list along with the `lth` gate (for "less than"):
127125
128126```
129127> (sort ~[37 62 49 921 123] lth)
130128~[37 49 62 123 921]
131129```
132130
133−To sort the list from greatest to least, use the `gth` gate ('greater than') as the basis of comparison instead:
131+To sort the list from greatest to least, use the `gth` gate ("greater than") as the basis of comparison instead:
134132
135133```
136134> (sort ~[37 62 49 921 123] gth)
@@ -160,7 +158,7 @@ The `weld` function takes two lists of the same type and concatenates them:
160158
161159#### `weld` Exercise 1.5b
162160
163−Without using `weld`, write a gate that takes a `[(list @) (list @)]` who product is the concatenation of these two lists. There is a solution at the bottom of this lesson.
161+Without using `weld`, write a gate that takes a `[(list @) (list @)]` of which the product is the concatenation of these two lists. There is a solution at the bottom of this lesson.
164162
165163### `snag`
166164
@@ -186,7 +184,7 @@ The `snag` function takes an atom `n` and a list, and returns the `n`th item of
186184'!'
187185```
188186
189−Note: there is currently a type system issue that causes some of these functions to fail when passed a list `b` after some type inference has been performed on `b`. For an illustration of the bug, let's set `b` to be a `(list @)` of `~[11 22 33 44]` in the dojo:
187+Note: there is currently a type system issue that causes some of these functions to fail when passed a list `b` after some type inference has been performed on `b`. For an illustration of the bug, let's set `b` to be a `(list @)` of `~[11 22 33 44]` in the Dojo:
190188
191189```
192190> =b `(list @)`~[11 22 33 44]
@@ -213,7 +211,7 @@ You can cast `b` to `(list)` to work around this:
213211
214212#### `snag` Exercise 1.5c
215213
216−Without using `snag`, write a gate that returns the `n`th item of a list. There is a solution at the bottom of this lesson.
214+Without using `snag`, write a gate that returns the `n`th item of a list. There is a solution at the bottom of this lesson.
217215
218216### `oust`
219217
@@ -251,7 +249,7 @@ Without using `lent`, write a gate that takes a list and returns the number of i
251249
252250### `roll`
253251
254−The `roll` function takes a list and a gate, and accumulates a value of the list items using that gate. For example, if you want to add or multiply all the items in a list of atoms, you would use `roll`:
252+The `roll` function takes a list and a gate, and accumulates a value of the list items using that gate. For example, if you want to add or multiply all the items in a list of atoms, you would use `roll`:
255253
256254```
257255> (roll `(list @)`~[11 22 33 44 55] add)
@@ -263,7 +261,7 @@ The `roll` function takes a list and a gate, and accumulates a value of the list
263261
264262### `turn`
265263
266−The `turn` function takes a list and a gate, and returns a list of the products of applying each item of the input list to the gate. For example, to add `1` to each item in a list of atoms:
264+The `turn` function takes a list and a gate, and returns a list of the products of applying each item of the input list to the gate. For example, to add `1` to each item in a list of atoms:
267265
268266```
269267> (turn `(list @)`~[11 22 33 44] |=(a=@ +(a)))
@@ -279,7 +277,7 @@ Or to double each item in a list of atoms:
279277
280278`turn` is Hoon's version of Haskell's `map`.
281279
282−We can rewrite the Caesar cipher program using `turn`:
280+We can rewrite the [Caesar cipher](https://en.wikipedia.org/wiki/Caesar_cipher) program using `turn`:
283281
284282```hoon
285283|= [a=@ b=tape]
@@ -301,49 +299,60 @@ c
301299
302300## Using `hoon.hoon` to Learn Hoon
303301
304−The Hoon standard library and compiler are written in Hoon. At this point, you know enough Hoon to be able to explore the standard library portions of `hoon.hoon` and find more functions relevant to lists. [Look around in section `2b` (and elsewhere)](/docs/reference/library/2b/)
302+The Hoon standard library and compiler are written in Hoon. At this point, you know enough Hoon to be able to explore the standard library portions of `hoon.hoon` and find more functions relevant to lists. Look around in [section 2b](/docs/reference/library/2b/) (and elsewhere).
305303
306304## Additional Exercises
307305
308306#### Exercise 1.5e
309−Without entering these expressions into the dojo, what are the products of the following expressions?
307+
308+Without entering these expressions into the Dojo, what are the products of the following expressions?
309+
310310```
311311> (lent ~[1 2 3 4 5])
312312```
313+
313314```
314315> (lent ~[~[1 2] ~[1 2 3] ~[2 3 4]])
315316```
317+
316318```
317319> (lent ~[1 2 (weld ~[1 2 3] ~[4 5 6])])
318320```
319321
320322#### Exercise 1.5f
323+
321324First, bind these faces.
325+
322326```
323327> =b ~['moon' 'planet' 'star' 'galaxy']
324328> =c ~[1 2 3]
325329```
326−Then determine whether the following dojo expressions are valid, and if so, what they evaluate to.
330+
331+Then determine whether the following Dojo expressions are valid, and if so, what they evaluate to.
332+
327333```
328334> (weld b b)
329335```
336+
330337```
331338> (weld b c)
332339```
340+
333341```
334342> (lent (weld b c))
335343```
344+
336345```
337346> (add (lent b) (lent c))
338347```
339348
340349#### Exercise 1.5g
341−Write a gate that takes in a list `a` and returns `%.y` if `a` is a palindrome and `%.n` otherwise. You may make use of the `flop` function.
342350
351+Write a gate that takes in a list `a` and returns `%.y` if `a` is a palindrome and `%.n` otherwise. You may make use of the `flop` function.
343352
344353## Exercise Solutions
345354
346−#### `flop` 1.5a
355+#### 1.5a `flop`
347356
348357```hoon
349358:: flop.hoon
@@ -355,14 +364,15 @@ Write a gate that takes in a list `a` and returns `%.y` if `a` is a palindrome a
355364$(b [i.a b], a t.a)
356365```
357366
358−Run in dojo:
367+Run in Dojo:
359368
360369```
361370> +flop ~[11 22 33 44]
362371~[44 33 22 11]
363372```
364373
365−#### `weld` 1.5b
374+#### 1.5b `weld`
375+
366376```hoon
367377:: weld.hoon
368378::
@@ -372,14 +382,14 @@ Run in dojo:
372382[i.a $(a t.a)]
373383```
374384
375−Run in dojo:
385+Run in Dojo:
376386
377387```
378388> +weld [~[1 2 3] ~[3 4 5 6]]
379389~[1 2 3 3 4 5 6]
380390```
381391
382−#### `snag` 1.5c
392+#### 1.5c `snag`
383393
384394```hoon
385395:: snag.hoon
@@ -390,7 +400,7 @@ Run in dojo:
390400$(a (dec a), b t.b)
391401```
392402
393−Run in dojo:
403+Run in Dojo:
394404
395405```
396406> +snag [0 ~[11 22 33 44]]
@@ -400,7 +410,7 @@ Run in dojo:
40041033
401411```
402412
403−#### `lent` 1.5d
413+#### 1.5d `lent`
404414
405415```hoon
406416:: lent.hoon
@@ -413,7 +423,7 @@ Run in dojo:
413423$(a t.a, b +(b))
414424```
415425
416−Run in dojo:
426+Run in Dojo:
417427
418428```
419429> +lent ~[1 2 3 4 5]
@@ -424,7 +434,7 @@ Run in dojo:
424434
425435#### 1.5e
426436
427−Run in dojo:
437+Run in Dojo:
428438
429439```
430440> (lent ~[1 2 3 4 5])
@@ -437,27 +447,34 @@ Run in dojo:
437447
438448#### 1.5f
439449
440−Run in dojo:
450+Run in Dojo:
441451
442452```
443453> (weld b b)
444454<|moon planet star galaxy moon planet star galaxy|>
445455```
456+
446457```
447458> (weld b c)
448459```
460+
449461This will not run because `weld` expects the elements of both lists to be of the same type.
462+
450463```
451464> (lent (weld b c))
452465```
466+
453467This also fails for the same reason, but it is important to note that in some languages that are more lazily evaluated, such an expression would still work since it would only look at the length of `b` and `c` and not worry about what the elements were. In that case, it would return `7`.
468+
454469```
455470> (add (lent b) (lent c))
4564717
457472```
473+
458474We see here the correct way to find the sum of the length of two lists of unknown type.
459475
460476#### 1.5g
477+
461478```hoon
462479:: palindrome.hoon
463480::
@@ -465,7 +482,7 @@ We see here the correct way to find the sum of the length of two lists of unknow
465482=(a (flop a))
466483```
467484
468−Run in dojo:
485+Run in Dojo:
469486
470487```
471488> +palindrome "urbit"
tutorials/hoon/nouns.md+52−45
@@ -5,11 +5,11 @@ template = "doc.html"
55aliases = ["/docs/learn/hoon/hoon-tutorial/nouns/"]
66+++
77
8−In Urbit, every piece of data is a [noun](/docs/glossary/noun/). In order to understand Hoon, one must first understand nouns.
8+In Urbit, every piece of data is a [noun](/docs/glossary/noun/). In order to understand Hoon, one must first understand nouns.
99
1010## Noun Definition
1111
12−A **noun** is either an [atom](/docs/glossary/atom/) or a cell. An **atom** is a natural number ("unsigned integer" in computer lingo) of any size, including zero. A **cell** is an [ordered pair](https://en.wikipedia.org/wiki/Ordered_pair) of nouns, usually indicated with square brackets around the nouns in question; i.e., `[a b]`, where `a` and `b` are nouns.
12+A **noun** is either an [atom](/docs/glossary/atom/) or a cell. An **atom** is a natural number ("unsigned integer" in computer lingo) of any size, including zero. A **cell** is an [ordered pair](https://en.wikipedia.org/wiki/Ordered_pair) of nouns, usually indicated with square brackets around the nouns in question; i.e., `[a b]`, where `a` and `b` are nouns.
1313
1414Here are some atoms:
1515
@@ -28,7 +28,7 @@ All of the above are nouns.
2828
2929### Nouns as Binary Trees
3030
31−A [binary tree](https://en.wikipedia.org/wiki/Binary_tree) has a single base node, and each node of the tree may have up to two child nodes (but it need not have any). A node without children is a 'leaf'. You can think of a noun as a binary tree whose leaves are atoms, i.e., unsigned integers. All non-leaf nodes are cells. To visualize this, consider the following representation of the noun: `[12 [17 45]]`:
31+A [binary tree](https://en.wikipedia.org/wiki/Binary_tree) has a single base node, and each node of the tree may have up to two child nodes (but it need not have any). A node without children is a "leaf". You can think of a noun as a binary tree whose leaves are atoms, i.e., unsigned integers. All non-leaf nodes are cells. To visualize this, consider the following representation of the noun: `[12 [17 45]]`:
3232
3333```
3434[12 [17 45]]
@@ -39,7 +39,7 @@ A [binary tree](https://en.wikipedia.org/wiki/Binary_tree) has a single base nod
3939 17 45
4040```
4141
42−Each number is an atom; each dot is a cell. Let's look at another example, this time of `[[7 13] [87 65]]`, with the cell nodes shown explicitly:
42+Each number is an atom; each dot is a cell. Let's look at another example, this time of `[[7 13] [87 65]]`, with the cell nodes shown explicitly:
4343
4444```
4545 [[7 13] [87 65]]
@@ -55,9 +55,9 @@ An atom is a trivial tree of just one node; e.g., `17`.
5555
5656## Atoms
5757
58−Atoms are unsigned integers. These are often represented by the dojo as unsigned integers in decimal notation, e.g., `17`.
58+Atoms are unsigned integers. These are often represented by the Dojo as unsigned integers in decimal notation, e.g., `17`.
5959
60−To be sure we understand Hoon's atom notation, let's enter some atoms into the dojo:
60+To be sure we understand Hoon's atom notation, let's enter some atoms into the Dojo:
6161
6262```
6363> 3
@@ -84,9 +84,9 @@ Can we add another zero?
8484> 320
8585```
8686
87−It didn't work! When you tried to type that next zero and turn `320` into `3200`, the dojo actually _deleted the `0` and beeped at you_.
87+It didn't work! When you tried to type that next zero and turn `320` into `3200`, the Dojo actually _deleted the `0` and beeped at you_.
8888
89−Isn't an atom an unsigned integer of any size? It is. But the way to represent the four-digit number `3200` is actually `3.200`:
89+Isn't an atom an unsigned integer of any size? It is. But the way to represent the four-digit number `3200` is actually `3.200`:
9090
9191```
9292> 3.200
@@ -98,21 +98,21 @@ Isn't an atom an unsigned integer of any size? It is. But the way to represent
9898
9999Just think of it as "3,200", written the German way with a dot.
100100
101−Why? Long numbers are difficult to read. We know this, so we group digits in threes. For some reason most programming languages don't use this marvelous innovation. Hoon does.
101+Why? Long numbers are difficult to read. We know this, so we group digits in threes. For some reason, most programming languages don't use this marvelous innovation. Hoon does.
102102
103−English notation for decimals is more common than German notation. Unfortunately, dots are URL-safe and commas aren't. For reasons to be discussed in a later lesson, it's nice to have a regular syntax for atoms that's URL-safe.
103+English notation for decimals is more common than German notation. Unfortunately, dots are URL-safe and commas aren't. For reasons to be discussed in a later lesson, it's nice to have a regular syntax for atoms that's URL-safe.
104104
105−As for why the dojo deleted your zero: it parses the command line as you type, and rejects any characters after the parser stops. This prevents you from entering commands or expressions that aren't well-formed.
105+As for why the Dojo deleted your zero: it parses the command line as you type, and rejects any characters after the parser stops. This prevents you from entering commands or expressions that aren't well-formed.
106106
107107### Atom Auras
108108
109−Atoms are nothing more than unsigned integers -- natural numbers -- but it's often useful to represent an atom in a different way. This is done with an **aura**. The aura of an atom is type meta-data used by Hoon to determine how to interpret that atom. It answers the question: What type of information is this atom?
109+Atoms are nothing more than unsigned integers -- natural numbers -- but it's often useful to represent an atom in a different way. This is done with an **aura**. The aura of an atom is type meta-data used by Hoon to determine how to interpret that atom. It answers the question: What type of information is this atom?
110110
111−We use auras because data isn't always represented as a positive decimal number. Sometimes we want to represent data as binary, as text, or as a negative number. Auras allow us to to use such types of data _without changing the underlying atom_.
111+We use auras because data isn't always represented as a positive decimal number. Sometimes we want to represent data as binary, as text, or as a negative number. Auras allow us to use such types of data _without changing the underlying atom_.
112112
113−We won't fully explain auras and their various uses yet. Auras will be covered more comprehensively in a later lesson. For now let's just look at the various kinds of [literal syntax](https://en.wikipedia.org/wiki/Literal_%28computer_programming%29) associated with a few atom auras.
113+We won't fully explain auras and their various uses yet. Auras will be covered more comprehensively in a later lesson. For now let's just look at the various kinds of [literal syntax](https://en.wikipedia.org/wiki/Literal_%28computer_programming%29) associated with a few atom auras.
114114
115−In computer science, a 'literal' is an expression that represents and evaluates to a fixed value. The default syntax of an atom literal is the German-style decimal notation, as seen above. Let's look at some other atom literal syntaxes: unsigned binary, unsigned hexadecimal, signed decimal, signed binary and hexadecimal.
115+In computer science, a "literal" is an expression that represents and evaluates to a fixed value. The default syntax of an atom literal is the German-style decimal notation, as seen above. Let's look at some other atom literal syntaxes: unsigned binary, unsigned hexadecimal, signed decimal, signed binary, and signed hexadecimal.
116116
117117```
118118> 0b1001
@@ -140,7 +140,7 @@ In computer science, a 'literal' is an expression that represents and evaluates
140140-0x9d
141141```
142142
143−All of the above are atoms. The underlying noun of each is just an unsigned integer, but each is written in a special syntax indicating to Hoon that the atom is to be represented in a different way. To see their values in the default atom notation, you can tell Hoon to throw away the aura information. Do this by preceding each expression above with `` `@` ``.
143+All of the above are atoms. The underlying noun of each is just an unsigned integer, but each is written in a special syntax indicating to Hoon that the atom is to be represented in a different way. To see their values in the default atom notation, you can tell Hoon to throw away the aura information. Do this by preceding each expression above with `` `@` ``.
144144
145145```
146146> `@`0b1001
@@ -168,7 +168,7 @@ All of the above are atoms. The underlying noun of each is just an unsigned int
168168313
169169```
170170
171−The `` `@` `` syntax is used to 'cast' a value to a raw atom, i.e., an atom without an aura. Don't worry about exactly what `` `@` `` means just yet. Casts will be explained in more detail in a later lesson. For now all you need to know is that a cast doesn't change the underlying value of the noun; it's used here only to change how the value is printed in the dojo output.
171+The `` `@` `` syntax is used to "cast" a value to a raw atom, i.e., an atom without an aura. Don't worry about exactly what `` `@` `` means just yet. Casts will be explained in more detail in a later lesson. For now all you need to know is that a cast doesn't change the underlying value of the noun; it's used here only to change how the value is printed in the Dojo output.
172172
173173#### Identities, Cords, and Terms
174174
@@ -194,7 +194,7 @@ Urbit identities such as `~zod` and `~sorreg-namtyv` are also atoms, but of the
194194~sorreg-namtyv
195195```
196196
197−Hoon permits the use of atoms as strings. Strings that are encoded as atoms are called **cords**. Cords are of the aura `@t`. The literal syntax of a cord is text inside a pair of single-quotes, e.g., `'Hello world!'`.
197+Hoon permits the use of atoms as strings. Strings that are encoded as atoms are called **cords**. Cords are of the aura `@t`. The literal syntax of a cord is text inside a pair of single-quotes, e.g., `'Hello world!'`.
198198
199199```
200200> 'Howdy!'
@@ -210,7 +210,7 @@ Hoon permits the use of atoms as strings. Strings that are encoded as atoms are
21021010.334.410.032.606.748.633.331.426.632
211211```
212212
213−Hoon also has **terms**, of the aura `@tas`. Terms are constant values that are used to tag data using the type system. These are strings preceded with a `%` and made up of lower-case letters, numbers, and hyphens, i.e., 'kebab case'. The first character after the `%` must be a letter. For example, `%a`, `%hello`, `%this-is-kebab-case123`.
213+Hoon also has **terms**, of the aura `@tas`. Terms are constant values that are used to tag data using the type system. These are strings preceded with a `%` and made up of lowercase letters, numbers, and hyphens, i.e., "kebab case". The first character after the `%` must be a letter. For example, `%a`, `%hello`, `%this-is-kebab-case123`.
214214
215215```
216216> %howdy
@@ -281,20 +281,20 @@ You can force Hoon to interpret an atom differently by using the aura symbols in
2812810x9d
282282```
283283
284−The atoms in the examples above are all exactly the same value. Only they're interpreted and printed differently, depending on the aura.
284+The atoms in the examples above are all exactly the same value. Only they're interpreted and printed differently, depending on the aura.
285285
286286You'll learn more about atoms and auras in [Lesson 2.1](@docs/tutorials/hoon/atoms-auras-and-simple-cell-types.md).
287287
288288## Cells
289289
290−There's not much mystery about cells. The left of a cell is called the **head**, and the right is called the **tail**. Cells are typically represented in Hoon with square brackets around a pair of nouns.
290+There's not much mystery about cells. The left of a cell is called the **head**, and the right is called the **tail**. Cells are typically represented in Hoon with square brackets around a pair of nouns.
291291
292292```
293293> [32 320]
294294[32 320]
295295```
296296
297−In this cell `32` is the head and `320` is the tail. Cells can contain cells, and atoms of other auras as well:
297+In this cell `32` is the head and `320` is the tail. Cells can contain cells, and atoms of other auras as well:
298298
299299```
300300> [%hello 'world!']
@@ -304,7 +304,7 @@ In this cell `32` is the head and `320` is the tail. Cells can contain cells, a
304304[[%in 0xa] 'cell']
305305```
306306
307−I said there isn't _much_ mystery about cells, but there is a little. So far whenever we've entered a cell into the dojo, it not only returned the same cell; the cell was printed in the same way it was entered. This doesn't always happen. The dojo is obligated to evaluate the input and return the correct answer, but it doesn't have to show the result in exactly the same way:
307+I said there isn't _much_ mystery about cells, but there is a little. So far whenever we've entered a cell into the Dojo, it not only returned the same cell; the cell was printed in the same way it was entered. This doesn't always happen. The Dojo is obligated to evaluate the input and return the correct answer, but it doesn't have to show the result in exactly the same way:
308308
309309```
310310> [6 [62 620]]
@@ -317,11 +317,11 @@ I said there isn't _much_ mystery about cells, but there is a little. So far wh
317317[[6 62] 620]
318318```
319319
320−In the first example, the inner pair of square brackets is dropped. Why did this happen? Why is `[6 62 620]` accepted as a cell despite apparently having more than two atoms in it?
320+In the first example, the inner pair of square brackets is dropped. Why did this happen? Why is `[6 62 620]` accepted as a cell despite apparently having more than two atoms in it?
321321
322−In fact, `[6 [62 620]]` and `[6 62 620]` are considered equivalent in Hoon. A cell _must_ be a pair, which means there are always exactly two nouns in it. Whenever cell brackets are omitted so that visually there appears to be more than two child nouns, it is implicitly understood that the right-most nouns constitute a cell. That is, the tail of the whole cell is assumed to be a cell of the right-most nouns.
322+In fact, `[6 [62 620]]` and `[6 62 620]` are considered equivalent in Hoon. A cell _must_ be a pair, which means there are always exactly two nouns in it. Whenever cell brackets are omitted so that visually there appears to be more than two child nouns, it is implicitly understood that the right-most nouns constitute a cell. That is, the tail of the whole cell is assumed to be a cell of the right-most nouns.
323323
324−This is why `[6 [62 620]]` and `[6 62 620]` are equivalent. `[6 [62 620]]` and `[[6 62] 620]`, on the other hand, are not equivalent. If you look at them as binary trees you can see the difference:
324+This is why `[6 [62 620]]` and `[6 62 620]` are equivalent. `[6 [62 620]]` and `[[6 62] 620]`, on the other hand, are not equivalent. If you look at them as binary trees you can see the difference:
325325
326326```
327327 [6 [62 620]] [[6 62] 620]
@@ -332,7 +332,7 @@ This is why `[6 [62 620]]` and `[6 62 620]` are equivalent. `[6 [62 620]]` and
332332 62 620 6 62
333333```
334334
335−When the dojo pretty-prints a cell it always removes superfluous cell brackets:
335+When the Dojo pretty-prints a cell it always removes superfluous cell brackets:
336336
337337```
338338> [[12 13] [[14 15] [16 17]]]
@@ -343,7 +343,7 @@ However, you should always remember that though cells can be presented as lists
343343
344344### Exercise 1.2a
345345
346−Without using the dojo, assess whether each of the following pairs of nouns is equivalent. (Answers are at the bottom of the page.)
346+Without using the Dojo, assess whether each of the following pairs of nouns is equivalent. (Answers are at the bottom of the page.)
347347
348348```
3493491. [[1 3] [6 2]] [1 3 [6 2]]
@@ -355,15 +355,15 @@ Without using the dojo, assess whether each of the following pairs of nouns is e
355355
356356## Noun Addresses
357357
358−Nouns have a regular structure that can be exploited to give a unique **address** to each of its 'sub-nouns'. A sub-noun is a part of a noun that is itself a noun; e.g., `[6 2]` is a sub-noun of `[[1 3] [6 2]]`. We can also call these 'noun fragments'.
358+Nouns have a regular structure that can be exploited to give a unique **address** to each of its "sub-nouns". A sub-noun is a part of a noun that is itself a noun; e.g., `[6 2]` is a sub-noun of `[[1 3] [6 2]]`. We can also call these "noun fragments".
359359
360−What if you want to refer to a noun fragment, and not the whole thing? For example, what if you want to refer to the `[6 2]` part of `[[1 3] [6 2]]`? One way is to use the unique address of that noun fragment.
360+What if you want to refer to a noun fragment, and not the whole thing? For example, what if you want to refer to the `[6 2]` part of `[[1 3] [6 2]]`? One way is to use the unique address of that noun fragment.
361361
362−To define noun addresses we'll use recursion. The base case is trivial: address `1` of a noun is the entire noun. The generating case: if the noun at address `n` is a cell, then its head is at address `2n` and its tail is at address `2n + 1`. For example, if address `5` of some noun is a cell, then its head is at address `10` and its tail address `11`.
362+To define noun addresses we'll use recursion. The base case is trivial: address `1` of a noun is the entire noun. The generating case: if the noun at address `n` is a cell, then its head is at address `2n` and its tail is at address `2n + 1`. For example, if address `5` of some noun is a cell, then its head is at address `10` and its tail address `11`.
363363
364−Address 1 of the noun `[[1 3] [6 2]]` is the whole noun: `[[1 3] [6 2]]`. The head of the noun at address `1`, `[1 3]`, is at address `2 x 1`, i.e., `2`. The tail of the noun at address `1`, `[6 2]`, is at address `(2 x 1) + 1`, i.e., `3`.
364+Address 1 of the noun `[[1 3] [6 2]]` is the whole noun: `[[1 3] [6 2]]`. The head of the noun at address `1`, `[1 3]`, is at address `2 x 1`, i.e., `2`. The tail of the noun at address `1`, `[6 2]`, is at address `(2 x 1) + 1`, i.e., `3`.
365365
366−If the way this works isn't immediately clear, remember that each noun can be understood as a binary tree. The following diagram shows the address of several nodes of the tree:
366+If the way this works isn't immediately clear, remember that each noun can be understood as a binary tree. The following diagram shows the address of several nodes of the tree:
367367
368368```
369369 1
@@ -375,7 +375,7 @@ If the way this works isn't immediately clear, remember that each noun can be un
375375 14 15
376376```
377377
378−Let's do some examples in the dojo. We're going to use the `slot` operator, `+`, to return fragments of a noun. For any unsigned integer `n`, `+n` evaluates to the fragment at address `n`.
378+Let's do some examples in the Dojo. We're going to use the `slot` operator, `+`, to return fragments of a noun. For any unsigned integer `n`, `+n` evaluates to the fragment at address `n`.
379379
380380```
381381> +1:[22 [33 44]]
@@ -394,7 +394,7 @@ Let's do some examples in the dojo. We're going to use the `slot` operator, `+`
39439444
395395```
396396
397−You'll notice that we use the `:` symbol between the slot syntax and the noun. Don't worry about what this means yet; we'll explain it in another lesson. For now you can read it as the word "of": `+7:[22 [33 44]]` is "slot `7` of `[22 [33 44]]`".
397+You'll notice that we use the `:` symbol between the slot syntax and the noun. Don't worry about what this means yet; we'll explain it in another lesson. For now you can read it as the word "of": `+7:[22 [33 44]]` is "slot `7` of `[22 [33 44]]`".
398398
399399What happens if you ask for a fragment that doesn't exist?
400400
@@ -422,7 +422,8 @@ Let's do a few more examples:
422422%six
423423```
424424
425−For those who prefer to think in terms of binary numbers and binary trees, there is another (equivalent) way to understand noun addressing. When the noun address is expressed as a binary number, you can think of the the number as indicating a tree path from the top node.
425+For those who prefer to think in terms of binary numbers and binary trees, there is another (equivalent) way to understand noun addressing. When the noun address is expressed as a binary number, you can think of the number as indicating a tree path from the top node.
426+
426427
427428As before, the root of the binary tree (i.e., the whole noun) is at address `1`. For the node of a tree at any address `b`, where `b` is a binary number, you get the address of its head by concatenating a `0` to the end of `b`; and to get its tail, concatenate a `1` to the end. For example, the head of the node at binary address `111` is at `1110`, and the tail is at `1111`.
428429
@@ -430,7 +431,7 @@ Address `1110` indicates "the head of the tail of the tail of the noun".
430431
431432### Exercise 1.2b
432433
433−Without using the dojo, evaluate the following expressions. (Answers are at the bottom of the page.)
434+Without using the Dojo, evaluate the following expressions. (Answers are at the bottom of the page.)
434435
435436```
4364371. +6:[[34 54] [86 48]]
@@ -442,7 +443,7 @@ Without using the dojo, evaluate the following expressions. (Answers are at the
442443
443444### Exercise 1.2c
444445
445−Without using the dojo, for each fragment below provide the address relative to the noun `[51 52 53 54 55]`. (Answers are at the bottom of the page.)
446+Without using the Dojo, for each fragment below provide the address relative to the noun `[51 52 53 54 55]`. (Answers are at the bottom of the page.)
446447
447448```
4484491. 51
@@ -452,11 +453,11 @@ Without using the dojo, for each fragment below provide the address relative to
4524535. 55
453454```
454455
455−That's it for our basic introduction to nouns. Hit `ctrl-d` to exit your ship, or else move on to the next lesson.
456+That's it for our basic introduction to nouns. Hit `ctrl-d` to exit your ship, or else move on to the next lesson.
456457
457458### Exercise 1.2d
458459
459−Draw out a binary tree diagram for each of the following nouns. Try to do this without using the dojo to simplify the expressions.
460+Draw out a binary tree diagram for each of the following nouns. Try to do this without using the Dojo to simplify the expressions.
460461
461462```
4624631. [[2 3] 4 [5 6 7]]
@@ -508,12 +509,15 @@ Write the following binary tree as a noun.
508509
509510### 1.2d
510511
511−1. Dojo simplifies the expression
512+1. Dojo simplifies the expression ...
513+
512514```
513515> [[2 3] 4 [5 6 7]]
514516[[2 3] 4 5 6 7]
515517```
516−which has the following tree:
518+
519+... which has the following tree:
520+
517521```
518522 .
519523 / \
@@ -527,13 +531,15 @@ which has the following tree:
527531 6 7
528532```
529533
530−2. Dojo simplifies the expression
534+2. Dojo simplifies the expression ...
531535
532536```
533537> [[[5 6 7] 8 9] 10 11 [12 13]]
534538[[[5 6 7] 8 9] 10 11 12 13]
535539```
536−which has the following tree:
540+
541+... which has the following tree:
542+
537543```
538544 .
539545 /\
@@ -551,6 +557,7 @@ which has the following tree:
551557```
552558
553559### 1.2e
560+
554561```
555562[[[1 2] 3] 4 [5 6] 7]
556−```
563+```
tutorials/hoon/recursion.md+7−7
@@ -8,7 +8,7 @@ aliases = ["/docs/learn/hoon/hoon-tutorial/recursion/"]
88[Recursion](.) is a common pattern for solving certain problems in most programming
99languages, and Hoon is no exception. One of the classically recursive problems
1010is that of factorial. The factorial of _n_ is the product of all positive
11−integers less than or equal to N. Thus the factorial of 5, denoted as _5!_,
11+integers less than or equal to _n_. Thus the factorial of 5, denoted as _5!_,
1212would be:
1313
1414```
@@ -41,7 +41,7 @@ by the recursion of `n` minus `1`. `$` initiates recursion: it calls the [gate](
4141that we're already in, but replaces its sample.
4242
4343In our example, we multiply `n` with the product of this _entire gate
44−all over again_ with `$(n (dec n))`, except when that new gate has its sample
44+all over again_ with `$(n (dec n))`, except when that new gate has its sample
4545decremented by one. This works recursively because each new gate will, of
4646course, itself contain the code to call a further-decremented gate. Gates will
4747continue to call new, further-decremented gates until `n` is `1`, and that `1`
@@ -80,7 +80,7 @@ into the `mul` functions behind them.
8080
8181#### Tail-Call Optimization
8282
83−Our last example isn't a very efficient use computing resources. The
83+Our last example isn't a very efficient use of computing resources. The
8484pyramid-shaped illustration approximates what's happening on the **call stack**, a
8585memory structure that tracks the instructions of the program. In our example
8686code, every time a parent gate calls another gate, the gate being called is
@@ -111,7 +111,7 @@ function every time.
111111To reiterate: if you have to manipulate the result of a recursion as the last
112112expression of your gate, as we did in our example, the function is not
113113tail-recursive, and therefore not very efficient with memory. A problem arises
114−when we try to recurse more times that we have space on the stack. This will
114+when we try to recurse more times than we have space on the stack. This will
115115result in our computation failing and producing a stack overflow. If we tried
116116to find the factorial of `5.000.000`, for example, we would almost certainly
117117run out of stack space.
@@ -141,8 +141,8 @@ takes one argument `n`. This time, however, we are also putting a face on a
141141gate with one [arm](/docs/glossary/arm/) `$` and immediately call it. Think of `|-` as the recursion
142142point.
143143
144−We then evaluate `n` to see if it is 1. If it is we return the value of `t`. In
145−the case that `n` is anything other than 1, we perform our recursion:
144+We then evaluate `n` to see if it is 1. If it is, we return the value of `t`.
145+In case that `n` is anything other than 1, we perform our recursion:
146146
147147```hoon
148148$(n (dec n), t (mul t n))
@@ -153,7 +153,7 @@ and `t`. `t` is used as an accumulator variable that we use to keep a running
153153total for the factorial computation.
154154
155155Let's use pseudo-Hoon to illustrate how the stack is working in this example for
156−factorial 5.
156+the factorial of 5.
157157
158158```
159159(factorial 5)
tutorials/hoon/setup.md+9−11
@@ -9,20 +9,19 @@ Before we begin working on Hoon, you should first (1) have Urbit installed and (
99
1010## What is an urbit?
1111
12−An **urbit** is an Urbit virtual computer with persistent state that can connect to the Urbit network. (Note the lowercase 'u' here. 'Urbit' is the entire software stack, whereas 'an urbit' is a local instance.) Each urbit is associated with a unique number that plays three distinct roles: (1) it's an address on the Urbit network, (2) it's a cryptographic identity, and (3) it's (in principle) a human memorable name. Normally an urbit's name is represented as a string starting with `~`, as in `~zod` or `~taglux-nidsep`.
12+An **urbit** is an Urbit virtual computer with persistent state that can connect to the Urbit network. (Note the lowercase `u` here. "Urbit" is the entire software stack, whereas "an urbit" is a local instance.) Each urbit is associated with a unique number that plays three distinct roles: (1) it's an address on the Urbit network, (2) it's a cryptographic identity, and (3) it's (in principle) a human memorable name. Normally an urbit's name is represented as a string starting with `~`, as in `~zod` or `~taglux-nidsep`.
1313
14−These may not look like numbers, but they are. Each urbit name is written in a base-256 format, where each 'digit' is a syllable. Imagine your phone number as a pronounceable string which sounds like a name in a foreign language. An ordinary user-level urbit is a 'planet', and it's named by a 32-bit number. The latter is represented as a four-syllable string; e.g., the planet name `~taglux-nidsep` is the number 6,095,360.
14+These may not look like numbers, but they are. Each urbit name is written in a base-256 format, where each "digit" is a syllable. Imagine your phone number as a pronounceable string which sounds like a name in a foreign language. An ordinary user-level urbit is a "planet", and it's named by a 32-bit number. The latter is represented as a four-syllable string; e.g., the planet name `~taglux-nidsep` is the number 6,095,360.
1515
1616## Installing Urbit
1717
18−You can install Urbit on any Mac or Unix machine; if you're just trying out Urbit or creating a development ship, you can follow the steps for creating a development ship [here](@/using/develop.md#creating-a-development-ship). On Windows, make a virtual Linux machine using VirtualBox or a similar tool.
19−
18+You can install Urbit on any Mac or Unix machine; if you're just trying out Urbit or creating a development ship, you can follow the steps for creating a development ship [here](@/using/develop.md#creating-a-development-ship). On Windows, make a virtual Linux machine using VirtualBox or a similar tool.
2019
2120Once you're finished, you can [boot your very own ship](@/using/install.md#booting-your-ship). While you can develop in Hoon on your own ship on the live network, we strongly suggest developing on a development ship first.
2221
2322## Getting started
2423
25−Once you've created your development ship, let's try a basic command. Type `(add 2 2)` at the prompt and hit return. Your screen now shows:
24+Once you've created your development ship, let's try a basic command. Type `(add 2 2)` at the prompt and hit return. Your screen now shows:
2625
2726```
2827fake: ~zod
@@ -34,7 +33,7 @@ http: live (insecure, loopback) on 12321
3433~zod:dojo>
3534```
3635
37−You just used a function from the Hoon standard library, `add`. Next, quit Urbit with `ctrl-d`:
36+You just used a function from the Hoon standard library, `add`. Next, quit Urbit with `ctrl-d`:
3837
3938```
4039> (add 2 2)
@@ -51,9 +50,9 @@ urbit zod
5150
5251## Another Noun
5352
54−You've already used a standard library function to produce one value, in the dojo. Now that your ship is running again, let's try another. Enter the number `17`.
53+You've already used a standard library function to produce one value, in the Dojo. Now that your ship is running again, let's try another. Enter the number `17`.
5554
56−> We won't show the `~zod:dojo> ` prompt from here on out. We'll just show the echoed command along with its result.
55+> We won't show the `~zod:dojo> ` prompt from here on out. We'll just show the echoed command along with its result.
5756
5857You'll see:
5958
@@ -62,13 +61,13 @@ You'll see:
626117
6362```
6463
65−You asked dojo to evaluate `17` and it echoed the number back at you. This value is a 'noun'. We'll talk more about [nouns](/docs/glossary/noun/) in [Lesson 1.2](@/docs/tutorials/hoon/nouns.md), but first let's write a very basic program.
64+You asked Dojo to evaluate `17` and it echoed the number back at you. This value is a "noun". We'll talk more about [nouns](/docs/glossary/noun/) in [Lesson 1.2](@/docs/tutorials/hoon/nouns.md), but first let's write a very basic program.
6665
6766## Generators
6867
6968Generators are the most straightforward way to write Hoon programs. They are a concept in Arvo, and involve saving Hoon code in a `.hoon` text file. While they aren't strictly part of the Hoon language, we'll be dealing with generators throughout this tutorial.
7069
71−The simplest type of generator is the **naked generator**. All naked generators are `gates`: functions that take an argument and produce an output. Before creating generator you need to mount your `desk` to Unix, for So, to create a generator, all you need to do is write a `gate` and put it into a file in the `/home/gen` directory of your ship as a `.hoon` file. (Assuming you've already mounted with `|mount /=home=`.) After this, you need to run `|commit %home` in dojo and the new file will be recognized by your ship. To run a generator named `mygen.hoon`, you would type `+mygen <argument>` in your ship's Dojo.
70+The simplest type of generator is the **naked generator**. All naked generators are `gates`: functions that take an argument and produce an output. Before creating a generator you need to [mount](https://urbit.org/using/install/#the-dojo) your `desk` to Unix. To create a generator, all you need to do is write a `gate` and put it into a file in the `/home/gen/` directory of your ship as a `.hoon` file. (Assuming you've already mounted with `|mount /=home=`.) After this, you need to run `|commit %home` in Dojo and the new file will be recognized by your ship. To run a generator named `mygen.hoon`, you would type `+mygen <argument>` in your ship's Dojo.
7271
7372If this doesn't make sense yet, that's okay. In the [next lesson](@/docs/tutorials/hoon/list-of-numbers.md), we will walk you through an example `gate` that is run as a generator.
7473
@@ -104,4 +103,3 @@ Emacs is free and open-source and runs on all major operating systems. It is ava
104103#### Vim
105104
106105Vim is free and open-source and runs on all major operating systems. It is available [here](https://www.vim.org/). Hoon support is available with [hoon.vim](https://github.com/urbit/hoon.vim) and is maintained by Tlon.
107−
tutorials/hoon/style.md+76−75
@@ -4,25 +4,26 @@ weight = 100
44template = "doc.html"
55aliases = ["docs/learn/hoon/style/"]
66+++
7−Welcome to the Hoon style guide. It's important to familiarize yourself with our way of writing Hoon code.
7+
8+Welcome to the Hoon style guide. It’s important to familiarize yourself with our way of writing Hoon code.
89
910## Layout
1011
11−Hoon's position on layout is: so long as your code is (a) correctly commented,
12−(b) free from blank or overlong lines, (c) parses, and (d) looks good, it's good
12+Hoon’s position on layout is: so long as your code is (a) correctly commented,
13+(b) free from blank or overlong lines, (c) parses, and (d) looks good, it’s good
1314layout.
1415
1516When a layout standard or other fundamental coding convention is
1617not perfectly rigid, code can develop some individual flavor.
17−But Hoon's layout rules, though not rigid, are still strict. The
18+But Hoon’s layout rules, though not rigid, are still strict. The
1819flavor should never overwhelm the content.
1920
2021### General outline of Hoon syntax
2122
22−There are two forms of syntax in Hoon: wide and tall. Wide forms
23+There are two forms of syntax in Hoon: wide and tall. Wide forms
2324fit on a single line, use single spaces to separate syntax, and
2425generally use enclosing terminators (like parentheses to close an
25−expression). Tall forms can use multiple lines, separate syntax
26+expression). Tall forms can use multiple lines, separate syntax
2627with two spaces at minimum and arbitrary whitespace at maximum,
2728and avoid terminators when the content has a fixed structure.
2829
@@ -41,37 +42,37 @@ or
4142```
4243
4344These are regular forms -- every rune can be written this way.
44−Hoon also has a variety of wide [irregular forms](@/docs/reference/hoon-expressions/irregular.md). All tall
45−forms are regular. All code within a wide form is wide.
45+Hoon also has a variety of wide [irregular forms](@/docs/reference/hoon-expressions/irregular.md). All tall
46+forms are regular. All code within a wide form is wide.
4647Almost all code has both wide and tall forms, the exception
4748being named [cores](/docs/glossary/core/).
4849
4950The goal of wide/tall forms is to resemble the look of
5051procedural code, with its statement/expression distinction,
51−in a purely functional language. In particular, complex code in
52+in a purely functional language. In particular, complex code in
5253functional languages tends to develop a diagonal shape, since
5354child nodes in the syntax tree are indented right.
5455
5556### Tall layout conventions
5657
5758In wide form, the parser allows no freedom of layout (and no
58−comments, either). In tall form, there is too much freedom, and so we need
59−conventions. These conventions aren't absolute, but
60−you shouldn't defy them unless you have a good reason to do so.
59+comments, either). In tall form, there is too much freedom, and so we need
60+conventions. These conventions aren’t absolute, but
61+you shouldn’t defy them unless you have a good reason to do so.
6162
6263Syntactically, there are three kinds of runes: fixed sequences,
63−variable sequences, and cores/engines. Let's talk about each.
64+variable sequences, and cores/engines. Let’s talk about each.
6465
6566#### Fixed sequences and backstep indentation
6667
67−A fixed sequence is a rune with a fixed number of children. Most
68−runes are fixed sequences. In wide mode we terminate a fixed
69−sequence with a right-parenthesis (rit). In tall mode there is
68+A fixed sequence is a rune with a fixed number of children. Most
69+runes are fixed sequences. In wide mode we terminate a fixed
70+sequence with a right-parenthesis (“rit”). In tall mode there is
7071no terminator.
7172
72−With a fixed sequence, we typically use "backstep indentation."
73+With a fixed sequence, we typically use “backstep indentation.”
7374The goal of a backstep is for the largest child node of the rune
74−to end up on the same left margin as the rune itself. This
75+to end up on the same left margin as the rune itself. This
7576design ensures that the body of the code flows down the page, not
7677across the page.
7778
@@ -107,13 +108,13 @@ With four (the maximum rune fanout):
107108```
108109
109110It is sometimes acceptable to not backstep -- especially in tuple
110−runes: `:-,` `:_`, `:+` and `+^`. But you should have a specific reason:
111+runes: `:-,` `:_`, `:+` and `+^`. But you should have a specific reason:
111112for example: emphasizing symmetry in a tuple.
112113
113114#### Variable sequences
114115
115116Variable sequences can have an arbitrary number of elements, so
116−they can't self-terminate. They are terminated by a `==` marker.
117+they can’t self-terminate. They are terminated by a `==` marker.
117118The sequence, or its variable part, is indented and vertical:
118119
119120```hoon
@@ -123,7 +124,7 @@ The sequence, or its variable part, is indented and vertical:
123124 ==
124125```
125126
126−Another representation wastes a line, but saves an indent. Use
127+Another representation wastes a line, but saves an indent. Use
127128this only for very long sequences:
128129
129130```hoon
@@ -135,8 +136,8 @@ this only for very long sequences:
135136```
136137
137138Some variable sequences are sequences of pairs; some of these
138−start with fixed sequences of nodes. Pair sequences are in
139−either "kingside" or "queenside" convention, depending on what
139+start with fixed sequences of nodes. Pair sequences are in
140+either “kingside” or “queenside” convention, depending on what
140141looks better for this particular code.
141142
142143Kingside format:
@@ -172,7 +173,7 @@ It is also usually hard to read without linebreak comments,
172173as demonstrated above.
173174
174175We sometimes end up with multiple terminators on separate lines,
175−two or more spaces apart. These lines can be collapsed:
176+two or more spaces apart. These lines can be collapsed:
176177
177178```hoon
178179 ?+ x default
@@ -191,10 +192,10 @@ Modern Hoon naming is **verbose**.
191192**Never**: abbreviate a label; pack characters (try to reduce the
192193length of labels, or make lengths match up between parallel
193194labels); use intentionally vague and meaningless words; or use
194−nonsense text that isn't a word.
195+nonsense text that isn’t a word.
195196
196−It can't be repeated too often: **do not abbreviate words, unless
197−you would use the same abbreviations in written English**. To
197+It can’t be repeated too often: **do not abbreviate words, unless
198+you would use the same abbreviations in written English**. To
198199save a trivial, one-time amount of work in typing, you are adding
199200a nontrivial amount of work and ambiguity in reading.
200201
@@ -206,16 +207,16 @@ Hoon comments are 8-column lines which contain whitespace, then
206207Blank lines are lines containing no characters, or only whitespace.
207208There must never be blank lines in a Hoon file.
208209
209−Empty lines are lines containing `::` only. There must never be
210+Empty lines are lines containing `::` only. There must never be
210211two empty lines in a row in a Hoon file.
211212
212−Whitespace is semi-significant. The difference between a
213−space and a gap (more than one space) is significant. But two or
213+Whitespace is semi-significant. The difference between a
214+space and a gap (more than one space) is significant. But two or
214215more spaces, newlines, or comments are one gap.
215216
216217#### Comment conventions
217218
218−Hoon suggests "breathing comments." There should always be an
219+Hoon suggests “breathing comments.” There should always be an
219220empty comment line between a comment and the line **below** it:
220221
221222```hoon
@@ -227,7 +228,7 @@ empty comment line between a comment and the line **below** it:
227228 this.is.more.code
228229```
229230
230−Sometimes dense code does need air on both sides. Also
231+Sometimes dense code does need air on both sides. Also
231232legitimate:
232233
233234```hoon
@@ -243,16 +244,16 @@ legitimate:
243244But air on both sides is needed less often than you may think.
244245
245246Crowded comments are comments on lines which also contain code.
246−Older code has a lot of these, especially the "column 56"
247+Older code has a lot of these, especially the “column 56”
247248standard.
248249
249−Crowded comments are considered harmful -- don't use them. Hoon,
250+Crowded comments are considered harmful -- don’t use them. Hoon,
250251like any higher-order functional language, can be very dense and
251−powerful. We almost never want it to be **more** dense.
252+powerful. We almost never want it to be **more** dense.
252253
253254#### Megalithic comments
254255
255−In older code you'll also see attempts to produce large, visually
256+In older code you’ll also see attempts to produce large, visually
256257salient geometries as separators, like:
257258
258259```
@@ -267,8 +268,8 @@ or
267268 ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
268269```
269270
270−Please don't do this in new code. Normal conventions should be
271−legible. Use more deeply qualified positions if your code is
271+Please don’t do this in new code. Normal conventions should be
272+legible. Use more deeply qualified positions if your code is
272273hard to navigate.
273274
274275### Structure of all comments, formal and informal
@@ -285,10 +286,10 @@ development process).
285286All kinds of formal comments have the same structure: simple or
286287complex.
287288
288−A simple formal comment is a one-line headline. A headline is
289+A simple formal comment is a one-line headline. A headline is
289290optional whitespace; then `::`; then two spaces; then a parsed
290291line of **lowercase** ASCII whose syntax depends on the comment
291−type. Like this:
292+type. Like this:
292293
293294```hoon
294295 :: $foo: the definition of a foo
@@ -301,23 +302,23 @@ four spaces, in ASCII mixed case:
301302```hoon
302303 :: $foo: the definition of a foo
303304 ::
304− :: The source of the word "foo" is lost in history. Some
305− :: think it comes from the WWII military term "FUBAR,"
306− :: in which "UBAR" stands for "up beyond all retrieval."
305+ :: The source of the word “foo” is lost in history. Some
306+ :: think it comes from the WWII military term “FUBAR,”
307+ :: in which “UBAR” stands for “up beyond all retrieval.”
307308 ::
308− :: Somehow "FUBAR" became "foobar." The rest is history.
309+ :: Somehow “FUBAR” became “foobar.” The rest is history.
309310 ::
310311```
311312
312313The point is: sometimes we want to see a deep explanation;
313−sometimes we just want a summary. So we require you to either
314+sometimes we just want a summary. So we require you to either
314315(a) provide a line-length explanation, or (b) a long screed
315316but with a line-length summary/headline.
316317
317318### Feature comments
318319
319320A feature headline is `::`, then two spaces, then a qualified
320−location, then `:`, then a freeform string. Like:
321+location, then `:`, then a freeform string. Like:
321322
322323```hoon
323324 :: $foo: a the definition of a foo
@@ -326,8 +327,8 @@ location, then `:`, then a freeform string. Like:
326327```
327328
328329We find the feature `$foo` relative to the current location and
329−move the comment there, as described above. In most cases it
330−becomes a product comment. For a `|chapter` (which does not
330+move the comment there, as described above. In most cases it
331+becomes a product comment. For a `|chapter` (which does not
331332resolve to any data value) it becomes the chapter description.
332333
333334### Product comments
@@ -348,22 +349,22 @@ Flow comments use a new commenting concept called **legends**.
348349#### Legends
349350
350351One of the problems with Hoon as a language is that it takes some
351−time to learn to look at a tree of runes and "see the function."
352−Seeing the function is beautiful and pleasant. But until the new
352+time to learn to look at a tree of runes and “see the function.”
353+Seeing the function is beautiful and pleasant. But until the new
353354Hoon student has put in a lot of practice, this experience is
354−inaccessible. And tracing runes with a manual is hard.
355+inaccessible. And tracing runes with a manual is hard.
355356
356357Canonical flow comments are one way to ease this burden.
357−them, we first need to write descriptive names (not necessarily
358−unique) for every leg of every rune case. Then, we introduce a
358+We first need to write descriptive names (not necessarily
359+unique) for every leg of every rune case. Then, we introduce a
359360narration of the code with these descriptions.
360361
361−For example, let's fix `[%wtcl p=hoon q=hoon r=hoon]`. Let's
362−make it... `[%wtcl if=hoon then=hoon else=hoon]`. Then we
362+For example, let’s fix `[%wtcl p=hoon q=hoon r=hoon]`. Let’s
363+make it … `[%wtcl if=hoon then=hoon else=hoon]`. Then we
363364could write flow comments as follows:
364365
365366```hoon
366− ?: :: if, it's it winter
367+ ?: :: if, it is winter
367368 ::
368369 is-winter
369370 :: then, why not rome?
@@ -377,12 +378,12 @@ could write flow comments as follows:
377378The headline of a flow comment uses a **legend**: the name of
378379this leg in the parent rune, then a message,
379380
380−For someone who doesn't know Hoon, these pseudo-keywords are
381−a lifesaver. For someone who does, they are not too annoying
381+For someone who doesn’t know Hoon, these pseudo-keywords are
382+a lifesaver. For someone who does, they are not too annoying
382383and may still be helpful.
383384
384−Of course, to use this we need to write useful "leg ends" for all
385−appropriate legs of all appropriate runes. But that will
385+Of course, to use this we need to write useful “leg ends” for all
386+appropriate legs of all appropriate runes. But that will
386387probably help us document them, anyway.
387388
388389#### Flow promotion
@@ -391,7 +392,7 @@ Sometimes, just for cosmetic reasons, we like to raise the
391392comment on the first leg of a rune up above the parent:
392393
393394```hoon
394− :: if, it's it winter
395+ :: if, it is winter
395396 ::
396397 ?: is-winter
397398 :: then, why not rome?
@@ -402,10 +403,10 @@ comment on the first leg of a rune up above the parent:
402403 visit-holland
403404```
404405
405−This can make flow comments collide, as in "else, if," below:
406+This can make flow comments collide, as in “else, if,” below:
406407
407408```hoon
408− :: if, it's winter
409+ :: if, it is winter
409410 ::
410411 ?: is-winter
411412 :: then, why not rome?
@@ -426,7 +427,7 @@ This can make flow comments collide, as in "else, if," below:
426427
427428Flow comments, because they describe what your code is doing, are
428429embedded in the stack trace, using the same hint mechanism as
429−`~|`. A trace is an explanation of everything your code was
430+`~|`. A trace is an explanation of everything your code was
430431doing when it crashed.
431432
432433And data interpolation, in `{}`, also works in flow comments.
@@ -435,7 +436,7 @@ English, including data.
435436
436437## Grading
437438
438−How do we define the superficial quality of Hoon code? (Setting
439+How do we define the superficial quality of Hoon code? (Setting
439440aside, of course, the question of whether the code is computing
440441the right thing in the right way.)
441442
@@ -446,30 +447,30 @@ Any file that looks like code and opens in an editor gets an F.
446447If it compiles, and it is Hoon, it gets a D.
447448
448449A Hoon file that follows the layout, structure, and naming
449−conventions in this document has earned a C. Weird indents,
450+conventions in this document has earned a C. Weird indents,
450451cryptic or abbreviated names, etc, etc, preclude an A or B
451452grade -- regardless of documentation.
452453
453454A Hoon file gets a B if and only if **every symbol in the file is
454−defined, where introduced, by a formal comment**. You do not get
455+defined, where introduced, by a formal comment**. You do not get
455456to make up a name without writing a one-line definition.
456457
457458For an A, there are two criteria.
458459
459460One: every symbol that needs an explanation (a multiline comment
460−after the definition) has an explanation. This is obviously a
461−judgment call, as a grade of A should always be. If a definition
462−doesn't call for any explanation, it must be dead obvious.
461+after the definition) has an explanation. This is obviously a
462+judgment call, as a grade of A should always be. If a definition
463+doesn’t call for any explanation, it must be dead obvious.
463464
464465Two: every `%constant` we use must be defined where it is used,
465−not just where it's declared.
466+not just where it’s declared.
466467
467468The advantage of a `%constant` over a classic `typedef`: there is no
468−need to search formally for a symbol. The disadvantage: there is
469−no trivial way to find out what the symbol actually means. So
469+need to search formally for a symbol. The disadvantage: there is
470+no trivial way to find out what the symbol actually means. So
470471when I send some `%foobar` move, I should define what I think
471−`%foobar` means. Just copy and paste the original definition.
472+`%foobar` means. Just copy and paste the original definition.
472473
473−Code shouldn't even try for an A until it is quite stable. The worst
474+Code shouldn’t even try for an A until it is quite stable. The worst
474475thing in the world is code that changes without updating the documentation.
475476Any **incorrect** comment in a file drops it all the way back to a D.
tutorials/hoon/workbook/traffic-light.md+1−1
@@ -101,7 +101,7 @@ How does this work?
101101Remember that `.` is [wing syntax](@/docs/reference/hoon-expressions/limb/wing.md) that
102102applies the wing expression on the left of it to the noun to the right of it.
103103`$` is the arm of the core. Then by using the wing expression `+>`, which means
104−"return the head of the tail", we traverse the subject to the core to latch onto
104+"return the tail of the tail", we traverse the subject to the core to latch onto
105105its parent core. where we defined the arms `look` and `set`. The `( )` then
106106lists changes to the core we would like to make as we produce a new one. You
107107will often see `+>.$` used in this way.
tutorials/sail-and-udon.md+100−100
@@ -5,9 +5,9 @@ template = "doc.html"
55aliases = ["docs/using/sail-and-udon/"]
66+++
77
8−Sail is Hoon markup that’s used to render a web page with XML. But what makes it special is that you can run arbitrary Hoon code within such a web page without using a separate markup language.
8+Sail is Hoon markup that's used to render a web page with XML. But what makes it special is that you can run arbitrary Hoon code within such a web page without using a separate markup language.
99
10−Udon is a way to write content for the web. It’s a minimalist markup language for creating and rendering text documents, with a Markdown-inspired syntax. It’s integrated with our Hoon programming language, allowing it to be used as standalone prose in its own file or embedded inside a Hoon source file, in which case it will be parsed into a tree of HTML nodes using Sail.
10+Udon is a way to write content for the web. It's a minimalist markup language for creating and rendering text documents, with a Markdown-inspired syntax. It's integrated with our Hoon programming language, allowing it to be used as standalone prose in its own file or embedded inside a Hoon source file, in which case it will be parsed into a tree of HTML nodes using Sail.
1111
1212This document will be divided into two main sections: the Sail guide and the Udon guide. Also, you should read the Getting Started section below, which applies to both Udon and Sail.
1313
@@ -25,9 +25,9 @@ Before starting with either Sail or Udon, make sure that your ship is
2525[mounted to Unix](@/using/install.md).
2626
2727To host that output, your ship also has a web-server that can be found at
28−`http://localhost/` (default port 80) if it’s your first ship that’s running on the
29−machine, `http://localhost:8081/` if it’s the second ship on that same machine,
30−and so on. In the startup messages, a ship will tell you which HTTP port it’s
28+`http://localhost/` (default port 80) if it's your first ship that's running on the
29+machine, `http://localhost:8081/` if it's the second ship on that same machine,
30+and so on. In the startup messages, a ship will tell you which HTTP port it's
3131using.
3232
3333Udon and Sail files are often run as independent files (`.udon` and `.hoon`
@@ -35,7 +35,7 @@ respectively), but for the purpose of this guide, we will run them out of the
3535`frontpage.hoon` file located in the `/gen` directory. The default content of
3636`frontpage.hoon` is Sail code.
3737
38−To use `frontpage.hoon`, we use a `|serve` command like this one in your ship’s
38+To use `frontpage.hoon`, we use a `|serve` command like this one in your ship's
3939Dojo:
4040
4141```
@@ -54,13 +54,13 @@ Run the command `|serve /test %home /gen/frontpage/hoon`. Now navigate to
5454`http://localhost/test` (or `http://localhost:8081/test` if your ship is on that port) in your
5555browser, and you should see the rendered Sail.
5656
57−**Note:** Important to remember that every time you edit a file in your ship’s
57+**Note:** Important to remember that every time you edit a file in your ship's
5858pier (Unix directory), including `frontpage.hoon`, you need to run `|commit %home`
5959to copy those changes to Urbit.
6060
6161## <a name="sail"></a>Sail: A Guide
6262
63−It’s easy to see how Sail can directly translate to HTML:
63+It's easy to see how Sail can directly translate to HTML:
6464
6565### Sail code
6666
@@ -72,7 +72,7 @@ It’s easy to see how Sail can directly translate to HTML:
7272 ;body
7373 ;h1: Welcome!
7474 ; Hello, world!
75− ; We’re on the web.
75+ ; We're on the web.
7676 ;div;
7777 ;script@"http://unsafely.tracking.you/cookiemonster.js";
7878 ==
@@ -89,7 +89,7 @@ It’s easy to see how Sail can directly translate to HTML:
8989 <body>
9090 <h1>Welcome!</h1>
9191 Hello, world!
92− We’re on the web.
92+ We're on the web.
9393 <div></div>
9494 <script src="http://unsafely.tracking.you/cookiemonster.js"></script>
9595 </body>
@@ -98,17 +98,17 @@ It’s easy to see how Sail can directly translate to HTML:
9898
9999You can test above Sail code by placing it
100100under `^- manx` in your `frontpage.hoon` file, and then running `|commit %home`
101−in the Dojo. If you’ve already run the `|serve` command code from the first
101+in the Dojo. If you've already run the `|serve` command code from the first
102102section, the new content should appear at `http://localhost/test`.
103103
104−It shouldn’t be hard to see the similarities between Sail and HTML. So let’s go
104+It shouldn't be hard to see the similarities between Sail and HTML. So let's go
105105into more detail about what the differences are.
106106
107107### Tags and Closing
108108
109109In Sail, tag heads are written with the tag name prepended by `;`. Unlike in
110110HTML, there are different ways on closing tags, depending on the needs of the
111−tag. One of the nice things about Hoon is that you don’t have to be constantly
111+tag. One of the nice things about Hoon is that you don't have to be constantly
112112closing expressions; Sail inherits this convenience.
113113
114114#### Empty
@@ -172,7 +172,7 @@ those untagged lines with `;`.
172172;body
173173 ;h1: Welcome!
174174 ; Hello, world!
175− ; We’re on the web.
175+ ; We're on the web.
176176==
177177```
178178
@@ -182,7 +182,7 @@ Equals:
182182<body>
183183 <h1>Welcome!</h1>
184184 Hello, world!
185− We’re on the web.
185+ We're on the web.
186186</body>
187187```
188188
@@ -194,15 +194,15 @@ Adding attributes is simple: just add the desired attribute between parentheses,
194194right after the tag name without a space. We separate different attributes of
195195the same node by using `,`.
196196
197−Attributes can be used in two forms: flat, which uses one line; and tall, which
198−uses multiple lines, when a single line would not be practical. Flat forms and
197+Attributes can be used in two forms: wide, which uses one line; and tall, which
198+uses multiple lines, when a single line would not be practical. Wide forms and
199199tall forms are two syntaxes of semantically equivalent expressions.
200200
201201#### Generic
202202
203−The code below produces a “Submit” button on the page.
203+The code below produces a "Submit" button on the page.
204204
205−Flat-form Sail:
205+Wide-form Sail:
206206
207207```
208208;input(type "submit", value "Submit");
@@ -299,7 +299,7 @@ with Hoon code.
299299One place where Sail diverges from HTML is that it supports string
300300interpolation. In Sail, the contents of all tags are a string type called `tape`
301301unless otherwise designated. Tapes are delineated by the double quotes `""`.
302−That’s important, because tapes can be interpolated with Hoon expressions,
302+That's important, because tapes can be interpolated with Hoon expressions,
303303provided that those expressions produce something a tape as well. Interpolation
304304is done by wrapping the code to be inserted in `{}`. In your Dojo prompt, try
305305the command below (without the `>`):
@@ -322,7 +322,7 @@ following command in your Dojo:
32232233
323323```
324324
325−This should work, producing `33`, an atom. That’s our problem. The
325+This should work, producing `33`, an atom. That's our problem. The
326326interpolation expression expects a tape, but our first command tried to
327327interpolate with something that results in an atom. Try this now:
328328
@@ -331,8 +331,8 @@ interpolate with something that results in an atom. Try this now:
331331"33"
332332```
333333
334−We get a similar result, but we know that it’s a tape because it’s wrapped in
335−`""`. Bingo! With this knowledge, let’s perform a successful interpolation:
334+We get a similar result, but we know that it's a tape because it's wrapped in
335+`""`. Bingo! With this knowledge, let's perform a successful interpolation:
336336
337337```
338338> "I am a l{<(mul 3 11)>}t Urbit user."
@@ -365,7 +365,7 @@ Then enter the following command in the Dojo:
365365> .
366366```
367367
368−You’ll notice that the Sail subject is like a stripped-down version of the Dojo
368+You'll notice that the Sail subject is like a stripped-down version of the Dojo
369369subject. Its final line should match the Dojo subject.
370370
371371Now swap the code below into your Sail file.
@@ -380,15 +380,15 @@ Now swap the code below into your Sail file.
380380==
381381```
382382
383−You’ll find that the resulting Sail subject is much larger. If you look closely,
384−you’ll see that there’s some new similarities with the Dojo subject, such as
385−containing the name of your ship. There’s also some new differences, since
383+You'll find that the resulting Sail subject is much larger. If you look closely,
384+you'll see that there's some new similarities with the Dojo subject, such as
385+containing the name of your ship. There's also some new differences, since
386386`fuel:html` contains things that are specifically useful for performing
387387web-related operations.
388388
389389### A More Interesting Example
390390
391−Now let’s apply knowledge of string interpolation and the Sail subject in a Sail
391+Now let's apply knowledge of string interpolation and the Sail subject in a Sail
392392source file. The following code produces more interesting things than the
393393example we saw before.
394394
@@ -414,13 +414,13 @@ example we saw before.
414414 ;span: Check it out!
415415 ;+ ?: show-list
416416 ;ol
417− ;li(style "color: green"): We’re doing interesting stuff now.
418− ;li: We’re pretty-printing this sum with Hoon: {<(add 50 50)>}.
417+ ;li(style "color: green"): We're doing interesting stuff now.
418+ ;li: We're pretty-printing this sum with Hoon: {<(add 50 50)>}.
419419 ;li: The code above is shorthand for {(scow %ud (add 50 50))}.
420420 ;li: I am {(trip '~lodleb-ritrul')}.
421− ;li: Actually, my name is {<p.bem.gas>}. I’m a {what-kind}.
421+ ;li: Actually, my name is {<p.bem.gas>}. I'm a {what-kind}.
422422 ==
423− ;div: My name is {<p.bem.gas>}. I’m a {what-kind}.
423+ ;div: My name is {<p.bem.gas>}. I'm a {what-kind}.
424424 ==
425425==
426426```
@@ -429,7 +429,7 @@ Save the above Sail code in to `home/web/pages/secondsail.hoon` and access the
429429resulting page by navigating to `http://localhost:8080/pages/secondsail` in
430430your browser.
431431
432−There are some interesting things here. Let’s go through this code piece by
432+There are some interesting things here. Let's go through this code piece by
433433piece.
434434
435435```
@@ -443,17 +443,17 @@ against its own subject, `our` is not part of the default subject. To augment
443443our subject with the information that we need, we use `/= gas /$ fuel:html`.
444444
445445The above expression uses two Ford runes, `/=` and `/$`, to add the relevant
446−information to the current subject. We can pull the ship’s name out of this
447−augmented subject later. It’s important to note that these runes are not part of
446+information to the current subject. We can pull the ship's name out of this
447+augmented subject later. It's important to note that these runes are not part of
448448Hoon. They are part of Ford, our build system.
449449
450450`/$` is used to get data from the environment, and `/=` adds that data to
451451subject in the face `gas`. The
452452[Ford user manual](https://urbit.org/docs/arvo/internals/ford/runes/) has
453−details on these and other Ford runes, but understanding these runes isn’t
453+details on these and other Ford runes, but understanding these runes isn't
454454necessary for the purposes of this tutorial.
455455
456−`fuel:html` gets extra data from your ship’s Eyre module, which handles all
456+`fuel:html` gets extra data from your ship's Eyre module, which handles all
457457things HTTP, and sticks it in the subject when Eyre renders a page. This
458458includes the name of the ship, which is what we look for in the next line, but
459459it includes much more.
@@ -485,7 +485,7 @@ the source code.
485485 "comet"
486486```
487487
488−This code chunk is a series of conditionals that checks the host ship’s name to
488+This code chunk is a series of conditionals that checks the host ship's name to
489489see what its value is.
490490
491491The first line, `=+ wid=(met 3 p.bem.gas)`, combines a new noun with the
@@ -493,7 +493,7 @@ subject and gives it the face `wid`. This noun is produced by the the
493493standard-library function [`met`](/docs/reference/library/2c), which measures the number of
494494[blocks](/docs/reference/library/1c/) of size `a` within `b`. Blocks are units that have a
495495bitwidth of `2^a`. So, in this case, it measures how many bytes (blocks of size
496−3 are bitwidths of 8; `2^3 = 8`) are fully contained in your ship’s address.
496+3 are bitwidths of 8; `2^3 = 8`) are fully contained in your ship's address.
497497
498498Galaxies contain zero to one 3-blocks; stars contain two 3-blocks; planets
499499contain three to four 3-blocks; moons contain five to eight 3-blocks; comets
@@ -554,25 +554,25 @@ In the following lines, we begin to use some Hoon expressions again.
554554In the top line in the chunk above, we use the `;+` Sail rune, which
555555resolves an expression to a single node. That expression, in this case, is
556556`?:`, which tests the truth value of `show-list`, which we assigned the value
557−`&` (meaning `true`) at the beginning of the program. It’s closed by the `==` on
557+`&` (meaning `true`) at the beginning of the program. It's closed by the `==` on
558558the last line.
559559
560560Thus, this program resolves to the first child of `show-list`, the node `;ol`.
561561That node creates an ordered list, and the items contained within that node.
562562
563563```
564− ;li(style "color: green"): We’re doing more interesting stuff now.
564+ ;li(style "color: green"): We're doing more interesting stuff now.
565565```
566566
567567The line above is the only element of this list that does not use
568568Hoon proper. The line renders as green, as interpreted by the browser,
569569because of the Sail attribute.
570570
571−The next items in the list use `{}`. Recall that these braces, pronounced “lob”
572−and “rob” in Hoon-speak, allow for the interpolation of code within a string.
571+The next items in the list use `{}`. Recall that these braces, pronounced "lob"
572+and "rob" in Hoon-speak, allow for the interpolation of code within a string.
573573
574574```
575− ;li: We’re pretty-printing this sum with Hoon: {<(add 50 50)>}.
575+ ;li: We're pretty-printing this sum with Hoon: {<(add 50 50)>}.
576576```
577577
578578The line above is interpolated with Hoon code that produces the sum of 50 plus
@@ -585,7 +585,7 @@ tape, like the rest of the line.
585585
586586The `{(scow %ud (add 50 50)}` on this line is just a different way
587587writing the `{<(add 50 50)>}` expression. `scow` is a Hoon function that turns a
588−noun into a `tape`, Hoon’s string type. `%ud` tells `scow` that its argument
588+noun into a `tape`, Hoon's string type. `%ud` tells `scow` that its argument
589589should be displayed in the form of an unsigned decimal.
590590
591591```
@@ -599,7 +599,7 @@ tape. So, by converting `~lodleb-ritrul` to a tape, it can be included in the
599599tape that we are trying to insert it into without getting a type error.
600600
601601```
602− ;li: Actually, my name is {<p.bem.gas>}. I’m a {what-kind}.
602+ ;li: Actually, my name is {<p.bem.gas>}. I'm a {what-kind}.
603603 ==
604604```
605605
@@ -613,23 +613,23 @@ within `gas`, which happens to be where the name of the ship is located.
613613Note that `{what-kind}` does not have a `<>` wrapper. Why do you think this is?
614614
615615```
616− ;div; My name is {<p.bem.gas>}. I’m a {ship}.
616+ ;div; My name is {<p.bem.gas>}. I'm a {ship}.
617617 ==
618618==
619619```
620620
621621The `;div;` node above is only rendered, as an alternative to the above list,
622−if `show-list` is evaluated as `true`. This means it won’t be shown with your
622+if `show-list` is evaluated as `true`. This means it won't be shown with your
623623default code. To show this line, change the `&` on line 2 to `|` (`false`).
624624
625625### Sail Runes
626626
627−In the previous example, we used a few special runes that aren’t used in typical
627+In the previous example, we used a few special runes that aren't used in typical
628628Hoon code. But there are others that are worth learning about at this point.
629629
630630`;+` is an expression that resolves to a single node. We saw this on line 20
631631in our Sail example above: `;+ ?: show-list` resolves to the node `;ol` and
632−all of that node’s children.
632+all of that node's children.
633633
634634`;*` is an expression that resolves to a list of nodes. If we want to render
635635multiple nodes side-by-side, and not just the children of a single node, this
@@ -637,7 +637,7 @@ is the expression that we use.
637637
638638`;=` turns a tuple of nodes into a list of nodes.
639639
640−To see how these runes work, let’s take a chunk of our previous code starting at
640+To see how these runes work, let's take a chunk of our previous code starting at
641641line 20 and modify it a bit:
642642
643643```
@@ -647,7 +647,7 @@ line 20 and modify it a bit:
647647 ;li: Actually, my name is {<p.bem.gas>}.
648648 ==
649649 ;=
650− ;div: My name is {<p.bem.gas>}. I’m a {what-kind}.
650+ ;div: My name is {<p.bem.gas>}. I'm a {what-kind}.
651651 ;div: No list here!
652652 ==
653653 ==
@@ -659,8 +659,8 @@ side-by-side -- notice that the `;ol` is absent from the first branch.
659659We begin with the `;*` rune, which resolves to a list of nodes, instead of the
660660`;+` rune, which only resolves to a single node.
661661
662−But that’s not enough on its own. `;*` needs to resolve to a list, and a few
663−Sail nodes aren’t lists until they are explicitly made into lists. Until we wrap
662+But that's not enough on its own. `;*` needs to resolve to a list, and a few
663+Sail nodes aren't lists until they are explicitly made into lists. Until we wrap
664664those nodes in `;=`, the nodes treated as mere tuples. All branches must be
665665valid lists for the `;* ?: show-list` expression to resolve.
666666
@@ -676,15 +676,15 @@ learn more about how the renderer works, take a look at the
676676
677677## Udon: A Guide {#udon}
678678
679−Udon is a way to write content for the web. It’s a minimalist
679+Udon is a way to write content for the web. It's a minimalist
680680markup language for creating and rendering text documents, with a
681−Markdown-inspired syntax. It’s integrated with our Hoon programming language,
681+Markdown-inspired syntax. It's integrated with our Hoon programming language,
682682allowing it to be used as standalone prose in its own file or embedded inside a
683683Hoon source file, in which case it will be parsed into a tree of HTML nodes
684−using Hoon’s XML-templating syntax, Sail.
684+using Hoon's XML-templating syntax, Sail.
685685
686686There are quite a few similarities between Udon and the
687−CommonMark standard, but there are enough differences that you shouldn’t rely on
687+CommonMark standard, but there are enough differences that you shouldn't rely on
688688existing knowledge of the latter. Udon generally supports only one
689689syntax for each type of HTML node it emits. Udon is also stricter than
690690Markdown: some syntax errors will prevent the file from being parsed at all.
@@ -696,7 +696,7 @@ will use the `frontpage.hoon` method that we are already familiar with.
696696
697697To test out Udon, put a `;>` under the `^- manx` in your `frontpage.hoon` file,
698698and then put all your Udon code under that `;>`. Then run `|commit %home`
699−in the Dojo. If you’ve already run the `|serve` command code from the first
699+in the Dojo. If you've already run the `|serve` command code from the first
700700section, the new content should appear at `http://localhost/test`.
701701
702702## Udon Syntax
@@ -710,7 +710,7 @@ The first thing on a `.udon` file is a chunk of code called the front matter. It
710710contains metadata about your page, such as date, title, and position relative
711711to sibling pages.
712712
713−As an example, let’s look at the front matter of this very page:
713+As an example, let's look at the front matter of this very page:
714714
715715```
716716:- :~ navhome/'/docs/'
@@ -720,14 +720,14 @@ As an example, let’s look at the front matter of this very page:
720720;>
721721```
722722
723−What’s going on here?
723+What's going on here?
724724
725725`:-`, the Hoon rune for creating a cell, creates a cell composed of
726726the `:~` Hoon rune for creating a list, and `;>`, which is a Sail rune
727727for Udon.
728728
729729`:~` creates a list out of the three elements: `navhome/'/docs/'`, which
730−indicates that navigating “home” will bring you to the urbit.org/docs section
730+indicates that navigating "home" will bring you to the urbit.org/docs section
731731of the website; `sort/'28'`, which assigns it the 28th position of the
732732immediate section that contains it, the one you see in the sidebar;
733733and `title/'Udon'`, which gives the page its title. The `==` digraph
@@ -735,7 +735,7 @@ terminates the list.
735735
736736`;>` is a Sail rune that creates a node that contains everything that follows
737737it, telling the parser that this text should be interpreted as Udon.
738−It’s not technically front matter, but you’ll always find it following the
738+It's not technically front matter, but you'll always find it following the
739739front matter, since all Udon must come after this rune.
740740
741741The categories listed in the example above -- `navhome`, `sort`, and `title` --
@@ -803,22 +803,22 @@ the _same line_.
803803**Example:**
804804
805805```
806−Here’s the first line.
806+Here's the first line.
807807
808−This second line is separated by two newlines, so it’s a separate paragraph.
808+This second line is separated by two newlines, so it's a separate paragraph.
809809
810−This line looks like a distinct paragraph, but …
811−It’s only separated by a single newline, so it’s included in the same paragraph.
810+This line looks like a distinct paragraph, but ...
811+It's only separated by a single newline, so it's included in the same paragraph.
812812```
813813
814814**Produces:**
815815
816−Here’s the first line.
816+Here's the first line.
817817
818−This second line is separated by two newlines, so it’s a separate paragraph.
818+This second line is separated by two newlines, so it's a separate paragraph.
819819
820−This line looks like a distinct paragraph, but …
821−It’s only separated by a single newline, so it’s included in the same paragraph.
820+This line looks like a distinct paragraph, but ...
821+It's only separated by a single newline, so it's included in the same paragraph.
822822
823823#### Backslash Line Break
824824
@@ -871,13 +871,13 @@ New list elements are delineated by newlines beginning with list symbols of
871871the appropriate type (`-` or `+`).
872872
873873Just as with non-list text, text on a bare newline will appear on the line before,
874−separated by a space. A `\\` is used to create a line-break that isn’t the list
875−itself and isn’t a list. Both of these kinds of newlines must be indented by two
874+separated by a space. A `\\` is used to create a line-break that isn't the list
875+itself and isn't a list. Both of these kinds of newlines must be indented by two
876876spaces, or else the page will not parse.
877877
878878Indentation is also used for creating nested sub-lists. Sub-lists of one kind
879−can be used with parent lists of the other kind. Sub-lists can’t be nested
880−directly after either kind of aforementioned newline that isn’t a list element;
879+can be used with parent lists of the other kind. Sub-lists can't be nested
880+directly after either kind of aforementioned newline that isn't a list element;
881881only lines that are themselves list elements can nest sub-lists.
882882
883883A newline after a blank line is interpreted as a new paragraph in normal text.
@@ -895,15 +895,15 @@ followed by a `\\` on its own line.
895895- Chicken\
896896 Make sure that you get enough for the barbecue
897897- Bread
898− + Ask the baker what’s fresh
898+ + Ask the baker what's fresh
899899 + Buy the second-freshest batch
900900- Cereal
901901
902902\
903903+ First, separate eggs into a bowl
904904+ Then, add a splash of cream
905− - If you don’t have cream, you can use milk, but cream is preferred
906− + If you don’t have milk or cream, melt an eighth of a stick of butter on
905+ - If you don't have cream, you can use milk, but cream is preferred
906+ + If you don't have milk or cream, melt an eighth of a stick of butter on
907907 a skillet
908908 + Scramble the eggs in the bowl
909909 + Pour the eggs onto the skillet before the butter browns
@@ -925,15 +925,15 @@ Produces
925925- Chicken\
926926 Make sure that you get enough for the barbecue
927927- Bread
928− 1. Ask the baker what’s fresh
928+ 1. Ask the baker what's fresh
929929 1. Buy the second-freshest batch
930930- Cereal
931931
932932\
9339331. First, separate eggs into a bowl
9349341. Then, add a splash of cream
935− - If you don’t have cream, you can use milk, but cream is preferred
936− 1. If you don’t have milk or cream, melt an eighth of a stick of butter on
935+ - If you don't have cream, you can use milk, but cream is preferred
936+ 1. If you don't have milk or cream, melt an eighth of a stick of butter on
937937 a skillet
938938 1. Scramble the eggs in the bowl
939939 1. Pour the eggs onto the skillet before the butter browns
@@ -956,26 +956,26 @@ destination.
956956**Example:**
957957
958958```
959−[I’m an inline-style link](https://urbit.org/operations/#using-the-shell)
959+[I'm an inline-style link](https://urbit.org/operations/#using-the-shell)
960960```
961961
962962**Produces:**
963963
964−[I’m an inline-style link](https://urbit.org/operations/#using-the-shell)
964+[I'm an inline-style link](https://urbit.org/operations/#using-the-shell)
965965
966966The second type is a reference-style link, which uses a relative path, based on
967−the current page’s location. Instead of the full url, we use `..` to fill in
967+the current page's location. Instead of the full url, we use `..` to fill in
968968all of the URL that the destination has in common with the origin page.
969969
970970**Example:**
971971
972972```
973−[I’m a reference-style link](../shell)
973+[I'm a reference-style link](../shell)
974974```
975975
976976**Produces:**
977977
978−[I’m a reference-style link](../shell)
978+[I'm a reference-style link](../shell)
979979
980980If this page is located at `https://www.urbit.org/docs/reference/`, then these two
981981examples should have the same destination.
@@ -997,9 +997,9 @@ Note that each HTML element `id` should be unique and not be used more than once
997997```
998998Check out this [section](#here-we-are) that we want to jump to.
999999
1000−Four score and seven years ago …
1000+Four score and seven years ago ...
10011001
1002−It was the best of times, it was the worst of times …
1002+It was the best of times, it was the worst of times ...
10031003
10041004## Here we are!
10051005```
@@ -1008,16 +1008,16 @@ It was the best of times, it was the worst of times …
10081008
10091009Check out this [section](#here-we-are) that we want to jump to.
10101010
1011−Four score and seven years ago …
1011+Four score and seven years ago ...
10121012
1013−It was the best of times, it was the worst of times …
1013+It was the best of times, it was the worst of times ...
10141014
10151015## Here we are!
10161016
10171017### Double Quote
10181018
10191019Text enclosed in double quotes (`"`) will be rendered with
1020−opening and closing quotes -- that is, `“` and `”`.
1020+opening and closing quotes -- that is, `"` and `"`.
10211021
10221022**Example:**
10231023```
@@ -1026,7 +1026,7 @@ opening and closing quotes -- that is, `“` and `”`.
10261026
10271027**Produces:**
10281028
1029−“Yes,” he said. “That is the way with him.”
1029+"Yes," he said. "That is the way with him."
10301030
10311031### Code Literal
10321032
@@ -1048,21 +1048,21 @@ inside a `<code>` HTML element with monospace font and highlighted with a
10481048different background color.
10491049
10501050Using `` ` `` is useful when you want to designate only part of a line as code.
1051−Since this page is written in Udon, we’ve been using this operation
1051+Since this page is written in Udon, we've been using this operation
10521052throughout this guide to _format text_ to distinguish `code` from prose.
10531053
10541054**Example:**
10551055
10561056```
1057−`*[a 2 b c] -> *[*[a b] *[a c]]` is like lisp’s `apply`.
1057+`*[a 2 b c] -> *[*[a b] *[a c]]` is like lisp's `apply`.
10581058```
10591059
10601060**Produces:**
10611061
1062−`*[a 2 b c] -> *[*[a b] *[a c]]` is like lisp’s `apply`.
1062+`*[a 2 b c] -> *[*[a b] *[a c]]` is like lisp's `apply`.
10631063
10641064Also, using the `++` prefix before a word will cause the word to be rendered as
1065−code with the `++` displayed, since that’s the standard notation for an arm in
1065+code with the `++` displayed, since that's the standard notation for an arm in
10661066Hoon.
10671067
10681068**Example:**
@@ -1127,7 +1127,7 @@ Produces:\
11271127### Horizontal Rule
11281128
11291129Three or more hyphens, such as `---`, on their own line produce an `<hr>`
1130−element, the “horizontal rule”. This is rendered as a horizontal line the
1130+element, the "horizontal rule". This is rendered as a horizontal line the
11311131width of its containing paragraph.
11321132
11331133**Example:**
@@ -1211,7 +1211,7 @@ indent the text in question with **eight spaces**.
12111211
12121212## Sail Expressions
12131213
1214−It’s possible to use Udon as an HTML templating language akin to
1214+It's possible to use Udon as an HTML templating language akin to
12151215PHP, ERB, JSP, or Handlebars templates. This facility derives
12161216in part from the support for embedding Hoon code inside the markup.
12171217
@@ -1226,7 +1226,7 @@ Example:
12261226```
12271227;=
12281228 ;p
1229− ;strong: Don’t panic!
1229+ ;strong: Don't panic!
12301230 ;br;
12311231 ;small: [reactive publishing intensifies]
12321232 ==
@@ -1236,7 +1236,7 @@ Example:
12361236Produces:
12371237
12381238<p>
1239− <strong>Don’t panic!</strong>
1239+ <strong>Don't panic!</strong>
12401240 <br />
12411241 <small>[reactive publishing intensifies]</small>
12421242</p>
tutorials/ship-troubleshooting.md+23−23
@@ -5,7 +5,7 @@ template = "doc.html"
55aliases = ["docs/using/ship-troubleshooting/"]
66+++
77
8−Urbit is still in the development stage, so there’s a chance that your ship won’t start properly, or will stop working properly when you’re running it. That’s ok! This document is intended to help you in such an event.
8+Urbit is still in the development stage, so there's a chance that your ship won't start properly, or will stop working properly when you're running it. That's ok! This document is intended to help you in such an event.
99
1010## Table of Contents
1111
@@ -17,7 +17,7 @@ Urbit is still in the development stage, so there’s a chance that your ship wo
1717
1818## Best Practices {#best-practices}
1919
20−An ounce of prevention is worth a pound of cure, so let’s first go over some best practices to keep your ship in working order.
20+An ounce of prevention is worth a pound of cure, so let's first go over some best practices to keep your ship in working order.
2121
2222### Only boot with your keyfile once
2323
@@ -27,11 +27,11 @@ If you accidentally booted with the same keyfile twice, the only remedy is perfo
2727
2828### Do not delete your pier
2929
30−Urbit is stateful, meaning that it needs to hold onto all your data. If you delete your pier and start your ship again, you won’t be able to talk to any ship you’ve talked to before. The only solution to this is performing a [personal breach](#personal-breach)
30+Urbit is stateful, meaning that it needs to hold onto all your data. If you delete your pier and start your ship again, you won't be able to talk to any ship you've talked to before. The only solution to this is performing a [personal breach](#personal-breach)
3131
3232### Keep track of the directory that you put your ship in
3333
34−When you first start your ship, you should make sure you put it a place where you can find it again and where it won’t get accidentally deleted. Remember that you must perform `|mount %` in your ship’s Dojo to make your ship visible as a directory in the Unix file system.
34+When you first start your ship, you should make sure you put it a place where you can find it again and where it won't get accidentally deleted. Remember that you must perform `|mount %` in your ship's Dojo to make your ship visible as a directory in the Unix file system.
3535
3636### Avoid killing the urbit process directly
3737
@@ -39,11 +39,11 @@ The best way to end an urbit process is to use `ctrl-d` from the Dojo. Unix meth
3939
4040### Keep up-to-date builds
4141
42−Check for latest Urbit version at https://github.com/urbit/urbit/releases. If you’re behind, update using [this guide](@using/install.md).
42+Check for latest Urbit version at https://github.com/urbit/urbit/releases. If you're behind, update using [this guide](@using/install.md).
4343
44−### `|hi` your star to see if you’re connected
44+### `|hi` your star to see if you're connected
4545
46−Find out who your star is by running `(sein:title our now our)` in the Dojo. Then, run `|hi ~star`, where `~star` is the star’s name, and if things are working properly, you should get the message `hi ~star successful`. It could also be helpful to use `|hi` to check connectivity with `~zod` or another planet that you’re in a Chat channel with.
46+Find out who your star is by running `(sein:title our now our)` in the Dojo. Then, run `|hi ~star`, where `~star` is the star's name, and if things are working properly, you should get the message `hi ~star successful`. It could also be helpful to use `|hi` to check connectivity with `~zod` or another planet that you're in a Chat channel with.
4747
4848### Turn your ship off and on again
4949
@@ -51,11 +51,11 @@ Use `ctrl-d` to gracefully exit your ship, and then start it again. This can sol
5151
5252### Use the `|knob` command to customize your error messages
5353
54−Error messages can be by overwhelming, so the `|knob` command is intended to remedy this. It’s used to silence errors that aren’t important.
54+Error messages can be by overwhelming, so the `|knob` command is intended to remedy this. It's used to silence errors that aren't important.
5555
5656The command takes two arguments, and comes in the form of `|knob %error-tag %level`.
5757
58−`%error-tag` is the name of the error in question. It’s usually printed at the top of the stack trace, such as in `crud: %hole event failed` -- `%hole` here is an example of an error tag.
58+`%error-tag` is the name of the error in question. It's usually printed at the top of the stack trace, such as in `crud: %hole event failed` -- `%hole` here is an example of an error tag.
5959
6060`%level` determines how much you will see of errors with your chosen `%error-tag`. There are three levels:
6161
@@ -79,21 +79,21 @@ Run `|wash-gall`. This clears caches in Gall, and may result in steep performanc
7979
8080### My urbit is frozen
8181
82−Sometimes this happens if you’re processing a very large event, or if you’re in an infinite loop, or for a variety of other reasons.
82+Sometimes this happens if you're processing a very large event, or if you're in an infinite loop, or for a variety of other reasons.
8383
84−Before doing anything, try waiting for a minute: an event might finish processing. If it doesn’t clear up, then use the Unix kill-command, `ctrl-z`, to end your ship’s process. Then restart your ship.
84+Before doing anything, try waiting for a minute: an event might finish processing. If it doesn't clear up, then use the Unix kill-command, `ctrl-z`, to end your ship's process. Then restart your ship.
8585
8686### When I try to type into the Dojo, it prints `dy-noprompt`
8787
8888This happens when your Dojo is waiting on a request, such as an HTTP request. You can fix it simply by typing `backspace` or (`delete` on Mac).
8989
90−### My ship doesn’t recognize file changes that I make in my pier
90+### My ship doesn't recognize file changes that I make in my pier
9191
92−Since version `0.8.0`, changes no longer automatically sync between the Unix side (your pier) and your ship. To sync your file changes, you must run `|commit %desk` in your Dojo, where `%desk` is the desk you’d like to sync.
92+Since version `0.8.0`, changes no longer automatically sync between the Unix side (your pier) and your ship. To sync your file changes, you must run `|commit %desk` in your Dojo, where `%desk` is the desk you'd like to sync.
9393
9494## Connectivity Issues {#connectivity-issues}
9595
96−### I can’t communicate with anyone
96+### I can't communicate with anyone
9797
9898You may have booted a ship with your keyfile twice in the same era. To fix this, you must perform a [personal breach](#personal-breach).
9999
@@ -101,15 +101,15 @@ You may have booted a ship with your keyfile twice in the same era. To fix this,
101101
102102You may see a message like this one: `/~zod/home/~2019.7.22..18.55.46..83a3/sys/vane/ames:<[line column].[line column]>`. This is a clay path to a Hoon file, pointing to the line and column where an expression crashed. This kind of error might be accompanied by a `crud` message.
103103
104−This means that another ship is sending invalid packets to you. This could be because one of the ships has not updated the other ship’s “life number,” which is the number that starts at one and increments every time that ship performs a personal breach.
104+This means that another ship is sending invalid packets to you. This could be because one of the ships has not updated the other ship's "life number", which is the number that starts at one and increments every time that ship performs a personal breach.
105105
106−This can happen if they have the wrong keys of yours, or if you have the wrong keys of theirs. You can figure out who has the wrong keys by running this scry command in your dojo: `.^(* %j /=life=/shipname)`, where shipname is the other ship’s name. Save that information. Then, go to the [Azimuth contract on Etherscan](https://etherscan.io/address/0x223c067f8cf28ae173ee5cafea60ca44c335fecb#readContract), scroll down to `32. points`, and put in the hexadecimal representation of the other ship’s `@p`. You can find the hexadecimal representation by running …
106+This can happen if they have the wrong keys of yours, or if you have the wrong keys of theirs. You can figure out who has the wrong keys by running this scry command in your dojo: `.^(* %j /=life=/shipname)`, where shipname is the other ship's name. Save that information. Then, go to the [Azimuth contract on Etherscan](https://etherscan.io/address/0x223c067f8cf28ae173ee5cafea60ca44c335fecb#readContract), scroll down to `32. points`, and put in the hexadecimal representation of the other ship's `@p`. You can find the hexadecimal representation by running ...
107107
108108```
109109`@ux`~sampel-palnet
110110```
111111
112−… in the Dojo, where `~sampel-palnet` is the other ship’s name. Then, compare it to the scry information that you saved. If that information matches up, it means that the other ship is the problem. If it **doesn’t** match up, your ship has wrong information about the other ship. If you have such wrong information, you can fix this by running:
112+... in the Dojo, where `~sampel-palnet` is the other ship's name. Then, compare it to the scry information that you saved. If that information matches up, it means that the other ship is the problem. If it **doesn't** match up, your ship has wrong information about the other ship. If you have such wrong information, you can fix this by running:
113113
114114```
115115:azimuth-tracker|listen ~ %app %azimuth-tracker
@@ -125,13 +125,13 @@ The last line above syncs from an Ethereum node for _all_ ships on the network.
125125
126126The above commands work if you have the wrong keys of other ships. If other ships have wrong keys of _yours_, you need to somehow ask them to to run such a command.
127127
128−### I can talk to some ships, but I can’t talk to my sponsor and some other ships
128+### I can talk to some ships, but I can't talk to my sponsor and some other ships
129129
130130This is the result of deleting your pier and starting your ship again. To fix this, you must perform a [personal breach](#personal-breach).
131131
132132## Booting Issues {#booting-issues}
133133
134−### My ship won’t boot and gets a `terminals database is inaccessible` message
134+### My ship won't boot and gets a `terminals database is inaccessible` message
135135
136136This happens when you try to run the Urbit binary through your `$PATH`. When running the command, you need to be explicit and specify the actual path to it in the filesystem. This is a side-effect of the way we build the release binaries, which will be fixed.
137137
@@ -139,7 +139,7 @@ This happens when you try to run the Urbit binary through your `$PATH`. When run
139139
140140You may have used the wrong arguments when booting your ship for the first time. Delete this comet and try again.
141141
142−### My development ship (“fakezod”) gets a `boot: malformed` failure
142+### My development ship ("fakezod") gets a `boot: malformed` failure
143143
144144This means that you gave your development ship an invalid `@p`. So, you will get this error if you write, for example, `urbit -F zodzod` instead of `urbit -F zod`.
145145
@@ -155,9 +155,9 @@ However, if you get a `bail` error again, you should perform a [personal breach]
155155
156156You can get help with you problem by creating an issue at [github.com/urbit/urbit](https://github.com/urbit/urbit/issues). But to make a good issue, you need to include some information.
157157
158−When your urbit crashes with a `bail`, you’ll probably get a core dump, which is a file that contains the program state of your urbit when it crashed. On Mac, core dumps can be found in `/cores`. On Linux, cores can often be found in `/var/crash`, or the home directory.
158+When your urbit crashes with a `bail`, you'll probably get a core dump, which is a file that contains the program state of your urbit when it crashed. On Mac, core dumps can be found in `/cores`. On Linux, cores can often be found in `/var/crash`, or the home directory.
159159
160−Navigate to the folder containing your core dumps. Find the most recent core dump by looking at the dates after you run `ls -l`. Then `lldb -c <corename>`. Once that loads, you’ll be at an `(lldb)` prompt; type `bt` at this prompt. This will create a stack trace that looks like this:
160+Navigate to the folder containing your core dumps. Find the most recent core dump by looking at the dates after you run `ls -l`. Then `lldb -c <corename>`. Once that loads, you'll be at an `(lldb)` prompt; type `bt` at this prompt. This will create a stack trace that looks like this:
161161
162162```
163163(lldb) bt
@@ -176,7 +176,7 @@ Copy this stack trace and include it in your GitHub issue.
176176
1771771. Make sure you are running version to `0.8.2` if you are not already on it.
178178
179−2. Restart your ship. If you don’t crash again, everything may be fine. If you **do** crash again, then you should perform a [personal breach](#personal-breach).
179+2. Restart your ship. If you don't crash again, everything may be fine. If you **do** crash again, then you should perform a [personal breach](#personal-breach).
180180
181181### My ship crashed with a `bail: oops` error
182182