@@ -16,9 +16,8 @@ There are three kinds of generators: naked, `%say`, and `%ask`. There also used
16### Naked Generators
16### Naked Generators
18A naked generator is simply a `gate`; that is, it is an anonymous function that
18A naked generator is simply a `gate`; that is, it is an anonymous function that
19−takes a `sample` (argument) and produces a [noun](/docs/glossary/noun/). All you need to do is write a
19+takes a `sample` (argument) and produces a [noun](/docs/glossary/noun/). All you
20−`gate` and put it into a file in the `/gen` directory. Let's take a look at a
20+need to do is write a `gate` and put it into a file in the `/gen` directory of a desk on your ship. Let's take a look at a very simple one:
@@ -26,7 +25,8 @@ a
28This generator takes one argument of any noun and produces it without any
27This generator takes one argument of any noun and produces it without any
28+changes. Put this into a file named `echo.hoon` in the `/gen` directory of your
29−changes. Once you put this into a file named `echo.hoon` in the `/gen` directory, you must make your ship recognize the change by inputting `|commit %home` in the dojo. You can then run it from the dojo:
29+`%base` desk. You must make your ship recognize the change by inputting `|commit %base` in the dojo. You can then run it from the dojo:
@@ -64,7 +64,7 @@ generator to see something more familiar:
66Now let's create a generator with two arguments instead of one. Save the code
66Now let's create a generator with two arguments instead of one. Save the code
67−below as `add.hoon` in the `/gen` directory.
67+below as `add.hoon` in the `/gen` directory of your `%base` desk.
70|= [a=@ud b=@ud]
70|= [a=@ud b=@ud]
@@ -104,7 +104,7 @@ So, more formally, a `%say` generator is a `cell`. The head of that cell is the
104output data and the `mark` describing that data.
104output data and the `mark` describing that data.
106Below is an example of a `%say` generator. Save it to `add.hoon` in the `/gen`
106Below is an example of a `%say` generator. Save it to `add.hoon` in the `/gen`
107−directory.
107+directory of your `%base` desk.
@@ -133,7 +133,7 @@ Recall that the rune `:-` produces a cell, with the first following expression
133as its head and the second following expression as its tail.
133as its head and the second following expression as its tail.
135The expression above creates a cell with `%say` as the head. The tail is
135The expression above creates a cell with `%say` as the head. The tail is
136−the `|= *` expression on the line that follows.
136+the `|= *` expression on the line that follows.
@@ -141,10 +141,10 @@ the `|= *` expression on the line that follows.
141(add 40 2)
141(add 40 2)
144−`|= *` constructs a [gate](/docs/glossary/gate/) that takes a noun. This [gate](/docs/glossary/gate/) will itself produce a
144+`|= *` constructs a [gate](/docs/glossary/gate/) that takes a noun. This [gate](/docs/glossary/gate/) will itself produce a
145`cask`, which is cell formed by the prepending `:-`. The head of that `cask` is
145`cask`, which is cell formed by the prepending `:-`. The head of that `cask` is
146`%noun` and the tail is the rest of the program, `(add 40 2)`. The tail of the
146`%noun` and the tail is the rest of the program, `(add 40 2)`. The tail of the
147−`cask` will be our actual data produced by the body of the program: in this
147+`cask` will be our actual data produced by the body of the program: in this
148case, just adding 40 and 2 together.
148case, just adding 40 and 2 together.
150#### `%say` generators with arguments
150#### `%say` generators with arguments
@@ -216,7 +216,7 @@ second part, besides its position:
218Let's look at an example that uses all three parts. Save the code below in a
218Let's look at an example that uses all three parts. Save the code below in a
219−file called `dice.hoon` in your `/gen` directory.
219+file called `dice.hoon` in the `/gen` directory of your `%base` desk.
@@ -311,7 +311,7 @@ to explain how this kind of generator works.
311##### `%ask` example
311##### `%ask` example
313The code below is an `%ask` generator that checks if the user inputs "blue" when
313The code below is an `%ask` generator that checks if the user inputs "blue" when
314−prompted. Save it as `axe.hoon` in `/gen`.
314+prompted. Save it as `axe.hoon` in the `/gen` directory of your `%base` desk.
@@ -379,7 +379,7 @@ This code might be familiar. Just as with their `%say` cousins, `%ask`
379generators need to produce a `cell`, the head of which specifies what kind of
379generators need to produce a `cell`, the head of which specifies what kind of
380generator we are running.
380generator we are running.
382−With `|= *`, we create a gate and ignore the standard arguments we are given,
382+With `|= *`, we create a gate and ignore the standard arguments we are given,
383because we're not using them.
383because we're not using them.
@@ -434,7 +434,6 @@ use to prompt the user. In the case of our example, we use `"color: "`.
434**`produce`** is used to construct the output of the generator. In our example,
434**`produce`** is used to construct the output of the generator. In our example,
435we produce a `tang`.
435we produce a `tang`.
@@ -458,4 +457,4 @@ This is a [known issue](https://github.com/urbit/arvo/issues/840) to be resolved
459## Conclusion
458## Conclusion
461−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](/docs/glossary/door/). If you can master these concepts you should have little or no trouble learning to write substantial Hoon programs.
460+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](/docs/glossary/door/). If you can master these concepts you should have little or no trouble learning to write substantial Hoon programs.