@@ -40,11 +40,11 @@ imported at the beginning of an agent with the
40[faslus](/docs/arvo/ford/ford#ford-runes) (`/+`) rune.
40[faslus](/docs/arvo/ford/ford#ford-runes) (`/+`) rune.
42The library is a wet gate which takes two arguments: `agent` and `help`. The
42The library is a wet gate which takes two arguments: `agent` and `help`. The
43−first is your agent core itself, and the second is a `?`. If `help` is `%.y`, it
43+first is your agent core itself, and the second is a `?`. If `help` is `%.y` (equivalently, `%&`), it
44−will crash in all cases. If `help` is `%.n`, it will use its defaults. You would
44+will crash in all cases. If `help` is `%.n` (equivalently, `%|`), it will use its defaults. You would
45almost always have `help` as `%.n`.
45almost always have `help` as `%.n`.
47−The wet gate returns a `agent:gall` `door` with a sample of `bowl:gall` - a
47+The wet gate returns a `agent:gall` door with a sample of `bowl:gall` - a
48typical agent core. Usually you would define an alias for it in a virtual arm
48typical agent core. Usually you would define an alias for it in a virtual arm
49([explained below](#virtual-arms)) so it's simple to call.
49([explained below](#virtual-arms)) so it's simple to call.
@@ -52,7 +52,7 @@ typical agent core. Usually you would define an alias for it in a virtual arm
53The `dbug` library lets you inspect the state and `bowl` of your agent from the
53The `dbug` library lets you inspect the state and `bowl` of your agent from the
54dojo. It includes an `agent:dbug` function which wraps your whole `agent:gall`
54dojo. It includes an `agent:dbug` function which wraps your whole `agent:gall`
55−`door`, adding its extra debugging functionality while transparently passing
55+door, adding its extra debugging functionality while transparently passing
56events to your agent for handling like usual.
56events to your agent for handling like usual.
58To use it, you just import `dbug` with a
58To use it, you just import `dbug` with a
@@ -92,21 +92,21 @@ if you include a scry endpoint with a path of `/x/dbug/state`, it will use that
94We haven't yet covered some of the concepts described here, so don't worry if
94We haven't yet covered some of the concepts described here, so don't worry if
95−you don't fully understand `%dbug`'s functionality - you can refer back here
95+you don't fully understand `dbug`'s functionality - you can refer back here
98## Virtual arms
98## Virtual arms
100An agent core must have exactly ten arms. However, there's a special kind of
100An agent core must have exactly ten arms. However, there's a special kind of
101"virtual arm" that can be added without actually increasing the core's arm
101"virtual arm" that can be added without actually increasing the core's arm
102−count. A virtual arm is created with the
102+count, since it really just adds code to the other arms in the core. A virtual arm is created with the
103[lustar](/docs/hoon/reference/rune/lus#-lustar) (`+*`) rune, and its purpose is
103[lustar](/docs/hoon/reference/rune/lus#-lustar) (`+*`) rune, and its purpose is
104−to define _aliases_. It takes a list of pairs of names (aliases) and hoon
104+to define _deferred expressions_. It takes a list of pairs of names and Hoon
105−expressions. When compiled, the aliases defined in the virtual arm are
105+expressions. When compiled, the deferred expressions defined in the virtual arm are
106implicitly inserted at the beginning of every other arm of the core, so they all
106implicitly inserted at the beginning of every other arm of the core, so they all
107−have access to them.
107+have access to them. Each time a name in a `+*` is called, the associated Hoon is evaluated in its place, similar to lazy evaluation except it is re-evaluated whenever needed. See the [tistar](/docs/hoon/reference/rune/tis#-tistar) reference for more information on deferred expressions.
109−A virtual arm in an agent might look something like this:
109+A virtual arm in an agent often looks something like this:
@@ -114,8 +114,8 @@ A virtual arm in an agent might look something like this:
114 hc ~(. +> bowl)
114 hc ~(. +> bowl)
117−`this`, `def` and `hc` are the aliases, and next to each one is the hoon
117+`this`, `def` and `hc` are the deferred expressions, and next to each one is the Hoon
118−expresion it's aliasing. Notice that unlike most things that take _n_ arguments,
118+expression it evaluates whenever called. Notice that unlike most things that take _n_ arguments,
119a virtual arm is not terminated with a `==`. You can define as many aliases as
119a virtual arm is not terminated with a `==`. You can define as many aliases as
120you like. The three in this example are conventional ones you'd use in most
120you like. The three in this example are conventional ones you'd use in most
121agents you write. Their purposes are:
121agents you write. Their purposes are:
@@ -203,8 +203,8 @@ the build system will do that for us. In this case we've just added a single
203After that core, we call `agent:dbug` with our whole agent core as its argument.
203After that core, we call `agent:dbug` with our whole agent core as its argument.
204This allows us to use the `dbug` features described earlier.
204This allows us to use the `dbug` features described earlier.
206−Inside our agent `door`, we've added an extra virtual arm and defined a couple
206+Inside our agent door, we've added an extra virtual arm and defined a couple
207−of aliases:
207+deferred expressions:
@@ -212,9 +212,9 @@ of aliases:
214In most of the arms, you see we've been able to replace the dummy code with
214In most of the arms, you see we've been able to replace the dummy code with
215−simple calls to the corresponding arms of `default-agent`, which we set up and
215+simple calls to the corresponding arms of `default-agent`, which we set up as a deferred
216−aliased as `def` in the virtual arm. We've also replaced the old `..on-init`
216+expression named `def` in the virtual arm. We've also replaced the old `..on-init`
217−with our alias `this` in the `on-init` arm as an example - it makes things a bit
217+with our deferred expression named `this` in the `on-init` arm as an example - it makes things a bit
220You can save the code above in `/app/skeleton.hoon` of your `%base` desk like
220You can save the code above in `/app/skeleton.hoon` of your `%base` desk like
@@ -262,15 +262,15 @@ idea of its basic usage.
263The key takeaways are:
263The key takeaways are:
265−- Libraries can be imported with `/+`.
265+- Libraries are imported with `/+`.
266−- `default-agent` is a library that provides default behaviours for Gall agent
266+- `default-agent` is a library that provides default behaviors for Gall agent
268- `dbug` is a library that lets you inspect the state and `bowl` of an agent
268- `dbug` is a library that lets you inspect the state and `bowl` of an agent
269 from the dojo, with the `+dbug` generator.
269 from the dojo, with the `+dbug` generator.
270−- Convenient aliases for hoon expressions can be defined in a virtual arm with
270+- Convenient deferred expressions for Hoon expressions can be defined in a virtual arm with
271 the [lustar](/docs/hoon/reference/rune/lus#-lustar) (`+*`) rune.
271 the [lustar](/docs/hoon/reference/rune/lus#-lustar) (`+*`) rune.
272−- `this` is a conventional alias for the agent core itself.
272+- `this` is a conventional deferred expression name for the agent core itself.
273−- `def` is a conventional alias for accessing arms in the `default-agent`
273+- `def` is a conventional deferred expression name for accessing arms in the `default-agent`
275- Extra cores can be composed into the subject of the agent core. The
275- Extra cores can be composed into the subject of the agent core. The
276 composition is done implicitly by the build system. Typically we'd include one
276 composition is done implicitly by the build system. Typically we'd include one