on master help sign in
Refactor the `:moar` explanation
b3b66bb~hidwes-matped
docs/hoon/twig/bar-core.md+11
@@ -14,6 +14,17 @@ section in [`span`](../../basic#-core-p-span-q-map-term-span) above.)
14`$core` uses the subject as the payload of a battery, whose arms are
14`$core` uses the subject as the payload of a battery, whose arms are
15compiled with the core itself as the subject.
15compiled with the core itself as the subject.
16
16
17+Four of these twigs (`:gate`, `:trap`, `:loop`, and `:gill`) produce a
18+core with a single arm, named `$`. We can recompute this arm with changes,
19+useful for recursion among other things:
20+
21+> `:moar()` expands to `:make($)`, accepting a *jogging* body
22+> containing a list of changes to the subject.
23+
24+> `$()` expands to `%=($)`, accepting a *jogging* body
25+> containing a list of changes to the subject.
26+
27+
17## Stems
28## Stems
18
29
19<list dataPreview="true" className="runes"></list>
30<list dataPreview="true" className="runes"></list>
docs/hoon/twig/bar-core/dot-trap.md+5−2
@@ -58,5 +58,8 @@ A more interesting trap:
58Note that we can use `:moar()` or `$()` to recurse back into the
58Note that we can use `:moar()` or `$()` to recurse back into the
59trap, since it's a core with an `$` arm.
59trap, since it's a core with an `$` arm.
60
60
61+> `:moar()` expands to `:make($)`, accepting a *jogging* body containing a list
62+> of changes to the subject.
63+
61−> `:moar()` expands to `:make($)` (`%=($)`), accepting a *jogging* body
64+> `$()` expands to `%=($)`, accepting a *jogging* body containing a
62−> containing a list of changes to the subject.
65+> list of changes to the subject.
docs/hoon/twig/bar-core/hep-loop.md+6−3
@@ -6,7 +6,7 @@ sort: 4
6
6
7# `:loop |- "barhep"`
7# `:loop |- "barhep"`
8
8
9−`{$loop p/seed}`: form a trap and kick it.
9+`{$loop p/seed}`: form a trap and kick ("*call*") it.
10
10
11## Expands to
11## Expands to
12
12
@@ -29,8 +29,11 @@ The `:loop` keyword (and `|-` rune) can be thought of as a "recursion point" -
29since `:loop` makes a `:trap` (a core with one arm named `$`), we can recurse
29since `:loop` makes a `:trap` (a core with one arm named `$`), we can recurse
30back into it with `:moar()` or `$()`.
30back into it with `:moar()` or `$()`.
31
31
32+> `:moar()` expands to `:make($)`, accepting a *jogging* body containing a list
33+> of changes to the subject.
34+
32−> `:moar()` expands to `:make($)` (`%=($)`), accepting a *jogging* body
35+> `$()` expands to `%=($)`, accepting a *jogging* body containing a
33−> containing a list of changes to the subject.
36+> list of changes to the subject.
34
37
35## Examples
38## Examples
36
39
docs/hoon/twig/bar-core/tar-gill.md+5−2
@@ -40,8 +40,11 @@ you think you know what you're doing.
40
40
41Just as with a `:gate`, we can recurse back into a `:gill` with `:moar()` or `$()`.
41Just as with a `:gate`, we can recurse back into a `:gill` with `:moar()` or `$()`.
42
42
43+> `:moar()` expands to `:make($)`, accepting a *jogging* body containing a list
44+> of changes to the subject.
45+
43−> `:moar()` expands to `:make($)` (`%=($)`), accepting a *jogging* body
46+> `$()` expands to `%=($)`, accepting a *jogging* body containing a
44−> containing a list of changes to the subject.
47+> list of changes to the subject.
45
48
46## Examples
49## Examples
47
50
docs/hoon/twig/bar-core/tis-gate.md+6−2
@@ -33,8 +33,12 @@ Regular: *2-fixed*.
33A gate is a core with one arm named `$`, so, just as with `:loop` (`|-`),
33A gate is a core with one arm named `$`, so, just as with `:loop` (`|-`),
34we can recurse back into it with `:moar()` or `$()`.
34we can recurse back into it with `:moar()` or `$()`.
35
35
36+
37+> `:moar()` expands to `:make($)`, accepting a *jogging* body containing a list
38+> of changes to the subject.
39+
36−> `:moar()` expands to `:make($)` (`%=($)`), accepting a *jogging* body
40+> `$()` expands to `%=($)`, accepting a *jogging* body containing a
37−> containing a list of changes to the subject.
41+> list of changes to the subject.
38
42
39## Examples
43## Examples
40
44