on master help sign in
various minor fixes in hoon tutorials
commitece68411368575d40e1ceebdb5011379642021c7 authorjoshuareagan <joshuareagan@gmail.com> dateMon 24 Sep 2018, 15:03 (8 years ago) parent847c5e4
21 files changed+140−165
docs.umd+1−1 docs/reference/rune.umd+1−1 docs/tutorials/hoon-ch1.umd+1−1 docs/tutorials/hoon-ch1/hoon-ch1-1.umd+4−4 docs/tutorials/hoon-ch1/hoon-ch1-2.umd+18−18 docs/tutorials/hoon-ch1/hoon-ch1-3.umd+22−21 docs/tutorials/hoon-ch1/hoon-ch1-4.umd+3−3 docs/tutorials/hoon-ch1/hoon-ch1-5.umd+1−1 docs/tutorials/hoon-ch1/hoon-ch1-6.umd+5−5 docs/tutorials/hoon-ch2/hoon-ch2-1.umd+3−3 docs/tutorials/hoon-ch2/hoon-ch2-10.umd+2−2 docs/tutorials/hoon-ch2/hoon-ch2-11.umd+27−53 docs/tutorials/hoon-ch2/hoon-ch2-2.umd+20−20 docs/tutorials/hoon-ch2/hoon-ch2-3.umd+7−7 docs/tutorials/hoon-ch2/hoon-ch2-4.umd+6−6 docs/tutorials/hoon-ch2/hoon-ch2-5.umd+4−4 docs/tutorials/hoon-ch2/hoon-ch2-6.umd+4−4 docs/tutorials/hoon-ch2/hoon-ch2-7.umd+2−2 docs/tutorials/hoon-ch2/hoon-ch2-8.umd+4−4 docs/tutorials/hoon-ch2/hoon-ch2-9.umd+3−3 docs/tutorials/internals.umd+2−2
docs.umd+1−1
@@ -17,7 +17,7 @@
1717
1818Check out the [technical overview](about/overview) for a high-level architecture description. To install and run Urbit head to the Using section, starting with the [installation guide](using/install) and continuing forward.
1919
20−To begin developing for Urbit, you can start by walking through the tutorial series for [Hoon](tutorials/ch1). Hoon is Urbit's high-level programming language. Anyone obsessed with math, theory, fundamentals of computation, etc., should start with [Nock](tutorials/nock), the low-level language to which Hoon is compiled.
20+To begin developing for Urbit, you can start by walking through the tutorial series for [Hoon](tutorials/hoon-ch1). Hoon is Urbit's high-level programming language. Anyone obsessed with math, theory, fundamentals of computation, etc., should start with [Nock](tutorials/nock), the low-level language to which Hoon is compiled.
2121
2222 ==
2323
docs/reference/rune.umd+1−1
@@ -10,7 +10,7 @@
1010
1111;div(class "book")
1212
13−## Constants (and Interpolations)
13+## Constants
1414
1515Hoon uses runes to form expressions, but not all expressions have runes in them. First, we have constant expressions (and also expressions that would be constant, but that they allow for interpolations):
1616
docs/tutorials/hoon-ch1.umd+1−1
@@ -9,7 +9,7 @@
99
1010Hoon 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.
1111
12−Hoon is an unusual language in several respects, both in syntax and semantics. It uses runes (i.e., ASCII digraphs) in place of keywords, and the spacing rules are a bit strict. A great deal can be expressed in few lines, though excessively compressed code tends to be hard to read. Hoon has surprisingly simple semantics, but mastering it requires learning concepts that don't have close analogues in other languages. We believe that Hoon, if properly taught, is relatively easy to learn and pleasant to use.
12+Hoon is an unusual language in several respects, both in syntax and semantics. It uses runes (i.e., ASCII digraphs) in place of keywords, and the spacing rules are a bit strict. A great deal can be expressed in few lines, though excessively compressed code tends to be hard to read. Hoon has surprisingly simple semantics, but mastering it requires learning concepts that don't have close analogues in other languages.
1313
1414This multi-chapter tutorial 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.
1515
docs/tutorials/hoon-ch1/hoon-ch1-1.umd+4−4
@@ -2,7 +2,7 @@
22 navuptwo/'true'
33 next/'true'
44 sort/'1'
5− title/'Getting Started'
5+ title/'1.1 Getting Started'
66 ==
77;>
88
@@ -12,13 +12,13 @@ Before we begin working on Hoon you should first (1) have Urbit installed and (2
1212
1313## Installing Urbit
1414
15−You can [install Urbit](../../using/install/) on any Mac or Unix machine. On Windows, make a virtual Linux machine using VirtualBox or a similar tool.
15+You can [install Urbit](../../../using/install/) on any Mac or Unix machine. On Windows, make a virtual Linux machine using VirtualBox or a similar tool.
1616
1717Once you're finished you can boot your very own urbit.
1818
1919## What is an urbit?
2020
21−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`.
21+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`.
2222
2323These 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.
2424
@@ -104,7 +104,7 @@ We should note that your comet's state is [ACID](https://en.wikipedia.org/wiki/A
104104
105105You've already used a standard library function to produce one value, in the dojo. Now that your comet is running again, let's try another. Enter the number `17`.
106106
107−_We won't show the `~palnul_nocser:dojo> ` prompt from here on out. We'll just show the echoed command along with its result._
107+> We won't show the `~palnul_nocser:dojo> ` prompt from here on out. We'll just show the echoed command along with its result.
108108
109109You'll see:
110110
docs/tutorials/hoon-ch1/hoon-ch1-2.umd+18−18
@@ -2,7 +2,7 @@
22 navuptwo/'true'
33 next/'true'
44 sort/'2'
5− title/'Nouns'
5+ title/'1.2 Nouns'
66 ==
77;>
88
@@ -123,7 +123,7 @@ As for why the dojo deleted your zero: it parses the command line as you type, a
123123
124124Atoms are nothing more than unsigned integers, but it's often useful to interpret an atom as being a different kind of data. This is done with an *aura* -- the aura of an atom is type meta-data used by Hoon to determine how interpret that atom.
125125
126−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_(computer_programming)) associated with atom auras.
126+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_(computer_programming%29) associated with atom auras.
127127
128128In 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.
129129
@@ -296,7 +296,7 @@ You can force Hoon to interpret an atom differently by using the aura symbols in
296296
297297The atoms in the examples above are all exactly the same value. Only they're interpreted and printed differently, depending on the aura.
298298
299−For more on atoms and auras, see lesson XXXX.
299+You'll learn more about atoms and auras in [lesson 2.4](../../hoon-ch2/hoon-ch2-4).
300300
301301## Cells
302302
@@ -471,24 +471,24 @@ That's it for our basic introduction to nouns. Hit `ctrl-d` to exit your comet,
471471
472472### 1.1.1
473473
474−1. No
475−2. Yes
476−3. No
477−4. Yes
478−5. Yes
474++ No
475++ Yes
476++ No
477++ Yes
478++ Yes
479479
480480### 1.1.2
481481
482−1. 86
483−2. [[[65 35] 54] 77]
484−3. [65 35]
485−4. 77
486−5. 3
482++ 86
483++ [[[65 35] 54] 77]
484++ [65 35]
485++ 77
486++ 3
487487
488488### 1.1.3
489489
490−1. +2
491−2. +6
492−3. +14
493−4. +15
494−5. +31
490++ +2
491++ +6
492++ +14
493++ +15
494++ +31
docs/tutorials/hoon-ch1/hoon-ch1-3.umd+22−21
@@ -2,7 +2,7 @@
22 navuptwo/'true'
33 next/'true'
44 sort/'3'
5− title/'The Subject and Its Legs'
5+ title/'1.3 The Subject and Its Legs'
66 ==
77;>
88
@@ -311,25 +311,26 @@ There is no restriction against using the same face name for multiple limbs of t
3113115
312312```
313313
314−Why does this return `5` rather than `6` or `[14 15]`? When a face is evaluated against a subject, a head-first binary tree search occurs starting at address `1` of the subject. If there is no matching face for address `n` of the subject, first the head of `n` is searched and then `n`'s tail. The total search path for `[[4 b=5] [b=6 b=[14 15]]]` is:
314+Why does this return `5` rather than `6` or `[14 15]`? When a face is evaluated against a subject, a head-first binary tree search occurs starting at address `1` of the subject. If there is no matching face for address `n` of the subject, first the head of `n` is searched and then `n`'s tail. The complete search path for `[[4 b=5] [b=6 b=[14 15]]]` is:
315315
316−1. `[[4 b=5] [b=6 b=[14 15]]]`
317−1. `[4 b=5]`
318−1. `4`
319−1. `b=5`
320−1. `[b=6 b=[14 15]]`
321−1. `b=6`
322−1. `b=[14 15]`
316+
317++ `[[4 b=5] [b=6 b=[14 15]]]`
318++ `[4 b=5]`
319++ `4`
320++ `b=5`
321++ `[b=6 b=[14 15]]`
322++ `b=6`
323++ `b=[14 15]`
323324
324325There are matches at steps 4, 6, and 7 of the total search path, but the search ends when the first match is found at step 4.
325326
326327The children of legs bearing names aren't included in the search path. For example, the search path of `[[4 a=5] b=[c=14 15]]` is:
327328
328−1. `[[4 a=5] b=[c=14 15]]`
329−1. `[4 a=5]`
330−1. `4`
331−1. `a=5`
332−1. `b=[c=14 15]`
329++ `[[4 a=5] b=[c=14 15]]`
330++ `[4 a=5]`
331++ `4`
332++ `a=5`
333++ `b=[c=14 15]`
333334
334335Neither of the legs `c=14` or `15` is checked. Accordingly, a search for `c` of `[[4 a=5] b=[c=14 15]]` fails:
335336
@@ -347,13 +348,13 @@ There are cases when you don't want the limb of the first matching face. You ca
347348
348349Recall that the search path for this noun is:
349350
350−1. `[[4 b=5] [b=6 b=[14 15]]]`
351−1. `[4 b=5]`
352−1. `4`
353−1. `b=5`
354−1. `[b=6 b=[14 15]]`
355−1. `b=6`
356−1. `b=[14 15]`
351++ `[[4 b=5] [b=6 b=[14 15]]]`
352++ `[4 b=5]`
353++ `4`
354++ `b=5`
355++ `[b=6 b=[14 15]]`
356++ `b=6`
357++ `b=[14 15]`
357358
358359The second match in the search path is step 6, `b=6`, so the value at that leg is produced. You can stack `^` characters to skip more than one matching face:
359360
docs/tutorials/hoon-ch1/hoon-ch1-4.umd+3−3
@@ -2,7 +2,7 @@
22 navuptwo/'true'
33 next/'true'
44 sort/'4'
5− title/'Arms and Cores'
5+ title/'1.4 Arms and Cores'
66 ==
77;>
88
@@ -24,7 +24,7 @@ Now you just need to know what a 'Nock formula' is, what a 'battery' is, and wha
2424
2525Hoon runs on your urbit, which is a virtual computer. However, this virtual computer doesn't directly understand Hoon; it has a Nock interpreter instead. Any Hoon code you want to run must first be compiled to Nock. You certainly don't have to know Nock to understand Hoon, but it helps to be aware of a few of Nock's general features.
2626
27−Nock is a [low-level](https://en.wikipedia.org/wiki/Low-level_programming_language), [functional programming](https://en.wikipedia.org/wiki/Functional_programming) language. As a consequence Nock itself can be understood as a function, called the 'Nock function'. Nock is officially defined by the Nock spec (link).
27+Nock is a [low-level](https://en.wikipedia.org/wiki/Low-level_programming_language), [functional programming](https://en.wikipedia.org/wiki/Functional_programming) language. As a consequence Nock itself can be understood as a function, called the 'Nock function'. Nock is officially defined by the [Nock spec](../../nock/definition).
2828
2929### What is a Function?
3030
@@ -45,7 +45,7 @@ Here's an example of some Nock run in the dojo, using `.*( )`:
4545
4646In this example `[15 17]` is the subject, `[[4 0 2] [0 3]]` is the formula, and `[16 17]` is the product.
4747
48−This tutorial series is designed to teach you Hoon. For that purpose it's not important that you know how to read and understand Nock formulas; you just need to know that Nock takes a subject and a formula and returns a product. (Those who who want to learn more about Nock should head over to the Nock tutorial (link).)
48+This tutorial series is designed to teach you Hoon. For that purpose it's not important that you know how to read and understand Nock formulas; you just need to know that Nock takes a subject and a formula and returns a product. (Those who who want to learn more about Nock should head over to the [Nock tutorial]([Nock spec](../../nock)).)
4949
5050### Nock Formulas Define Functions
5151
docs/tutorials/hoon-ch1/hoon-ch1-5.umd+1−1
@@ -2,7 +2,7 @@
22 navuptwo/'true'
33 next/'true'
44 sort/'5'
5− title/'Gates and Hoon Functions'
5+ title/'1.5 Gates and Hoon Functions'
66 ==
77;>
88
docs/tutorials/hoon-ch1/hoon-ch1-6.umd+5−5
@@ -1,11 +1,11 @@
11:- :~ navhome/'/docs/'
22 navuptwo/'true'
33 sort/'6'
4− title/'Producing Gates with Cores'
4+ title/'1.6 Producing Gates with Core Arms'
55 ==
66;>
77
8−# 1.6 Producing Gates with Cores
8+# 1.6 Producing Gates with Core Arms
99
1010It's useful to have cores whose arms evaluate to make gates. The use of such cores is common in Hoon; that's how the functions of the Hoon standard library are stored in the subject. Learning about such cores will also deepen the reader's understanding of Hoon semantics, and for that reason alone is worthwhile.
1111
@@ -274,7 +274,7 @@ battery .
274274
275275It follows from this definition that a gate is a special case of a door. A gate is a door with exactly one arm, named `$`.
276276
277−Gates are useful for defining functions. But there are many-armed doors as well. How are they used? Doors are quite useful data structures. In Chapter 2 of the Hoon tutorial series you'll learn how to use doors to implement state machines, where the sample stores the relevant state data. For let's talk about how to use doors for simpler purposes.
277+Gates are useful for defining functions. But there are many-armed doors as well. How are they used? Doors are quite useful data structures. In Chapter 2 of the Hoon tutorial series you'll learn how to use doors to implement state machines, where the sample stores the relevant state data. For now let's talk about how to use doors for simpler purposes.
278278
279279### An Example Door
280280
@@ -367,7 +367,7 @@ There's a more direct way of passing arguments for both the door sample and the
367367%.n
368368```
369369
370−Readers of a particular mathematical background may notice that `~( )` expressions allow us to [curry](https://en.wikipedia.org/wiki/Currying). For each of the arms above, the `~( )` expression is used to create different versions of the same gate:
370+Readers with some mathematical background may notice that `~( )` expressions allow us to [curry](https://en.wikipedia.org/wiki/Currying). For each of the arms above, the `~( )` expression is used to create different versions of the same gate:
371371
372372```
373373> ~(plus c 7)
@@ -512,4 +512,4 @@ It's better simply to use the `~(arm rs arg)` syntax to replace the value of the
512512
513513## Conclusion
514514
515−You've now reached the end of Chapter 1 of the Hoon tutorial. Ideally you should have a fair understanding of the fundamental concepts of subject-oriented programming: limbs, legs, faces, wings, arms, cores, gates, and doors. If you can master these concepts you should have little or no trouble learning to write substantial Hoon programs. Continue to Chapter 2 to get started.
515+You've now reached the end of Chapter 1 of the Hoon tutorial. Ideally you should have a fair understanding of the fundamental concepts of subject-oriented programming: limbs, legs, faces, wings, arms, cores, gates, and doors. If you can master these concepts you should have little or no trouble learning to write substantial Hoon programs. Continue to [Chapter 2](../../hoon-ch2) to get started.
docs/tutorials/hoon-ch2/hoon-ch2-1.umd+3−3
@@ -1,8 +1,8 @@
11:- :~ navhome/'/docs/'
22 navuptwo/'true'
33 next/'true'
4− sort/'1'
5− title/'Hoon Programs'
4+ sort/'21'
5+ title/'2.1 Hoon Programs'
66 ==
77;>
88
@@ -51,7 +51,7 @@ Save this as 'listnum.hoon' in `/home/gen` of your urbit's pier. To run it ente
5151~[1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24]
5252```
5353
54−### Function Programming, Runes, and Whitespace
54+### Functional Programming, Runes, and Whitespace
5555
5656Before going over how the above code works we should point out three things.
5757
docs/tutorials/hoon-ch2/hoon-ch2-10.umd+2−2
@@ -1,8 +1,8 @@
11:- :~ navhome/'/docs/'
22 navuptwo/'true'
33 next/'true'
4− sort/'10'
5− title/'Hoon Standard Library: Trees, Sets, and Maps'
4+ sort/'30'
5+ title/'2.10 Standard Library: Trees, Sets, and Maps'
66 ==
77;>
88
docs/tutorials/hoon-ch2/hoon-ch2-11.umd+27−53
@@ -1,7 +1,7 @@
11:- :~ navhome/'/docs/'
22 navuptwo/'true'
3− sort/'11'
4− title/'Examples'
3+ sort/'31'
4+ title/'2.11 Examples'
55 ==
66;>
77
@@ -422,25 +422,15 @@ Specifically, for each iteration, each dead space becomes alive if and only if i
422422 ##.
423423```
424424
425−1. Write a function `next-generation` that takes nine flag
426− inputs, `nw`, `nc`, `ne`, `cw`, `cc`, `ce`, `sw`, `sc`, and
427− `se`. Produce 'yes' if the center space will be alive in the
428− next generation and 'no' if it will be dead.
425++ Write a function `next-generation` that takes nine flag inputs, `nw`, `nc`, `ne`, `cw`, `cc`, `ce`, `sw`, `sc`, and `se`. Produce 'yes' if the center space will be alive in the next generation and 'no' if it will be dead.
429426
430−1. Write a function `create-board` that takes an integer `n` and
431− produces an `n` by `n` grid of flags, (hereafter,
432− "board"), initialized to 'no'. This grid should be
433− represented as a list of `n` lists of length `n`.
427++ Write a function `create-board` that takes an integer `n` and produces an `n` by `n` grid of flags, (hereafter, "board"), initialized to 'no'. This grid should be represented as a list of `n` lists of length `n`.
434428
435−1. Write a function `toggle-space` that takes a board, a row
436− index, and a column index, and produces a new board,
437− identical to the old except that the state of the space
438− referred to by the row and column indices has been toggled.
429++ Write a function `toggle-space` that takes a board, a row index, and a column index, and produces a new board, identical to the old except that the state of the space referred to by the row and column indices has been toggled.
439430
440−1. Use the following function `print-board` to pretty-print the
441− board. For bonus points, try to follow what it's doing.
431++ Use the following function `print-board` to pretty-print the board. For bonus points, try to follow what it's doing.
442432
443− ```
433+ ```
444434 |= board=(list (list ?))
445435 ^- tang
446436 %+ turn board
@@ -452,23 +442,18 @@ Specifically, for each iteration, each dead space becomes alive if and only if i
452442 ?: space
453443 '# '
454444 '. '
455− ```
456−
457− If you run this function with a board, you'll get a
458− pretty-printable object (a `tang`), but it won't be
459− pretty-printed. When running the generator from the dojo,
460− run `&tang +generator arguments` to mark the result as a
461− `tang`, which will tell the dojo to pretty-print it
462− appropriately.
463−
464−1. Using the functions created in the previous exercises, create
465− a 10 by 10 board, and flip the states of the spaces at
466− coordinates (counting from the top left, indexed from 0)
467− `(2,1)`, `(3,2)`, `(1,3)`, `(2,3)`, and `(3,3)`. Use the
468− pretty printer to print out the board. Your output should be
469− the following:
470−
471− ```
445+ ```
446+
447+ If you run this function with a board, you'll get a
448+ pretty-printable object (a `tang`), but it won't be
449+ pretty-printed. When running the generator from the dojo,
450+ run `&tang +generator arguments` to mark the result as a
451+ `tang`, which will tell the dojo to pretty-print it
452+ appropriately.
453+
454++ Using the functions created in the previous exercises, create a 10 by 10 board, and flip the states of the spaces at coordinates (counting from the top left, indexed from 0) `(2,1)`, `(3,2)`, `(1,3)`, `(2,3)`, and `(3,3)`. Use the pretty printer to print out the board. Your output should be the following:
455+
456+ ```
472457 . . . . . . . . . .
473458 . . # . . . . . . .
474459 . . . # . . . . . .
@@ -479,12 +464,11 @@ Specifically, for each iteration, each dead space becomes alive if and only if i
479464 . . . . . . . . . .
480465 . . . . . . . . . .
481466 . . . . . . . . . .
482− ```
467+ ```
483468
484−1. Write a function `step` that iterates every space on the
485− board. Print out the new board. It should look like this:
469++ Write a function `step` that iterates every space on the board. Print out the new board. It should look like this:
486470
487− ```
471+ ```
488472 . . . . . . . . . .
489473 . . . . . . . . . .
490474 . # . # . . . . . .
@@ -495,22 +479,12 @@ Specifically, for each iteration, each dead space becomes alive if and only if i
495479 . . . . . . . . . .
496480 . . . . . . . . . .
497481 . . . . . . . . . .
498− ```
482+ ```
499483
500− > Note that the spaces on the edge don't have the full nine
501− > neighbors. For now, assume that they're always dead.
484+ > Note that the spaces on the edge don't have the full nine neighbors. For now, assume that they're always dead.
502485
503−1. Write a function `life` that runs the above function `n`
504− times on the board. Observe the board as the game
505− progresses. Congratulations, you've written Conway's Game of
506− Life in Hoon!
486++ Write a function `life` that runs the above function `n` times on the board. Observe the board as the game progresses. Congratulations, you've written Conway's Game of Life in Hoon!
507487
508−1. One common way to handle the edge of the board is to pretend
509− that it "wraps around", forming a torus. In other words, say
510− that the spaces on the left edge of the map are adjacent to
511− the ones on the right edge, and the spaces on the top edge
512− are adjacent to the spaces on the bottom edge. Modify `step`
513− to act this way. Pay special attention to the corners.
488++ One common way to handle the edge of the board is to pretend that it "wraps around", forming a torus. In other words, say that the spaces on the left edge of the map are adjacent to the ones on the right edge, and the spaces on the top edge are adjacent to the spaces on the bottom edge. Modify `step` to act this way. Pay special attention to the corners.
514489
515−1. Modify `create-board` to use `++og` to randomly initialize
516− the board with live or dead spaces.
490++ Modify `create-board` to use `++og` to randomly initialize the board with live or dead spaces.
docs/tutorials/hoon-ch2/hoon-ch2-2.umd+20−20
@@ -1,8 +1,8 @@
11:- :~ navhome/'/docs/'
22 navuptwo/'true'
33 next/'true'
4− sort/'2'
5− title/'Hoon Syntax'
4+ sort/'22'
5+ title/'2.2 Hoon Syntax'
66 ==
77;>
88
@@ -10,9 +10,9 @@
1010
1111The study of Hoon can be divided into two parts: syntax and semantics.
1212
13−The [syntax](https://en.wikipedia.org/wiki/Syntax_(programming_languages)) 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. Failing to follow these rules when writing a program and then trying to run it will result in a syntax error.
13+The [syntax](https://en.wikipedia.org/wiki/Syntax_(programming_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. Failing to follow these rules when writing a program and then trying to run it will result in a syntax error.
1414
15−The [semantics](https://en.wikipedia.org/wiki/Semantics_(computer_science)) of a programming language concerns the meaning of the various parts of that language's code.
15+The [semantics](https://en.wikipedia.org/wiki/Semantics_(computer_science%29) of a programming language concerns the meaning of the various parts of that language's code.
1616
1717In this lesson we cover Hoon's syntax. A strict account of Hoon's syntax would refrain from making any reference at all to semantics, but for ease of exposition we won't be quite so fastidious.
1818
@@ -56,7 +56,7 @@ Note that the list includes two separate whitespace forms: `ace` for a single sp
5656
5757## Expressions of Hoon
5858
59−An [expression](https://en.wikipedia.org/wiki/Expression_(computer_science)) is a combination of characters that the language interprets and evaluates as producing a value. Hoon programs are made up entirely of expressions.
59+An [expression](https://en.wikipedia.org/wiki/Expression_(computer_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.
6060
6161Hoon 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*).
6262
@@ -66,7 +66,7 @@ There are many categories of Hoon expressions: noun literals, wing expressions,
6666
6767A noun is either an atom or a cell. An atom is an unsigned integer and a cell is a pair of nouns.
6868
69−There are [literal](https://en.wikipedia.org/wiki/Literal_(computer_programming)) expressions for each kind of noun. A noun literal is just a notation for representing a fixed noun value.
69+There are [literal](https://en.wikipedia.org/wiki/Literal_(computer_programming%29) expressions for each kind of noun. A noun literal is just a notation for representing a fixed noun value.
7070
7171We start with atom literals. Each of these is a basic expression of Hoon that evaluates to itself. Examples:
7272
@@ -93,7 +93,7 @@ We start with atom literals. Each of these is a basic expression of Hoon that e
93930b1101.1001
9494```
9595
96−Recall from lesson 1.2 (link) 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 XXXX.
96+Recall from [lesson 1.2](../../hoon-ch1/hoon-ch1-2) 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.4](../hoon-ch2-4).
9797
9898Cell literals can be written in Hoon using `[ ]`. Cell literals are complex, because other expressions are put inside the square brackets. Examples:
9999
@@ -111,7 +111,7 @@ Cell literals can be written in Hoon using `[ ]`. Cell literals are complex, be
111111[123 [~zod ~ten] .1.2837]
112112```
113113
114−A murkier case involves putting complex expressions inside square brackets to make a cell. These are valid expressions but they aren't cell literals, naturally:
114+You can also put complex expressions inside square brackets to make a cell. These are valid expressions but they aren't cell literals, naturally:
115115
116116```
117117> [(add 22 33) (mul 22 33)]
@@ -120,7 +120,7 @@ A murkier case involves putting complex expressions inside square brackets to ma
120120
121121### Wings
122122
123−A wing expression is a series of limb expressions separated by `.`. You learned about these in sections 1.3 (link) and 1.4 (link).
123+A wing expression is a series of limb expressions separated by `.`. You learned about these in [sections 1.3](../../hoon-ch1/hoon-ch1-3) and [sections 1.4](../../hoon-ch1/hoon-ch1-4).
124124
125125Let'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:
126126
@@ -134,7 +134,7 @@ Let's start with the base case: a single limb. A limb expression is a trivial w
134134- `mul`
135135- `kebab-case-123`
136136
137−As a special limb we also have `$`. This is the name of the arm in special one-armed cores called "gates". (We covered the role of `$` in lesson 1.5 (link).)
137+As a special limb we also have `$`. This is the name of the arm in special one-armed cores called "gates". (We covered the role of `$` in [lesson 1.5](../../hoon-ch1/hoon-ch1-5).)
138138
139139Wing expressions with multiple limbs are complex expressions. Examples:
140140
@@ -150,7 +150,7 @@ Wing expressions with multiple limbs are complex expressions. Examples:
150150
151151Hoon 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`.
152152
153−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 XXXX.)
153+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.6](../hoon-ch2-6).)
154154
155155### Rune Expressions
156156
@@ -168,7 +168,7 @@ There are two rune syntax forms: *tall* and *flat*. Tall form is usually used f
168168
169169The 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.
170170
171−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 `:-` hoon in tall form:
171+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:
172172
173173```
174174> :- 11 22
@@ -184,18 +184,18 @@ Seeing an example will help you understand the difference. The `:-` rune is use
184184[11 22]
185185```
186186
187−These all do the same thing. The first example shows that, if you really 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.
187+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.
188188
189−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 `:-` hoon in flat-form is:
189+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:
190190
191191```
192192> :-(11 22)
193193[11 22]
194194```
195195
196−This is the preferred way to write a hoon 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.
196+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.
197197
198−Nearly all rune expressions can be written in either form, but there are exceptions. The `|%` and `|_` expressions, for example, can only be written in tall form. (Those (link) are a bit too complicated to fit comfortably on one line anyway.)
198+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.)
199199
200200#### Irregular Forms
201201
@@ -264,7 +264,7 @@ The irregular `( )` gate-calling syntax is versatile -- it is also a shortcut fo
264264
265265The `( )` gate-calling syntax can be used for gates of any other [arity](https://en.wikipedia.org/wiki/Arity) as well.
266266
267−You've already seen two other irregular forms. In lesson 1.5 (link), you made a gate that takes an atom `a` for its sample and returns `a + 1`: `|=(a=@ (add 1 a))`. This expression uses the `|=` rune in flat form.
267+You've already seen two other irregular forms. In [lesson 1.5](../../hoon-ch1/hoon-ch1-5), you made a gate that takes an atom `a` for its sample and returns `a + 1`: `|=(a=@ (add 1 a))`. This expression uses the `|=` rune in flat form.
268268
269269```
270270> =inc |=(a=@ (add 1 a))
@@ -308,7 +308,7 @@ The `a=15` expression is the irregular form of `^=(a 15)`:
30830835
309309```
310310
311−You can find other irregular forms in the irregular expression reference document (link).
311+You can find other irregular forms in the irregular expression [reference document](../../../reference/irregular).
312312
313313### Expressions That Are Only Irregular
314314
@@ -349,7 +349,7 @@ b=[16 18]
349349[16 18]
350350```
351351
352−To see other irregular expressions, check the irregular expression reference document (link).
352+To see other irregular expressions, check the irregular expression [reference document](../../../reference/irregular).
353353
354354## Hoon Style
355355
@@ -444,7 +444,7 @@ In optimal usage of backstep indentation the most complicated subexpressions are
444444
445445#### Running
446446
447−A *running* body doesn't have a fixed number of subexpressions; hoons with running bodies can be arbitrarily long.
447+A *running* body doesn't have a fixed number of subexpressions; expressions with running bodies can be arbitrarily long.
448448
449449To indicate the end of such expressions in tall form, use the `==` rune. The first subexpression is two spaces after the initial rune, and all others are indented to line up with the first. The terminating `==` should align vertically with the initial rune. In flat form, parentheses are used around the expression body, so the terminating `==` is unnecessary.
450450
docs/tutorials/hoon-ch2/hoon-ch2-3.umd+7−7
@@ -1,14 +1,14 @@
11:- :~ navhome/'/docs/'
22 navuptwo/'true'
33 next/'true'
4− sort/'3'
5− title/'Simple One-Gate Programs'
4+ sort/'23'
5+ title/'2.3 Simple One-Gate Programs'
66 ==
77;>
88
99# Simple One-Gate Programs
1010
11−In this lesson we'll try to cover enough basic Hoon so that you can write (and understand!) your own simple programs. Each of the programs given in this lesson defines a gate. (Gates are one-armed cores of Hoon that can be used as functions -- this is covered in lesson 1.5 (link).)
11+In this lesson we'll try to cover enough basic Hoon so that you can write (and understand!) your own simple programs. Each of the programs given in this lesson defines a gate. (Gates are one-armed cores of Hoon that can be used as functions -- this is covered in [lesson 1.5](../../hoon-ch1/hoon-ch1-5).)
1212
1313For each program we encourage you to: (1) write out the program yourself, (2) save it to the `/home/gen` directory of your urbit's pier, and (3) run it from the dojo. The best way to learn to program in Hoon is by getting your hands dirty.
1414
@@ -20,7 +20,7 @@ Let's look at a really simple gate: `|=(a=@ 15)`. This gate takes any atom as i
2020
2121The `|=` rune takes two subexpressions. The first must indicate a type, and the second may evaluate to any value. The first defines the gate's sample type and possibly binds a face to it, and the second defines the output of the gate. In the example `|=(a=@ 15)` the `|=` subexpressions are `a=@` and `15`.
2222
23−The following characters represent basic Hoon types: `@` for atoms, `^` for cells, `?` for flags, and `*` for nouns. You should already know what atoms, cells, and nouns are. (See lesson 1.2 (link) if you need a reminder.) There are two values for the `?` type: `%.y` for yes, and `%.n` for no. In other words, `?` is for the [Boolean values](https://en.wikipedia.org/wiki/Boolean_data_type) of Hoon.
23+The following characters represent basic Hoon types: `@` for atoms, `^` for cells, `?` for flags, and `*` for nouns. You should already know what atoms, cells, and nouns are. (See [lesson 1.2](../../hoon-ch1/hoon-ch1-2) if you need a reminder.) There are two values for the `?` type: `%.y` for yes, and `%.n` for no. In other words, `?` is for the [Boolean values](https://en.wikipedia.org/wiki/Boolean_data_type) of Hoon.
2424
2525You could have picked a different type for the first subexpression of `|=(a=@ 15)` and left off the face. To illustrate this let's call different versions of the gate with the `(gate arg)` function call syntax:
2626
@@ -561,7 +561,7 @@ This rune is often used for modifying the value of a face whose value was set be
561561
562562## Recursion
563563
564−How do we do loops in Hoon? Like other functional programming languages Hoon uses [recursion](https://en.wikipedia.org/wiki/Recursion_(computer_science)). In rough terms, a recursive function solves a problem in part by calling on itself to solve a slightly easier or smaller case of the same problem. The self-calling loop continues until the simplified problem is so simple that it has a trivial solution.
564+How do we do loops in Hoon? Like other functional programming languages Hoon uses [recursion](https://en.wikipedia.org/wiki/Recursion_(computer_science%29). In rough terms, a recursive function solves a problem in part by calling on itself to solve a slightly easier or smaller case of the same problem. The self-calling loop continues until the simplified problem is so simple that it has a trivial solution.
565565
566566Seeing an example will make this process easier to understand.
567567
@@ -634,7 +634,7 @@ The `$( )` syntax is an irregular form of the the `%=` rune. We can rewrite tha
634634
635635This version is precisely equivalent to the old one. The first `%=` subexpression is for a wing. In the program above, this is just `$`. The other subexpressions of `%=` indicate the changes to be made upon resolution to the wing. You can make as many of these changes as desired when using `%=`, so the expression is ended with `==`.
636636
637−Remember from lessons 1.4-1.5 (links) that wing resolution works in two different ways. If the wing resolves to a leg, that fragment of the subject is returned. If the wing resolves to an arm, the arm is evaluated with its parent core as the subject. In lesson 1.5 (link) you learned that `$` is the special name of the arm of a gate. (Remember, a gate is a one-armed core with a sample.) Because we wrote `add.hoon` with `|=` it produces a gate. The `%=` expression above thus evaluates the `$` arm of the gate, but only after having made changes to the parent core: `a` is incremented, and `b` is decremented.
637+Remember from lessons [1.4](../../hoon-ch1/hoon-ch1-4) and [1.5](../../hoon-ch1/hoon-ch1-5) that wing resolution works in two different ways. If the wing resolves to a leg, that fragment of the subject is returned. If the wing resolves to an arm, the arm is evaluated with its parent core as the subject. In [lesson 1.5](../../hoon-ch1/hoon-ch1-5) you learned that `$` is the special name of the arm of a gate. (Remember, a gate is a one-armed core with a sample.) Because we wrote `add.hoon` with `|=` it produces a gate. The `%=` expression above thus evaluates the `$` arm of the gate, but only after having made changes to the parent core: `a` is incremented, and `b` is decremented.
638638
639639### Decrement
640640
@@ -736,7 +736,7 @@ Write a program that takes a number `n` and returns `%.y` if it's prime, and `%.
736736
737737Let's write a Hoon implementation of [FizzBuzz](https://en.wikipedia.org/wiki/Fizz_buzz). Fizzbuzz takes some number `n` and then makes a list of numbers from `1` to `n`, except that numbers evenly divisible by `3` are replaced with 'Fizz', numbers evenly divisible by `5` are replaced with 'Buzz', and numbers evenly divisible by both are replaced with 'FizzBuzz'.
738738
739−You already saw a program that produces a list of atoms from `1` to `n` in lesson 2.1 (link), `listnum.hoon`:
739+You already saw a program that produces a list of atoms from `1` to `n` in [lesson 2.1](../hoon-ch2-1), `listnum.hoon`:
740740
741741```
742742|= end=@ :: 1
docs/tutorials/hoon-ch2/hoon-ch2-4.umd+6−6
@@ -1,14 +1,14 @@
11:- :~ navhome/'/docs/'
22 navuptwo/'true'
33 next/'true'
4− sort/'4'
5− title/'Intro to Types: Atoms, Auras, and Simple Cell Types'
4+ sort/'24'
5+ title/'2.4 Atoms, Auras, and Simple Cell Types'
66 ==
77;>
88
9−# Types Pt. 1: Atoms, Auras, and Simple Cell Types
9+# Atoms, Auras, and Simple Cell Types
1010
11−Like most modern high-level programming languages, Hoon has a type system. Because Hoon is a functional programming language, its type system differs somewhat from those of non-functional languages. In the next few lessons we'll go over Hoon's type system and point out some of its distinctive features. Certain advanced topics (e.g. type [polymorphism](https://en.wikipedia.org/wiki/Polymorphism_(computer_science))) won't be addressed until a later chapter.
11+Like most modern high-level programming languages, Hoon has a type system. Because Hoon is a functional programming language, its type system differs somewhat from those of non-functional languages. In the next few lessons we'll go over Hoon's type system and point out some of its distinctive features. Certain advanced topics (e.g. type [polymorphism](https://en.wikipedia.org/wiki/Polymorphism_(computer_science%29)) won't be addressed until a later chapter.
1212
1313A type is ordinarily understood to be a set of values. Examples: the set of all atoms is a type, the set of all cells is a type, and so on.
1414
@@ -22,13 +22,13 @@ In this lesson we'll cover (1)-(4) as they pertain to atoms and simple cell type
2222
2323## Atoms and Auras
2424
25−In lesson 1.2 (link) we defined what an atom is: any unsigned integer. In this lesson we'll expand on that discussion, going over how Hoon's type system implements auras.
25+In [lesson 1.2](../../hoon-ch1/hoon-ch1-2) we defined what an atom is: any unsigned integer. In this lesson we'll expand on that discussion, going over how Hoon's type system implements auras.
2626
2727In the most straightforward sense, atoms simply are unsigned integers. But they can also be interpreted as representing signed integers, ASCII symbols, floating-point values, dates, binary numbers, hexadecimal numbers, and more. Every atom is, in and of itself, just an unsigned integer; but Hoon keeps track of type information about each atom, and this info tells Hoon how to interpret the atom in question.
2828
2929The piece of type information that determines how Hoon interprets an atom is called an *aura*. The set of all atoms is indicated with the symbol `@`. An aura is indicated with `@` followed by some letters, e.g., `@ud` for unsigned decimal. Accordingly, the Hoon type system does more than track sets of values. It also tracks certain other relevant metadata about how those values are to be interpreted.
3030
31−How is aura information generated so that it can be tracked? One way involves *type inference*. In certain cases Hoon's type system can infer the type of an expression using syntactic clues. In the most straightforward case of type inference, the expression is simply data as a [literal](https://en.wikipedia.org/wiki/Literal_(computer_programming)). Hoon recognizes the aura literal syntax and infers that the data in question is an atom with the aura associated with that syntax.
31+How is aura information generated so that it can be tracked? One way involves *type inference*. In certain cases Hoon's type system can infer the type of an expression using syntactic clues. In the most straightforward case of type inference, the expression is simply data as a [literal](https://en.wikipedia.org/wiki/Literal_(computer_programming%29). Hoon recognizes the aura literal syntax and infers that the data in question is an atom with the aura associated with that syntax.
3232
3333To see the inferred type of a literal expression in the dojo, use the `?` operator. (Note: this operator isn't part of the Hoon programming language; it's a dojo-only tool. It's a very useful tool for learning Hoon, however.)
3434
docs/tutorials/hoon-ch2/hoon-ch2-5.umd+4−4
@@ -1,8 +1,8 @@
11:- :~ navhome/'/docs/'
22 navuptwo/'true'
33 next/'true'
4− sort/'5'
5− title/'Type Checking and Type Inference'
4+ sort/'25'
5+ title/'2.5 Type Checking and Type Inference'
66 ==
77;>
88
@@ -144,7 +144,7 @@ It's helpful to know *that* Hoon infers the type of any given expression, but it
144144
145145### Literals
146146
147−[Literals](https://en.wikipedia.org/wiki/Literal_(computer_programming)) are expressions that represent fixed values. Some examples (with the inferred type on the right):
147+[Literals](https://en.wikipedia.org/wiki/Literal_(computer_programming%29) are expressions that represent fixed values. Some examples (with the inferred type on the right):
148148
149149```
150150123 @ud
@@ -482,7 +482,7 @@ This code is a little more tricky. The basic idea, however, is simple. We have
482482
483483What makes this program is little harder to follow is that it has a recursion call within a recursion call. The first recursion expression on line 6 makes changes to two face values: `c`, the counter, and `a`, the input noun. The new value for `c` defined in line 7 is another recursion call (this time in irregular syntax). The new value for `c` is to be: the result of running the same function on the the head of `a`, `-.a`, and with `1` added to `c`. We add `1` because we know that `a` must be a cell. Otherwise, we're asking for the number of cells in the rest of `-.a`.
484484
485−Once that new value for `c` is computed from the head of `a`, we're ready to check the tail of `a`, `+.a`. We'e already got everything we want from `-.a`, so we throw that away and replace `a` with `+.a`.
485+Once that new value for `c` is computed from the head of `a`, we're ready to check the tail of `a`, `+.a`. We've already got everything we want from `-.a`, so we throw that away and replace `a` with `+.a`.
486486
487487#### 'Samefringe' Exercise
488488
docs/tutorials/hoon-ch2/hoon-ch2-6.umd+4−4
@@ -1,8 +1,8 @@
11:- :~ navhome/'/docs/'
22 navuptwo/'true'
33 next/'true'
4− sort/'6'
5− title/'Structures and Complex Types'
4+ sort/'26'
5+ title/'2.6 Structures and Complex Types'
66 ==
77;>
88
@@ -33,7 +33,7 @@ Structures play different roles in different code contexts. First, let's look a
3333
3434The `@`, `^`, and `[? *]` subexpressions have no effect at all on the final value produced.
3535
36−It's important to understand that these casts don't affect the [runtime](https://en.wikipedia.org/wiki/Run_time_(program_lifecycle_phase)) semantics of a program at all. They affect only the compiler behavior at compile time. The compiler does these type-checks when compiling, but the resulting code has no value corresponding to the types above.
36+It's important to understand that these casts don't affect the [runtime](https://en.wikipedia.org/wiki/Run_time_(program_lifecycle_phase%29) semantics of a program at all. They affect only the compiler behavior at compile time. The compiler does these type-checks when compiling, but the resulting code has no value corresponding to the types above.
3737
3838Accordingly, the structures produced by the type subexpressions above aren't part of the program's runtime semantics. They are compile-time values only.
3939
@@ -282,7 +282,7 @@ nest-fail
282282
283283### `$?` Define a Union
284284
285−In set theory, the [union](https://en.wikipedia.org/wiki/Union_(set_theory)) of sets A and B is a set containing all members of both A and B. For example, the union of the set of even integers and the set of odd integers is the set of all integers.
285+In set theory, the [union](https://en.wikipedia.org/wiki/Union_(set_theory%29) of sets A and B is a set containing all members of both A and B. For example, the union of the set of even integers and the set of odd integers is the set of all integers.
286286
287287It's useful to be able to define a type that is the union of other types. The `$?` rune lets us do this. The `$?` takes a series of subexpressions, each of which must be a structure. The resulting type is the union of all types indicated in the expression. For example, `$?(%green %yellow %red)` is the union of the types indicated by `%green`, `%yellow`, and `%red`.
288288
docs/tutorials/hoon-ch2/hoon-ch2-7.umd+2−2
@@ -1,8 +1,8 @@
11:- :~ navhome/'/docs/'
22 navuptwo/'true'
33 next/'true'
4− sort/'7'
5− title/'Cores'
4+ sort/'27'
5+ title/'2.7 Cores'
66 ==
77;>
88
docs/tutorials/hoon-ch2/hoon-ch2-8.umd+4−4
@@ -1,8 +1,8 @@
11:- :~ navhome/'/docs/'
22 navuptwo/'true'
33 next/'true'
4− sort/'8'
5− title/'Cores Again'
4+ sort/'28'
5+ title/'2.8 Cores Again'
66 ==
77;>
88
@@ -151,7 +151,7 @@ Another way to cast for the type of the parent core of an arm is to use `_+>.$`.
151151
152152But what does it mean? First, the `_` indicates the irregular form of the `$_` rune. That is, `_+>.$` evaluates `+>.$` and produces a type from the resulting noun.
153153
154−What is `+>.$`? This is a wing of two limbs, `+>` and `$`. As you saw in section 1.4, `+>` is the lark syntax for `+7`, i.e., address space `7`. And `$` is the name of the lone arm in a gate. Whenever an arm name is used in a wing expression and isn't the left-most limb in the series, it evaluates to its parent core. The parent core of `$` is the gate itself.
154+What is `+>.$`? This is a wing of two limbs, `+>` and `$`. As you saw in [section 1.4](../../hoon-ch1/hoon-ch1-4), `+>` is the lark syntax for `+7`, i.e., address space `7`. And `$` is the name of the lone arm in a gate. Whenever an arm name is used in a wing expression and isn't the left-most limb in the series, it evaluates to its parent core. The parent core of `$` is the gate itself.
155155
156156Thus, `+>.$` evaluates to `+7` of the gate containing `$`. For our `plus` arm, the gate in question is the one defined by:
157157
@@ -278,7 +278,7 @@ For each random number generation, the `rng` core has a different seed number.
278278\/ \/
279279```
280280
281−`eny` is an environment value for [entropy](https://en.wikipedia.org/wiki/Entropy_(computing)). Its value changes every time it's evaluated. We can use `eny` to produce a seed value for `rng` and retry the `=^` expression from above:
281+`eny` is an environment value for [entropy](https://en.wikipedia.org/wiki/Entropy_(computing%29). Its value changes every time it's evaluated. We can use `eny` to produce a seed value for `rng` and retry the `=^` expression from above:
282282
283283```
284284> =rng ~(. og eny)
docs/tutorials/hoon-ch2/hoon-ch2-9.umd+3−3
@@ -1,12 +1,12 @@
11:- :~ navhome/'/docs/'
22 navuptwo/'true'
33 next/'true'
4− sort/'9'
5− title/'Hoon Standard Library: Lists'
4+ sort/'29'
5+ title/'2.9 Standard Library: Lists'
66 ==
77;>
88
9−# Hoon Standard Library: Lists
9+# Standard Library: Lists
1010
1111In this lesson we'll review what a list is and then cover many of the list-related functions in the Hoon standard library.
1212
docs/tutorials/internals.umd+2−2
@@ -35,7 +35,7 @@ for Unix.
3535
3636Here's a duct that was recently observed in the wild:
3737
38−````
38+```
3939~[
4040 /g/a/~zod/4_shell_terminal/u/time
4141 /g/a/~zod/shell_terminal/u/child/4/main
@@ -43,7 +43,7 @@ Here's a duct that was recently observed in the wild:
4343 /d/term-mess
4444 //term/1
4545]
46−````
46+```
4747
4848This is the duct the timer vane receives when "timer" sample app asks
4949the timer vane to set a timer. This is also the duct over which the