on master help sign in
adds explanation of :moar/$ to the relevant | twigs
b5debf2Joseph Bryan
docs/hoon/twig/bar-core/dot-trap.md+3
@@ -52,3 +52,6 @@ A more interesting trap:
52
52
53Note that we can use `:moar()` or `$()` to recurse back into the
53Note that we can use `:moar()` or `$()` to recurse back into the
54trap, since it's a core with an `$` arm.
54trap, since it's a core with an `$` arm.
55+
56+> `:moar()` expands to `:make($)` (`%=($)`), accepting a *jogging* body
57+> containing a list of changes to the subject.
docs/hoon/twig/bar-core/hep-loop.md+9
@@ -21,6 +21,15 @@ sort: 4
21
21
22Regular: *1-fixed*.
22Regular: *1-fixed*.
23
23
24+## Discussion
25+
26+The `:loop` keyword (and `|-` rune) can be thought of as a "recursion point" -
27+since `:loop` makes a `:trap` (a core with one arm named `$`), we can recurse
28+back into it with `:moar()` or `$()`.
29+
30+> `:moar()` expands to `:make($)` (`%=($)`), accepting a *jogging* body
31+> containing a list of changes to the subject.
32+
24## Examples
33## Examples
25
34
26A trivial loop doesn't even recurse:
35A trivial loop doesn't even recurse:
docs/hoon/twig/bar-core/tar-gill.md+5
@@ -32,6 +32,11 @@ is still only one copy of the code, however).
32Genericity is a powerful and dangerous tool. Use gills only if
32Genericity is a powerful and dangerous tool. Use gills only if
33you think you know what you're doing.
33you think you know what you're doing.
34
34
35+Just as with a `:gate`, we can recurse back into a `:gill` with `:moar()` or `$()`.
36+
37+> `:moar()` expands to `:make($)` (`%=($)`), accepting a *jogging* body
38+> containing a list of changes to the subject.
39+
35## Examples
40## Examples
36
41
37Wet and dry gates in a nutshell:
42Wet and dry gates in a nutshell:
docs/hoon/twig/bar-core/tis-gate.md+6
@@ -24,6 +24,12 @@ Regular: *2-fixed*.
24
24
25## Discussion
25## Discussion
26
26
27+A gate is a core with one arm named `$`, so, just as with `:loop` (`|-`),
28+we can recurse back into it with `:moar()` or `$()`.
29+
30+> `:moar()` expands to `:make($)` (`%=($)`), accepting a *jogging* body
31+> containing a list of changes to the subject.
32+
27## Examples
33## Examples
28
34
29A trivial gate:
35A trivial gate: