@@ -4,6 +4,8 @@ weight = 10
44template = "doc.html"
55+++
66
7+In this lesson we'll look at the basic type and structure of a Gall agent.
8+
79A Gall agent is a `door` with exactly ten arms. Each arm is responsible for
810handling certain kinds of events that Gall feeds in to the agent. A `door` is
911just a `core` with a sample - it's made with the
@@ -67,13 +69,13 @@ documentation](/docs/arvo/gall/data-types#bowl).
6769
6870If you've worked through [Hoon School](/docs/hoon/hoon-school/intro), you may
6971recall that a core is a cell of `[battery payload]`. The battery is the core
70−itself compiled into nock, and the payload is the subject which it operates on.
72+itself compiled to nock, and the payload is the subject which it operates on.
7173
7274For an agent, the payload will at least contain the bowl, the usual standard
73−library functions, and the **state** of the agent. If your agent were for an
74−address book app, it might keep a `map` of ships to address book entries. It
75−might add entries, delete entries, and modify entries. This address book `map`
76−would be part of the state stored in the payload.
75+library functions, and the **state** of the agent. For example, if your agent
76+were for an address book app, it might keep a `map` of ships to address book
77+entries. It might add entries, delete entries, and modify entries. This address
78+book `map` would be part of the state stored in the payload.
7779
7880## Transition function
7981
@@ -81,8 +83,8 @@ If you recall from the prologue, the whole Arvo operating system works on the
8183basis of a simple transition function `(event, oldState) -> (effects, newState)`. Gall agents also function the same way. Eight of an agent's ten arms
8284produce the same thing, a cell of:
8385
84−- Head: A list of effects called `card`s (which we'll discuss later).
85−- Tail: A new agent core, possibly with a modified payload.
86+- **Head**: A list of effects called `card`s (which we'll discuss later).
87+- **Tail**: A new agent core, possibly with a modified payload.
8688
8789It goes something like this:
8890
@@ -107,7 +109,7 @@ rejected.
107109What this means is that you can intentionally design your agent to crash in
108110cases it can't handle. For example, if a poke comes in with an unexpected
109111`mark`, it crashes. If a permission check fails, it crashes. This is quite
110−different to many programs written in procedural languages, which must handle
112+different to most programs written in procedural languages, which must handle
111113all exceptions to avoid crashing.
112114
113115## Example
@@ -143,7 +145,7 @@ Secondly, you'll notice some of the arms return:
143145```
144146
145147A backtick at the beginning is an irregular syntax meaning "prepend with null",
146−so for example in the dojo:
148+so for example, in the dojo:
147149
148150```
149151> `50
@@ -277,8 +279,6 @@ If we again examine our agent core's payload by looking at the tail of
277279
278280## Summary
279281
280−The key takeways are:
281−
282282- A Gall agent is a `door` with ten arms and a sample of `bowl:gall`.
283283- Each of the ten arms handle different kinds of events - Gall calls the
284284 appropriate arm for the kind event it receives.