adds explanation of :moar/$ to the relevant | twigs
commitb5debf2af44f03b3b18607ea75c826fe7ba455ca
authorJoseph Bryan <joemfb@gmail.com>
dateFri 24 Jun 2016, 12:54 (10 years ago)
parent76bad7b
docs/hoon/twig/bar-core/dot-trap.md+3
@@ -52,3 +52,6 @@ A more interesting trap:
5252
5353Note that we can use `:moar()` or `$()` to recurse back into the
5454trap, 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
2121
2222Regular: *1-fixed*.
2323
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+
2433## Examples
2534
2635A 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).
3232Genericity is a powerful and dangerous tool. Use gills only if
3333you think you know what you're doing.
3434
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+
3540## Examples
3641
3742Wet and dry gates in a nutshell:
docs/hoon/twig/bar-core/tis-gate.md+6
@@ -24,6 +24,12 @@ Regular: *2-fixed*.
2424
2525## Discussion
2626
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+
2733## Examples
2834
2935A trivial gate: