on master help sign in
remaining stdlib links
commit6ec04a9ecfbdd82e77d22f62061d19c56d3e1422 authordrbeefsupreme <drbeefsupreme@discordja.net> dateFri 19 Feb 2021, 14:20 (6 years ago) parentbc879f1
5 files changed+14−6
hoon/hoon-school/arms-and-cores.md+1−1 hoon/hoon-school/libraries.md+9−1 hoon/hoon-school/list-of-numbers.md+1−1 hoon/hoon-school/lists.md+1−1 hoon/hoon-school/trees-sets-and-maps.md+2−2
hoon/hoon-school/arms-and-cores.md+1−1
@@ -574,7 +574,7 @@ and so on, down to
574574 $@(~ [~ u=item])
575575--
576576```
577−This core contains the arms in parts [1a-1c of the standard library documentation](@/docs/reference/library/1a.md). If you count them, there are 41 arms in the core from `++ add` down to `++ unit`. We again can see this fact reflected in the dojo by looking at the subject of `add`.
577+This core contains the arms in parts [1a-1c of the standard library documentation](@/docs/hoon/reference/stdlib/1a.md). If you count them, there are 41 arms in the core from `++ add` down to `++ unit`. We again can see this fact reflected in the dojo by looking at the subject of `add`.
578578```
579579> ..add
580580<41.mac 1.ane $141>
hoon/hoon-school/libraries.md+9−1
@@ -124,7 +124,15 @@ The `?+` rune is the rune to switch against a value with a default. The default
124124 (slag n d)
125125```
126126
127−`draw` takes two arguments: `n`, a number; and `d`, a `deck`. It's going to produce a cell of two `decks`. The cell is created using `scag` and `slag`. [`scag`](https://urbit.org/docs/reference/library/2b/#scag) is a standard-library gate produces the first `n` elements from a list, and [`slag`](https://urbit.org/docs/reference/library/2b/#slag) is a standard-library gate that produces the remaining elements of a list starting after the `n`th element. So we use `scag` to produce the drawn hand of `n` cards in the head of the cell as `hand`, and `slag` to produce the remaining deck in the tail of the cell as `rest`.
127+`draw` takes two arguments: `n`, a number; and `d`, a `deck`. It's going to
128+produce a cell of two `decks`. The cell is created using `scag` and `slag`.
129+[`scag`](@/docs/hoon/reference/stdlib/2b/#scag) is a
130+standard-library gate produces the first `n` elements from a list, and
131+[`slag`](@/docs/hoon/reference/stdlib/2b/#slag) is a
132+standard-library gate that produces the remaining elements of a list starting
133+after the `n`th element. So we use `scag` to produce the drawn hand of `n` cards
134+in the head of the cell as `hand`, and `slag` to produce the remaining deck in
135+the tail of the cell as `rest`.
128136
129137```hoon
130138++ shuffle-deck
hoon/hoon-school/list-of-numbers.md+1−1
@@ -107,7 +107,7 @@ $(count (add 1 count))
107107
108108The 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/hoon/reference/stdlib/1a.md) of the standard library documentation.
111111
112112## Explanation
113113
hoon/hoon-school/lists.md+1−1
@@ -299,7 +299,7 @@ c
299299
300300## Using `hoon.hoon` to Learn Hoon
301301
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).
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/hoon/reference/stdlib/2b.md) (and elsewhere).
303303
304304## Additional Exercises
305305
hoon/hoon-school/trees-sets-and-maps.md+2−2
@@ -88,7 +88,7 @@ $(hay r.hay)
8888
8989## Sets
9090
91−Use `set` to create a data structure for a set of values, e.g., `(set @)` for a set of atoms. The `in` [core](/docs/glossary/core/) in the Hoon standard library contains the various functions for operating on sets. See the standard library reference documentation for sets [here](@/docs/reference/library/2h.md).
91+Use `set` to create a data structure for a set of values, e.g., `(set @)` for a set of atoms. The `in` [core](/docs/glossary/core/) in the Hoon standard library contains the various functions for operating on sets. See the standard library reference documentation for sets [here](@/docs/hoon/reference/stdlib/2h.md).
9292
9393As with `list`s and `tree`s, there are two categories of sets: null `~`, and non-null. Hoon implements sets using trees for the underlying noun.
9494
@@ -237,7 +237,7 @@ Use `map` to create a set of key-value pairs, e.g., `(map @tas *)` for a set of
237237
238238One example use case is for storing customer information as a set of pairs: `(map [employee-name employee-data])`.
239239
240−The `by` core in the Hoon standard library contains the various functions for operating on maps. Many of these functions are similar to the set functions of the `in` core. See the standard library reference documentation for maps [here](@/docs/reference/library/2i.md). As was the case with sets, the underlying noun of each map is a tree.
240+The `by` core in the Hoon standard library contains the various functions for operating on maps. Many of these functions are similar to the set functions of the `in` core. See the standard library reference documentation for maps [here](@/docs/hoon/reference/stdlib/2i.md). As was the case with sets, the underlying noun of each map is a tree.
241241
242242Two common methods for populating a map include (1) creating it from a list of key-value cells using the `my` function, and (2) inserting items into a map using the `put` arm of the `by` core.
243243