on master help sign in
Merge pull request #84 from hidwes-matped/master
90e654dGalen Wolfe-Pauly
docs/arvo/network.md+3−3
@@ -154,12 +154,12 @@ Let's write our first network message! Here's `/app/examples/pong.hoon`:
154 ::
154 ::
155 ++ poke-urbit
155 ++ poke-urbit
156 |= to/@p
156 |= to/@p
157− ^- [(list move) _+>.$]
157+ ^- {(list move) _+>.$}
158− [[[ost %poke /sending [to %pong] %atom 'howdy'] ~] +>.$]
158+ [[[ost %poke /sending [to dap] %atom 'howdy'] ~] +>.$]
159 ::
159 ::
160 ++ poke-atom
160 ++ poke-atom
161 |= arg/@
161 |= arg/@
162− ^- (list move) _+>.$}
162+ ^- {(list move) _+>.$}
163 ~& [%receiving (@t arg)]
163 ~& [%receiving (@t arg)]
164 [~ +>.$]
164 [~ +>.$]
165 ::
165 ::
docs/hoon/concepts.md+2−2
@@ -201,7 +201,7 @@ whose value is of type `atom`; it's a subtree of type `foo:atom`.
201
201
202### `limb` (attribute or variable reference)
202### `limb` (attribute or variable reference)
203
203
204−A [`limb`](limb), like `foo`, is Hoon's equivalent of a variable
204+A [`limb`](../twig/limb/limb), like `foo`, is Hoon's equivalent of a variable
205reference. A limb is a twig; given a subject span, `mint`
205reference. A limb is a twig; given a subject span, `mint`
206resolves it to a Nock formula and a product span.
206resolves it to a Nock formula and a product span.
207
207
@@ -215,7 +215,7 @@ A limb can also be a slot (direct tree address), like `+15`.
215
215
216### `wing` (limb path)
216### `wing` (limb path)
217
217
218−A wing is a list of limbs. Like attribute references in a
218+A [wing](../twig/limb/wing) is a list of limbs. Like attribute references in a
219conventional language, it uses the syntax `a.b.c`, but inside
219conventional language, it uses the syntax `a.b.c`, but inside
220out: Hoon `a.b.c` means "a within b within c", the equivalent of
220out: Hoon `a.b.c` means "a within b within c", the equivalent of
221`c.b.a` in any other language. All limbs but the last, here `a`,
221`c.b.a` in any other language. All limbs but the last, here `a`,
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/cab-door.md+11
@@ -47,6 +47,17 @@ is an irregular form for `:open($ foo bar)`, `%~`, "censig".
47
47
48A trivial door:
48A trivial door:
49
49
50+```
51+/~zod:dojo> =mol :door a/@ud
52+ ++ succ +(a)
53+ ++ prev (dec a)
54+ --
55+/~zod:dojo> :call(succ mol 1)
56+2
57+/~zod:dojo> :call(succ mol :call(succ mol :call(prev mol 5)))
58+6
59+```
60+
50```
61```
51/~zod:dojo> =mol |_ a/@ud
62/~zod:dojo> =mol |_ a/@ud
52 ++ succ +(a)
63 ++ succ +(a)
docs/hoon/twig/bar-core/cen-core.md+14−2
@@ -27,7 +27,20 @@ an argument. A "method" on a core is an arm producing a gate.
27A trivial core:
27A trivial core:
28
28
29```
29```
30−~zod:dojo> =foo =+ x 58
30+~zod:dojo> =foo :pin :name(x 58)
31+ :core
32+ ++ n (add 42 x)
33+ ++ g :gate b/@
34+ (add b n)
35+ --
36+~zod:dojo> n.foo
37+100
38+~zod:dojo> (g.foo 1)
39+101
40+```
41+
42+```
43+~zod:dojo> =foo =+ x=58
31 |%
44 |%
32 ++ n (add 42 x)
45 ++ n (add 42 x)
33 ++ g |= b/@
46 ++ g |= b/@
@@ -39,4 +52,3 @@ A trivial core:
39101
52101
40```
53```
41
54
42−In this trivial example, `g` id ther
docs/hoon/twig/bar-core/dot-trap.md+25−2
@@ -33,6 +33,14 @@ A trap is a deferred computation.
33
33
34A trivial trap:
34A trivial trap:
35
35
36+```
37+~zod:dojo> =foo :trap(42)
38+~zod:dojo> :rap($ foo)
39+42
40+~zod:dojo> (foo)
41+42
42+```
43+
36```
44```
37~zod:dojo> =foo |.(42)
45~zod:dojo> =foo |.(42)
38~zod:dojo> $:foo
46~zod:dojo> $:foo
@@ -55,8 +63,23 @@ A more interesting trap:
5520
6320
56```
64```
57
65
66+```
67+~zod:dojo> =foo =/ reps 10
68+ =/ step 0
69+ =/ outp 0
70+ |.
71+ ?: =(step reps)
72+ outp
73+ $(outp (add outp 2), step +(step))
74+~zod:dojo> (foo)
75+20
76+```
77+
58Note that we can use `:moar()` or `$()` to recurse back into the
78Note that we can use `:moar()` or `$()` to recurse back into the
59trap, since it's a core with an `$` arm.
79trap, since it's a core with an `$` arm.
60
80
81+> `:moar()` expands to `:make($)`, accepting a *jogging* body containing a list
82+> of changes to the subject.
83+
61−> `:moar()` expands to `:make($)` (`%=($)`), accepting a *jogging* body
84+> `$()` expands to `%=($)`, accepting a *jogging* body containing a
62−> containing a list of changes to the subject.
85+> list of changes to the subject.
docs/hoon/twig/bar-core/hep-loop.md+22−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,13 +29,21 @@ 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
37A trivial loop doesn't even recurse:
40A trivial loop doesn't even recurse:
38
41
42+```
43+~zod:dojo> :loop(42)
44+42
45+```
46+
39```
47```
40~zod:dojo> |-(42)
48~zod:dojo> |-(42)
4142
4942
@@ -53,3 +61,14 @@ The classic loop is a decrement:
53~zod:dojo> foo
61~zod:dojo> foo
5441
6241
55```
63```
64+
65+```
66+~zod:dojo> =foo =/ a 42
67+ =/ b 0
68+ |-
69+ ?: =(a +(b))
70+ b
71+ $(b +(b))
72+~zod:dojo> foo
73+41
74+```
docs/hoon/twig/bar-core/tar-gill.md+14−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
@@ -56,5 +59,14 @@ Wet and dry gates in a nutshell:
56[%dog %cat]
59[%dog %cat]
57```
60```
58
61
62+```
63+~zod:dojo> =foo |=({a/* b/*} [b a])
64+~zod:dojo> =bar |*({a/* b/*} [b a])
65+~zod:dojo> (foo %cat %dog)
66+[6.778.724 7.627.107]
67+~zod:dojo> (bar %cat %dog)
68+[%dog %cat]
69+```
70+
59The dry gate does not preserve the span of `a` and `b`; the wet
71The dry gate does not preserve the span of `a` and `b`; the wet
60gate does.
72gate does.
docs/hoon/twig/bar-core/tis-gate.md+19−2
@@ -33,13 +33,23 @@ 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
41A trivial gate:
45A trivial gate:
42
46
47+```
48+~zod:dojo> =foo :gate(a/@ +(a))
49+~zod:dojo> (foo 20)
50+21
51+```
52+
43```
53```
44~zod:dojo> =foo |=(a/@ +(a))
54~zod:dojo> =foo |=(a/@ +(a))
45~zod:dojo> (foo 20)
55~zod:dojo> (foo 20)
@@ -51,6 +61,13 @@ A slightly less trivial gate:
51```
61```
52~zod:dojo> =foo :gate {a/@ b/@}
62~zod:dojo> =foo :gate {a/@ b/@}
53 (add a b)
63 (add a b)
64+~zod:dojo> :call(foo [20 400])
65+420
66+```
67+
68+```
69+~zod:dojo> =foo |= {a/@ b/@}
70+ (add a b)
54~zod:dojo> (foo 20 400)
71~zod:dojo> (foo 20 400)
55420
72420
56```
73```
docs/hoon/twig/buc-mold/cab-shoe.md+14−1
@@ -26,7 +26,7 @@ Irregular: `_foo` is `:shoe(foo)`.
26
26
27## Discussion
27## Discussion
28
28
29−A shoe discards the sample it's supposededly normalizing, and
29+A shoe discards the sample it's supposedly normalizing, and
30produces its example instead.
30produces its example instead.
31
31
32## Examples
32## Examples
@@ -43,3 +43,16 @@ produces its example instead.
43~zod:dojo $:foo
43~zod:dojo $:foo
44[%foobar %moobaz]
44[%foobar %moobaz]
45```
45```
46+
47+```
48+~zod:dojo> =foo $_([%foobar %moobaz])
49+
50+~zod:dojo> (foo %foo %bar)
51+[%foobar %moobaz]
52+
53+~zod:dojo> `foo`[%foobar %moobaz]
54+[%foobar %moobaz]
55+
56+~zod:dojo $:foo
57+[%foobar %moobaz]
58+```
docs/hoon/twig/buc-mold/cen-book.md+10
@@ -42,3 +42,13 @@ in the book terminates, or the default will be an infinite loop!
42~zod:dojo> $:foo
42~zod:dojo> $:foo
43[%foo p=0 q=0]~
43[%foo p=0 q=0]~
44```
44```
45+
46+```
47+~zod:dojo> =foo $%({$foo p/@ud q/@ud} {$bar p/@ud})
48+
49+~zod:dojo> (foo [%bar 37])
50+[%bar p=37]
51+
52+~zod:dojo> $:foo
53+[%foo p=0 q=0]~
54+```
docs/hoon/twig/buc-mold/col-bank.md+13
@@ -41,3 +41,16 @@ Irregular: `{a b c}` is `:bank(a b c)`.
41~zod:dojo> $:foo
41~zod:dojo> $:foo
42[p=0 q=%$]
42[p=0 q=%$]
43```
43```
44+
45+```
46+~zod:dojo> =foo $:(p/@ud q/@tas)
47+
48+~zod:dojo> (foo 33 %foo)
49+[p=33 q=%foo]
50+
51+~zod:dojo> `foo`[33 %foo]
52+[p=33 q=%foo]
53+
54+~zod:dojo> $:foo
55+[p=0 q=%$]
56+```
docs/hoon/twig/buc-mold/hep-lamb.md+7
@@ -40,3 +40,10 @@ gates or other cores over the network!
40~zod:dojo> ($:foo %foo)
40~zod:dojo> ($:foo %foo)
41%bar
41%bar
42```
42```
43+
44+```
45+~zod:dojo> =foo $-($foo $bar)
46+
47+~zod:dojo> ($:foo %foo)
48+%bar
49+```
docs/hoon/twig/buc-mold/ket-bush.md+16
@@ -34,6 +34,22 @@ Regular: *2-fixed*.
34~zod:dojo> (b [%foo 19 22])
34~zod:dojo> (b [%foo 19 22])
35[%foo p=19 q=22]
35[%foo p=19 q=22]
36
36
37+~zod:dojo> $:b
38+[%bar p=0]
39+```
40+
41+```
42+~zod:dojo> =a $%({$foo p/@ud q/@ud} {$bar p/@ud})
43+
44+~zod:dojo> =b $^({a a} a)
45+
46+~zod:dojo> (b [[%bar 33] [%foo 19 22]])
47+[[%bar p=33] [%foo p=19 q=22]]
48+
49+~zod:dojo> (b [%foo 19 22])
50+[%foo p=19 q=22]
51+
37~zod:dojo> $:b
52~zod:dojo> $:b
38[%bar p=0]
53[%bar p=0]
39```
54```
55+
docs/hoon/twig/buc-mold/pat-claw.md+13
@@ -39,3 +39,16 @@ Example:
39~zod:dojo> $:a
39~zod:dojo> $:a
40[%foo p=0 q=0]
40[%foo p=0 q=0]
41```
41```
42+
43+```
44+~zod:dojo> =a $@($foo $:(p/$bar q/@ud))
45+
46+~zod:dojo> (a %foo)
47+%foo
48+
49+~zod:dojo> `a`[%bar 99]
50+[p=%bar q=99]
51+
52+~zod:dojo> $:a
53+[%foo p=0 q=0]
54+```
docs/hoon/twig/buc-mold/tis-coat.md+7
@@ -40,3 +40,10 @@ layer (as seen in the expansion above) to apply a coat.
40~zod:dojo> (a %bar)
40~zod:dojo> (a %bar)
41p=%foo
41p=%foo
42```
42```
43+
44+```
45+~zod:dojo> =a $=(p $foo)
46+
47+~zod:dojo> (a %bar)
48+p=%foo
49+```
docs/hoon/twig/buc-mold/wut-pick.md+13
@@ -33,6 +33,19 @@ your mold to be used as a normalizer.
33
33
34## Examples
34## Examples
35
35
36+```
37+~zod:dojo> =a :pick($foo $bar $baz)
38+
39+~zod:dojo> (a %baz)
40+%baz
41+
42+~zod:dojo> (a [37 45])
43+%foo
44+
45+~zod:dojo> $:a
46+$foo
47+```
48+
36```
49```
37~zod:dojo> =a ?($foo $bar $baz)
50~zod:dojo> =a ?($foo $bar $baz)
38
51
docs/hoon/twig/cen-call/cab-keep.md+12
@@ -30,6 +30,18 @@ span of a limb with mutations.
30
30
31## Examples
31## Examples
32
32
33+```
34+~zod:dojo> =foo [p=42 q=6]
35+~zod:dojo> foo(p %bar)
36+[p=%bar q=6]
37+~zod:dojo> foo(p [55 99])
38+[p=[55 99] q=6]
39+~zod:dojo> :keep(foo p %bar)
40+[p=7.496.034 99]
41+~zod:dojo> :keep(foo p [55 99])
42+! nest-fail
43+```
44+
33```
45```
34~zod:dojo> =foo [p=42 q=6]
46~zod:dojo> =foo [p=42 q=6]
35~zod:dojo> foo(p %bar)
47~zod:dojo> foo(p %bar)
docs/hoon/twig/cen-call/dot-lace.md+6
@@ -23,6 +23,12 @@ Regular: *2-fixed*.
23
23
24## Examples
24## Examples
25
25
26+```
27+~zod:dojo> =add-triple :gate({a/@ b/@ c/@} :(add a b c))
28+~zod:dojo> :lace([1 2 3] add-triple)
29+6
30+```
31+
26```
32```
27~zod:dojo> =add-triple |=({a/@ b/@ c/@} :(add a b c))
33~zod:dojo> =add-triple |=({a/@ b/@ c/@} :(add a b c))
28~zod:dojo> %.([1 2 3] add-triple)
34~zod:dojo> %.([1 2 3] add-triple)
docs/hoon/twig/cen-call/hep-call.md+8
@@ -40,6 +40,14 @@ Hoon, this shared sample is likely to be pulled into a door.
40
40
41## Examples
41## Examples
42
42
43+```
44+~zod:dojo> =add-triple :gate({a/@ b/@ c/@} :(add a b c))
45+~zod:dojo> (add-triple 1 2 3)
46+6
47+~zod:dojo> :call(add-triple [1 2 3])
48+6
49+```
50+
43```
51```
44~zod:dojo> =add-triple |=({a/@ b/@ c/@} :(add a b c))
52~zod:dojo> =add-triple |=({a/@ b/@ c/@} :(add a b c))
45~zod:dojo> (add-triple 1 2 3)
53~zod:dojo> (add-triple 1 2 3)
docs/hoon/twig/cen-call/ket-calq.md+6
@@ -23,6 +23,12 @@ Regular: *4-fixed*.
23
23
24## Examples
24## Examples
25
25
26+```
27+~zod:dojo> =add-triple :gate({a/@ b/@ c/@} :(add a b c))
28+~zod:dojo> :calq(add-triple 1 2 3)
29+6
30+```
31+
26```
32```
27~zod:dojo> =add-triple |=({a/@ b/@ c/@} :(add a b c))
33~zod:dojo> =add-triple |=({a/@ b/@ c/@} :(add a b c))
28~zod:dojo> %^(add-triple 1 2 3)
34~zod:dojo> %^(add-triple 1 2 3)
docs/hoon/twig/cen-call/lus-calt.md+7−1
@@ -23,8 +23,14 @@ Regular: *3-fixed*.
23
23
24## Examples
24## Examples
25
25
26+```
27+~zod:dojo> =add-triple :gate({a/@ b/@ c/@} :(add a b c))
28+~zod:dojo> :calt(add-triple 1 [2 3])
29+6
30+```
31+
26```
32```
27~zod:dojo> =add-triple |=({a/@ b/@ c/@} :(add a b c))
33~zod:dojo> =add-triple |=({a/@ b/@ c/@} :(add a b c))
28~zod:dojo> %+(add-triple 1 [2 3])
34~zod:dojo> %+(add-triple 1 [2 3])
296
356
30−
36+```
docs/hoon/twig/col-cell/cab-scon.md+5
@@ -23,6 +23,11 @@ Regular: *2-fixed*.
23
23
24### Examples
24### Examples
25
25
26+```
27+~zod:dojo> :scon(1 2)
28+[2 1]
29+```
30+
26```
31```
27~zod:dojo> :_(1 2)
32~zod:dojo> :_(1 2)
28[2 1]
33[2 1]
docs/hoon/twig/col-cell/hep-cons.md+2
@@ -38,6 +38,8 @@ compiler does), `[a b]` is the same as `[%cons a b]`.
38## Examples
38## Examples
39
39
40```
40```
41+~zod:dojo> :cons(1 2)
42+[1 2]
41~zod:dojo> :-(1 2)
43~zod:dojo> :-(1 2)
42[1 2]
44[1 2]
43~zod:dojo> 1^2
45~zod:dojo> 1^2
docs/hoon/twig/col-cell/ket-conq.md+13−2
@@ -24,10 +24,21 @@ Regular: *4-fixed*.
24## Examples
24## Examples
25
25
26```
26```
27−/~zod:dojo> :^(1 2 3 4)
27+/~zod:dojo> :conq(1 2 3 4)
28[1 2 3 4]
28[1 2 3 4]
29−/~zod:dojo> :^ 5 6
29+/~zod:dojo> :conq 5
30+ 6
30 7
31 7
31 8
32 8
32[5 6 7 8]
33[5 6 7 8]
33```
34```
35+
36+```
37+/~zod:dojo> :^(1 2 3 4)
38+[1 2 3 4]
39+/~zod:dojo> :^ 5
40+ 6
41+ 7
42+ 8
43+[5 6 7 8]
44+```
docs/hoon/twig/col-cell/lus-cont.md+9
@@ -23,6 +23,15 @@ Regular: *3-fixed*.
23
23
24## Examples
24## Examples
25
25
26+```
27+/~zod:dojo> :cont 1
28+ 2
29+ 3
30+[1 2 3]
31+/~zod:dojo> :cont(%a ~ 'b')
32+[%a ~ 'b']
33+```
34+
26```
35```
27/~zod:dojo> :+ 1
36/~zod:dojo> :+ 1
28 2
37 2
docs/hoon/twig/col-cell/sig-conl.md+14
@@ -39,6 +39,20 @@ Regular: *running*.
39
39
40## Examples
40## Examples
41
41
42+```
43+~zod:dojo> :conl(6 5 3 4 2 1)
44+[6 5 3 4 2 1 ~]
45+~zod:dojo> ~[6 5 3 4 2 1]
46+[6 5 3 4 2 1 ~]
47+~zod:dojo> :conl 5
48+ 3
49+ 4
50+ 2
51+ 1
52+ ==
53+[5 3 4 2 1 ~]
54+```
55+
42```
56```
43~zod:dojo> :~(5 3 4 2 1)
57~zod:dojo> :~(5 3 4 2 1)
44[5 3 4 2 1 ~]
58[5 3 4 2 1 ~]
docs/hoon/twig/col-cell/tar-conp.md+17
@@ -43,6 +43,23 @@ Regular: *running*.
43
43
44## Examples
44## Examples
45```
45```
46+/~zod:dojo> :conp(5 3 4 1 4 9 0 ~ 'a')
47+[5 3 4 1 4 9 0 ~ 'a']
48+/~zod:dojo> [5 3 4 1 4 9 0 ~ 'a']
49+[5 3 4 1 4 9 0 ~ 'a']
50+/~zod:dojo> :conp 5
51+ 3
52+ 4
53+ 1
54+ 4
55+ 9
56+ 0
57+ ~
58+ 'a'
59+ ==
60+[5 3 4 1 4 9 0 ~ 'a']
61+```
62+```
46/~zod:dojo> :*(5 3 4 1 4 9 0 ~ 'a')
63/~zod:dojo> :*(5 3 4 1 4 9 0 ~ 'a')
47[5 3 4 1 4 9 0 ~ 'a']
64[5 3 4 1 4 9 0 ~ 'a']
48/~zod:dojo> [5 3 4 1 4 9 0 ~ 'a']
65/~zod:dojo> [5 3 4 1 4 9 0 ~ 'a']
docs/hoon/twig/dot-nock/ket-wish.md−3
@@ -19,6 +19,3 @@ typed immutable namespace defined by its virtual context.
19
19
20We don't remold dynamically nouns in a `:wish`, but we do check
20We don't remold dynamically nouns in a `:wish`, but we do check
21that the type of the value nests in `p`.
21that the type of the value nests in `p`.
22−
23−## Examples
24−
docs/hoon/twig/dot-nock/lus-bump.md+3−1
@@ -5,7 +5,7 @@ sort: 3
5
5
6# `:bump .+ "dotlus"`
6# `:bump .+ "dotlus"`
7
7
8−`{$bump p/seed}`: increment an atom with Nock `4`.
8+`{$bump p/atom}`: increment an atom with Nock `4`.
9
9
10## Produces
10## Produces
11
11
@@ -21,6 +21,8 @@ Irregular: `+(6)` is `.+(6)`.
21## Examples
21## Examples
22
22
23```
23```
24+~zod:dojo> :bump(6)
25+7
24~zod:dojo> +(6)
26~zod:dojo> +(6)
257
277
26~zod:dojo> +(%foo)
28~zod:dojo> +(%foo)
docs/hoon/twig/dot-nock/tar-nock.md+15
@@ -23,6 +23,21 @@ perfectly practical to use Hoon as a typeless language.
23
23
24## Examples
24## Examples
25
25
26+```
27+~zod:dojo> :nock([20 30] [0 2])
28+20
29+~zod:dojo> :nock(33 [4 0 1])
30+34
31+~zod:dojo> :nock(|.(50) [9 2 0 1])
32+50
33+~zod:dojo> :nock(12 [7 [`1 [4 `1]] [`2 `3 `2]])
34+[12 13 12]
35+~zod:dojo> :nock(~ [5 1^4 [4 1^3]])
36+0
37+~zod:dojo> :nock(~ [5 1^5 [4 1^3]])
38+1
39+```
40+
26```
41```
27~zod:dojo> .*([20 30] [0 2])
42~zod:dojo> .*([20 30] [0 2])
2820
4320
docs/hoon/twig/dot-nock/tis-same.md+6
@@ -28,6 +28,12 @@ is a common cause of performance bugs.)
28
28
29## Examples
29## Examples
30
30
31+```
32+~zod:dojo> :same(0 0)
33+%.y
34+~zod:dojo> :same(1 2)
35+%.n
36+```
31```
37```
32~zod:dojo> =(0 0)
38~zod:dojo> =(0 0)
33%.y
39%.y
docs/hoon/twig/dot-nock/wut-deep.md+7
@@ -17,6 +17,13 @@ Regular: *1-fixed*.
17
17
18## Examples
18## Examples
19
19
20+```
21+~zod:dojo> :deep(~)
22+%.n
23+~zod:dojo> :deep([2 3])
24+%.y
25+```
26+
20```
27```
21~zod:dojo> .?(~)
28~zod:dojo> .?(~)
22%.n
29%.n
docs/hoon/twig/ket-cast/bar-iron.md+7
@@ -31,6 +31,13 @@ interface.
31
31
32The prettyprinter shows the core metal (`.` gold, `|` iron):
32The prettyprinter shows the core metal (`.` gold, `|` iron):
33
33
34+```
35+~zod:dojo> :gate(@ 1)
36+<1.gcq [@ @n <250.yur 41.wda 374.hzt 100.kzl 1.ypj %151>]>
37+~zod:dojo> :iron(:gate(@ 1))
38+<1|gcq [@ @n <250.yur 41.wda 374.hzt 100.kzl 1.ypj %151>]>
39+```
40+
34```
41```
35~zod:dojo> |=(@ 1)
42~zod:dojo> |=(@ 1)
36<1.gcq [@ @n <250.yur 41.wda 374.hzt 100.kzl 1.ypj %151>]>
43<1.gcq [@ @n <250.yur 41.wda 374.hzt 100.kzl 1.ypj %151>]>
docs/hoon/twig/ket-cast/hep-cast.md+14
@@ -33,6 +33,20 @@ infinite loop in the compiler).
33
33
34## Examples
34## Examples
35
35
36+```
37+~zod:dojo> (add 90 7)
38+97
39+~zod:dojo> `@t`(add 90 7)
40+'a'
41+~zod:dojo> :cast(@t (add 90 7))
42+'a'
43+/~zod:dojo> =foo :gate a/@tas
44+ :cast (unit @ta)
45+ `a
46+/~zod:dojo> (foo 97)
47+[~ ~.a]
48+```
49+
36```
50```
37~zod:dojo> (add 90 7)
51~zod:dojo> (add 90 7)
3897
5297
docs/hoon/twig/ket-cast/lus-like.md+4−1
@@ -23,4 +23,7 @@ Regular: *2-fixed*.
23'a'
23'a'
24```
24```
25
25
26−
26+```
27+~zod:dojo> ^+('text' %a)
28+'a'
29+```
docs/hoon/twig/ket-cast/sig-burn.md+7
@@ -23,3 +23,10 @@ Regular: *1-fixed*.
23~zod:dojo> (make '^~(|-(42))')
23~zod:dojo> (make '^~(|-(42))')
24[%1 p=42]
24[%1 p=42]
25```
25```
26+
27+```
28+~zod:dojo> (make ':loop(42)')
29+[%8 p=[%1 p=[1 42]] q=[%9 p=2 q=[%0 p=1]]]
30+~zod:dojo> (make ':burn(:loop(42))')
31+[%1 p=42]
32+```
docs/hoon/twig/ket-cast/tis-name.md+3
@@ -20,12 +20,15 @@ Regular: *2-fixed*.
20Irregular: `foo=bar` is `:name(foo bar)`.
20Irregular: `foo=bar` is `:name(foo bar)`.
21
21
22## Examples
22## Examples
23+
23```
24```
24~zod:dojo> a=1
25~zod:dojo> a=1
25a=1
26a=1
26~zod:dojo> ^= a
27~zod:dojo> ^= a
27 1
28 1
28a=1
29a=1
30+~zod:dojo> :name(a 1)
31+a=1
29~zod:dojo> [b c d]=[1 2 3 4]
32~zod:dojo> [b c d]=[1 2 3 4]
30[b=1 c=2 d=[3 4]]
33[b=1 c=2 d=[3 4]]
31~zod:dojo> [b c d=[x y]]=[1 2 3 4]
34~zod:dojo> [b c d=[x y]]=[1 2 3 4]
docs/hoon/twig/ket-cast/wut-lead.md+7
@@ -30,6 +30,13 @@ specific generator.
30
30
31The prettyprinter shows the core metal (`.` gold, `?` lead):
31The prettyprinter shows the core metal (`.` gold, `?` lead):
32
32
33+```
34+~zod:dojo> :gate(@ 1)
35+<1.gcq [@ @n <250.yur 41.wda 374.hzt 100.kzl 1.ypj %151>]>
36+~zod:dojo> :lead(:gate(@ 1))
37+<1?gcq [@ @n <250.yur 41.wda 374.hzt 100.kzl 1.ypj %151>]>
38+```
39+
33```
40```
34~zod:dojo> |=(@ 1)
41~zod:dojo> |=(@ 1)
35<1.gcq [@ @n <250.yur 41.wda 374.hzt 100.kzl 1.ypj %151>]>
42<1.gcq [@ @n <250.yur 41.wda 374.hzt 100.kzl 1.ypj %151>]>
docs/hoon/twig/sem-make/col-wad.md+7
@@ -43,6 +43,13 @@ Irregular: `:(add a b c)` is `;:(add a b c)`.
43
43
44## Examples
44## Examples
45
45
46+```
47+~zod:dojo> (add 3 (add 4 5))
48+12
49+~zod:dojo> :wad(add 3 4 5)
50+12
51+```
52+
46```
53```
47~zod:dojo> (add 3 (add 4 5))
54~zod:dojo> (add 3 (add 4 5))
4812
5512
docs/hoon/twig/sem-make/sem-fry.md+16
@@ -32,6 +32,12 @@ Regular: *2-fixed*.
32
32
33Fails because of auras:
33Fails because of auras:
34
34
35+```
36+~zod:dojo> :cast(tape ~[97 98 99])
37+! nest-fail
38+! exit
39+```
40+
35```
41```
36~zod:dojo> ^-(tape ~[97 98 99])
42~zod:dojo> ^-(tape ~[97 98 99])
37! nest-fail
43! nest-fail
@@ -40,6 +46,11 @@ Fails because of auras:
40
46
41Succeeds because molds don't care about auras:
47Succeeds because molds don't care about auras:
42
48
49+```
50+~zod:dojo> :fry(tape ~[97 98 99])
51+"abc"
52+```
53+
43```
54```
44~zod:dojo> ;;(tape ~[97 98 99])
55~zod:dojo> ;;(tape ~[97 98 99])
45"abc"
56"abc"
@@ -54,6 +65,11 @@ Succeeds because the mold normalizes:
54
65
55Fails because not a fixpoint:
66Fails because not a fixpoint:
56
67
68+```
69+~zod:dojo> :fry(tape [50 51 52])
70+! exit
71+```
72+
57```
73```
58~zod:dojo> ;;(tape [50 51 52])
74~zod:dojo> ;;(tape [50 51 52])
59! exit
75! exit
docs/hoon/twig/sig-hint/bar-show.md+6
@@ -21,6 +21,12 @@ Regular: *2-fixed*.
21
21
22## Examples
22## Examples
23
23
24+```
25+~zod:dojo> :show('sample error message' !!)
26+'sample error message'
27+ford: build failed
28+```
29+
24```
30```
25~zod:dojo> ~|('sample error message' !!)
31~zod:dojo> ~|('sample error message' !!)
26'sample error message'
32'sample error message'
docs/hoon/twig/sig-hint/buc-poll.md+5
@@ -21,6 +21,11 @@ Regular: *2-fixed*.
21
21
22## Examples
22## Examples
23
23
24+```
25+~zod:dojo> :poll(%foo 3)
26+3
27+```
28+
24```
29```
25~zod:dojo> ~$(%foo 3)
30~zod:dojo> ~$(%foo 3)
263
313
docs/hoon/twig/sig-hint/cab-lurk.md+6
@@ -21,6 +21,12 @@ Shows `p` in stacktrace if `q` crashes.
21
21
22## Examples
22## Examples
23
23
24+```
25+~zod:dojo> :lurk([%leaf "sample error message"] !!)
26+"sample error message"
27+ford: build failed
28+```
29+
24```
30```
25~zod:dojo> ~_([%leaf "sample error message"] !!)
31~zod:dojo> ~_([%leaf "sample error message"] !!)
26"sample error message"
32"sample error message"
docs/hoon/twig/sig-hint/gal-thin.md+7
@@ -24,6 +24,13 @@ computation we're about to perform, but rather about its product.
24
24
25## Examples
25## Examples
26
26
27+```
28+~zod:dojo> (make ':thin(%a 42)')
29+[%7 p=[%1 p=42] q=[%10 p=97 q=[%0 p=1]]]
30+~zod:dojo> (make ':thin(%a.+(.) 42)')
31+[%7 p=[%1 p=42] q=[%10 p=[p=97 q=[%4 p=[%0 p=1]]] q=[%0 p=1]]]
32+```
33+
27```
34```
28~zod:dojo> (make '~<(%a 42)')
35~zod:dojo> (make '~<(%a 42)')
29[%7 p=[%1 p=42] q=[%10 p=97 q=[%0 p=1]]]
36[%7 p=[%1 p=42] q=[%10 p=97 q=[%0 p=1]]]
docs/hoon/twig/sig-hint/gar-hint.md+12
@@ -23,6 +23,11 @@ Hints are all conventions at the interpreter level.
23
23
24## Examples
24## Examples
25
25
26+```
27+~zod:dojo> :hint(%a 42)
28+42
29+```
30+
26```
31```
27~zod:dojo> ~>(%a 42)
32~zod:dojo> ~>(%a 42)
2842
3342
@@ -30,6 +35,13 @@ Hints are all conventions at the interpreter level.
30
35
31Running the compiler:
36Running the compiler:
32
37
38+```
39+~zod:dojo> (make ':hint(%a 42)')
40+[%10 p=97 q=[%1 p=42]]
41+~zod:dojo> (make ':hint(%a.+(2) 42)')
42+[%10 p=[p=97 q=[%4 p=[%1 p=2]]] q=[%1 p=42]]
43+```
44+
33```
45```
34~zod:dojo> (make '~>(%a 42)')
46~zod:dojo> (make '~>(%a 42)')
35[%10 p=97 q=[%1 p=42]]
47[%10 p=97 q=[%1 p=42]]
docs/hoon/twig/sig-hint/pam-dump.md+6
@@ -21,6 +21,12 @@ Regular: *2-fixed*.
21
21
22## Examples
22## Examples
23
23
24+```
25+~zod:dojo> :dump('halp' ~)
26+'halp'
27+~
28+```
29+
24```
30```
25~zod:dojo> ~&('halp' ~)
31~zod:dojo> ~&('halp' ~)
26'halp'
32'halp'
docs/hoon/twig/sig-hint/wut-warn.md+8
@@ -21,6 +21,14 @@ Regular: *4-fixed*.
21
21
22## Examples
22## Examples
23
23
24+```
25+~zod:dojo> :warn((gth 1 2) 'oops' ~)
26+~
27+~zod:dojo> :warn((gth 1 0) 'oops' ~)
28+'oops'
29+~
30+```
31+
24```
32```
25~zod:dojo> ~?((gth 1 2) 'oops' ~)
33~zod:dojo> ~?((gth 1 2) 'oops' ~)
26~
34~
docs/hoon/twig/sig-hint/zap-peep.md+8
@@ -21,6 +21,14 @@ Regular: *2-fixed*.
21
21
22## Examples
22## Examples
23
23
24+```
25+~zod:dojo> a
26+! -find.a
27+~zod:dojo> :peep('foo' a)
28+! @t
29+! find.a
30+```
31+
24```
32```
25~zod:dojo> a
33~zod:dojo> a
26! -find.a
34! -find.a
docs/hoon/twig/tis-flow/bar-new.md+9
@@ -33,6 +33,15 @@ is `:coat(foo @)` (wrapping a face around a mold).
33
33
34## Examples
34## Examples
35
35
36+```
37+~zod:dojo> =foo :gate a/@
38+ :pin b/@
39+ :nip :(add a b c)
40+ c=2
41+~zod:dojo> (foo 5)
42+7
43+```
44+
36```
45```
37~zod:dojo> =foo |= a/@
46~zod:dojo> =foo |= a/@
38 =| b/@
47 =| b/@
docs/hoon/twig/tis-flow/col-fix.md+9
@@ -23,6 +23,15 @@ Regular: *jogging*, then *1-fixed*.
23
23
24## Examples
24## Examples
25
25
26+```
27+~zod:dojo> :pin a=[b=1 c=2]
28+ :fix c.a 4
29+ b.a 3
30+ ==
31+ a
32+[b=3 c=4]
33+```
34+
26```
35```
27~zod:dojo> =+ a=[b=1 c=2]
36~zod:dojo> =+ a=[b=1 c=2]
28 =: c.a 4
37 =: c.a 4
docs/hoon/twig/tis-flow/dot-set.md+10
@@ -29,6 +29,16 @@ a new subject with a changed value. Note that the mutation uses
29
29
30## Examples
30## Examples
31
31
32+```
33+~zod:dojo> :pin a=[b=1 c=2]
34+ :set b.a 3
35+ a
36+[b=3 c=2]
37+~zod:dojo> :pin a=[b=1 c=2]
38+ :set(b.a 3 a)
39+[b=3 c=2]
40+```
41+
32```
42```
33~zod:dojo> =+ a=[b=1 c=2]
43~zod:dojo> =+ a=[b=1 c=2]
34 =. b.a 3
44 =. b.a 3
docs/hoon/twig/tis-flow/fas-var.md+12−3
@@ -54,12 +54,21 @@ Regular: *3-fixed*.
54
54
55## Discussion
55## Discussion
56
56
57−`p` can be either a symbol or a symbol/mold. If it's just a
57+`p` can be either a symbol or a symbol/mold. If it's just a symbol,
58−symbol, `:var` "declares a type-inferred variable." It has a
58+`:var` "declares a type-inferred variable." If it has a mold, `:var`
59−mold, `:var` "declares a type-checked variable."
59+"declares a type-checked variable."
60
60
61## Examples
61## Examples
62
62
63+```
64+~zod:dojo> =foo :gate a/@
65+ :var b 1
66+ :var c/@ 2
67+ :(add a b c)
68+~zod:dojo> (foo 5)
69+8
70+```
71+
63```
72```
64~zod:dojo> =foo |= a/@
73~zod:dojo> =foo |= a/@
65 =/ b 1
74 =/ b 1
docs/hoon/twig/tis-flow/gal-rap.md+2
@@ -26,6 +26,8 @@ Irregular: `foo:bar` is `:rap(foo bar)`.
26## Examples
26## Examples
27
27
28```
28```
29+~zod:dojo> :rap(b [a=1 b=2 c=3])
30+2
29~zod:dojo> b:[a=1 b=2 c=3]
31~zod:dojo> b:[a=1 b=2 c=3]
302
322
31~zod:dojo> [. .]:(add 2 4)
33~zod:dojo> [. .]:(add 2 4)
docs/hoon/twig/tis-flow/gar-per.md+7
@@ -17,6 +17,13 @@ Regular: *2-fixed*.
17
17
18## Examples
18## Examples
19
19
20+```
21+~zod:dojo> :per([a=1 b=2 c=3] b)
22+2
23+~zod:dojo> :per((add 2 4) [. .])
24+[6 6]
25+```
26+
20```
27```
21~zod:dojo> =>([a=1 b=2 c=3] b)
28~zod:dojo> =>([a=1 b=2 c=3] b)
222
292
docs/hoon/twig/tis-flow/hep-nip.md+12−3
@@ -5,7 +5,7 @@ sort: 4
5
5
6# `:nip =- "tishep"`
6# `:nip =- "tishep"`
7
7
8−`{$pin p/seed q/seed}`: combine a new noun with the subject, inverted.
8+`{$nip p/seed q/seed}`: combine a new noun with the subject, inverted.
9
9
10## Expands to
10## Expands to
11
11
@@ -28,10 +28,19 @@ is much smaller than the twig that uses it.
28
28
29## Examples
29## Examples
30
30
31+```
32+~zod:dojo> =foo :gate a/@
33+ :pin :name(b 1)
34+ :nip :(add a b c)
35+ c=2
36+~zod:dojo> (foo 5)
37+8
38+```
39+
31```
40```
32~zod:dojo> =foo |= a/@
41~zod:dojo> =foo |= a/@
33− =+ :name(b 1)
42+ =+ b=1)
34− =- :(add a b c)
43+ =- (add a b c)
35 c=2
44 c=2
36~zod:dojo> (foo 5)
45~zod:dojo> (foo 5)
378
468
docs/hoon/twig/tis-flow/ket-sip.md+8
@@ -37,6 +37,14 @@ The `og` core is a stateful pseudo-random number generator.
37We have to change the core state every time we generate a
37We have to change the core state every time we generate a
38random number, so we need to `:sip`:
38random number, so we need to `:sip`:
39
39
40+```
41+~zod:dojo> :pin rng=~(. og 420)
42+ :sip r1 rng (rads:rng 100)
43+ :sip r2 rng (rads:rng 100)
44+ [r1 r2]
45+[99 46]
46+```
47+
40```
48```
41~zod:dojo> =+ rng=~(. og 420)
49~zod:dojo> =+ rng=~(. og 420)
42 =^ r1 rng (rads:rng 100)
50 =^ r1 rng (rads:rng 100)
docs/hoon/twig/tis-flow/lus-pin.md+10−1
@@ -27,9 +27,18 @@ Regular: *2-fixed*.
27
27
28## Examples
28## Examples
29
29
30+```
31+~zod:dojo> =foo :gate a/@
32+ :pin :name(b 1)
33+ :pin :name(c 2)
34+ :(add a b c)
35+~zod:dojo> (foo 5)
36+8
37+```
38+
30```
39```
31~zod:dojo> =foo |= a/@
40~zod:dojo> =foo |= a/@
32− =+ :name(b 1)
41+ =+ b=1
33 =+ c=2
42 =+ c=2
34 :(add a b c)
43 :(add a b c)
35~zod:dojo> (foo 5)
44~zod:dojo> (foo 5)
docs/hoon/twig/tis-flow/sem-rev.md+9
@@ -32,3 +32,12 @@ Regular: *3-fixed*.
32~zod:dojo> (foo 5)
32~zod:dojo> (foo 5)
338
338
34```
34```
35+
36+```
37+~zod:dojo> =foo |= a/@
38+ =/ b 1
39+ =; c/@ :(add a b c)
40+ 2
41+~zod:dojo> (foo 5)
42+8
43+```
docs/hoon/twig/tis-flow/tar-aka.md+16−2
@@ -24,12 +24,26 @@ noun stays the same; the alias is just recorded in its span.
24## Examples
24## Examples
25
25
26```
26```
27−~zod:dojo>
27+~zod:dojo>
28+ :pin a=1
29+ :aka b a
30+ [a b]
31+[1 1]
32+~zod:dojo>
33+ :pin a=1
34+ :aka b a
35+ :set a 2
36+ [a b]
37+[2 2]
38+```
39+
40+```
41+~zod:dojo>
28 =+ a=1
42 =+ a=1
29 =* b a
43 =* b a
30 [a b]
44 [a b]
31[1 1]
45[1 1]
32−~zod:dojo>
46+~zod:dojo>
33 =+ a=1
47 =+ a=1
34 =* b a
48 =* b a
35 =. a 2
49 =. a 2
docs/hoon/twig/wut-test/bar-or.md+5
@@ -43,6 +43,11 @@ Irregular: `|(foo bar baz)` is `?|(foo bar baz)`.
43
43
44## Examples
44## Examples
45
45
46+```
47+~zod:dojo> :or(=(6 42) =(42 42))
48+%.y
49+```
50+
46```
51```
47~zod:dojo> |(=(6 42) =(42 42))
52~zod:dojo> |(=(6 42) =(42 42))
48%.y
53%.y
docs/hoon/twig/wut-test/col-if.md+5
@@ -37,6 +37,11 @@ Note also that all other branching twigs reduce to `:if`.
37
37
38## Examples
38## Examples
39
39
40+```
41+~zod:dojo> :if((gth 1 2) 3 4)
42+4
43+```
44+
40```
45```
41~zod:dojo> ?:((gth 1 2) 3 4)
46~zod:dojo> ?:((gth 1 2) 3 4)
424
474
docs/hoon/twig/wut-test/dot-lest.md+13
@@ -30,6 +30,19 @@ twig of an `:if` is much heavier than the negative twig.
30
30
31## Examples
31## Examples
32
32
33+```
34+~zod:dojo> :lest((gth 1 2) 3 4)
35+3
36+~zod:dojo> :lest(:fits(%a 'a') %not-a %yup)
37+%yup
38+~zod:dojo> :lest %.y
39+ 'this false case is less heavy than the true case'
40+ :if =(2 3)
41+ 'two not equal to 3'
42+ 'but see how \'r is much heavier than \'q?'
43+'but see how \'r is much heavier than \'q?'
44+```
45+
33```
46```
34~zod:dojo> ?.((gth 1 2) 3 4)
47~zod:dojo> ?.((gth 1 2) 3 4)
353
483
docs/hoon/twig/wut-test/gal-deny.md+5
@@ -25,6 +25,11 @@ Regular: *2-fixed*.
25
25
26## Examples
26## Examples
27
27
28+```
29+~zod:dojo> :deny(=(3 4) %foo)
30+%foo
31+```
32+
28```
33```
29~zod:dojo> ?<(=(3 4) %foo)
34~zod:dojo> ?<(=(3 4) %foo)
30%foo
35%foo
docs/hoon/twig/wut-test/gar-sure.md+5
@@ -25,6 +25,11 @@ Regular: *2-fixed*.
25
25
26## Examples
26## Examples
27
27
28+```
29+~zod:dojo> :sure(=(3 3) %foo)
30+%foo
31+```
32+
28```
33```
29~zod:dojo> ?>(=(3 3) %foo)
34~zod:dojo> ?>(=(3 3) %foo)
30%foo
35%foo
docs/hoon/twig/wut-test/hep-case.md+14
@@ -56,6 +56,20 @@ will throw `mint-vain`. (Ecclesiastes did nothing wrong.)
56
56
57## Examples
57## Examples
58
58
59+```
60+~zod:dojo> =cor :gate vat/?($a $b)
61+ :case vat
62+ $a 20
63+ $b 42
64+ ==
65+~zod:dojo> (cor %a)
66+20
67+~zod:dojo> (cor %b)
68+42
69+~zod:dojo> (cor %c)
70+! nest-fail
71+```
72+
59```
73```
60~zod:dojo> =cor |= vat/?($a $b)
74~zod:dojo> =cor |= vat/?($a $b)
61 ?- vat
75 ?- vat
docs/hoon/twig/wut-test/ket-ifcl.md+10
@@ -30,6 +30,16 @@ Regular form: *3-fixed*
30
30
31## Examples
31## Examples
32
32
33+```
34+~zod:dojo> :ifcl(0 1 2)
35+! mint-vain
36+! exit
37+~zod:dojo> :ifcl(`*`0 1 2)
38+2
39+~zod:dojo> :ifcl(`*`[1 2] 3 4)
40+3
41+```
42+
33```
43```
34~zod:dojo> ?^(0 1 2)
44~zod:dojo> ?^(0 1 2)
35! mint-vain
45! mint-vain
docs/hoon/twig/wut-test/lus-deft.md+14
@@ -50,6 +50,20 @@ An extra case will throw `mint-vain`. A lost case defaults.
50
50
51## Examples
51## Examples
52
52
53+```
54+~zod:dojo> =cor :gate vat/?($a $b)
55+ :deft vat 240
56+ $a 20
57+ $b 42
58+ ==
59+~zod:dojo> (cor %a)
60+20
61+~zod:dojo> (cor %b)
62+42
63+~zod:dojo> (cor %c)
64+240
65+```
66+
53```
67```
54~zod:dojo> =cor |= vat/?($a $b)
68~zod:dojo> =cor |= vat/?($a $b)
55 ?+ vat 240
69 ?+ vat 240
docs/hoon/twig/wut-test/pam-and.md+5
@@ -43,6 +43,11 @@ Irregular: `&(foo bar baz)` is `?&(foo bar baz)`.
43
43
44## Examples
44## Examples
45
45
46+```
47+~zod:dojo> :and(=(6 6) =(42 42))
48+%.y
49+```
50+
46```
51```
47~zod:dojo> &(=(6 6) =(42 42))
52~zod:dojo> &(=(6 6) =(42 42))
48%.y
53%.y
docs/hoon/twig/wut-test/pat-ifat.md+10
@@ -26,6 +26,16 @@ Regular: *3-fixed*.
26
26
27## Examples
27## Examples
28
28
29+```
30+~zod:dojo> :ifat(0 1 2)
31+! mint-vain
32+! exit
33+~zod:dojo> :ifat(`*`0 1 2)
34+1
35+~zod:dojo> :ifat(`*`[1 2] 3 4)
36+4
37+```
38+
29```
39```
30~zod:dojo> ?@(0 1 2)
40~zod:dojo> ?@(0 1 2)
31! mint-vain
41! mint-vain
docs/hoon/twig/wut-test/sig-ifno.md+7−1
@@ -31,8 +31,14 @@ only for a true null, `~`.
31
31
32## Examples
32## Examples
33
33
34+```
35+~zod:dojo> =foo ""
36+~zod:dojo> :ifno(foo 1 2)
37+1
38+```
39+
34```
40```
35~zod:dojo> =foo ""
41~zod:dojo> =foo ""
36~zod:dojo> ?~(foo 1 2)
42~zod:dojo> ?~(foo 1 2)
37−11
43+1
38```
44```
docs/hoon/twig/wut-test/tis-fits.md+6
@@ -34,6 +34,12 @@ A common error is `find.$`, meainng `p` is not a mold.
34
34
35## Examples
35## Examples
36
36
37+```
38+~zod:dojo> =bar [%foo %bar %baz]
39+~zod:dojo> :fits({$foo *} bar)
40+%.y
41+```
42+
37```
43```
38~zod:dojo> =bar [%foo %bar %baz]
44~zod:dojo> =bar [%foo %bar %baz]
39~zod:dojo> ?=({$foo *} bar)
45~zod:dojo> ?=({$foo *} bar)
docs/hoon/twig/wut-test/zap-not.md+11
@@ -27,6 +27,17 @@ Irregular: `!foo` is `?!(foo)`.
27
27
28## Examples
28## Examples
29
29
30+```
31+~zod:dojo> not:(=(1 2))
32+%.y
33+~zod:dojo> :not(&)
34+%.n
35+~zod:dojo> :not(|)
36+%.y
37+~zod:dojo> :not(gth 5 6)
38+%.y
39+```
40+
30```
41```
31~zod:dojo> ?!(.=(1 2))
42~zod:dojo> ?!(.=(1 2))
32%.y
43%.y
docs/hoon/twig/zap-wild/gar-wrap.md+5
@@ -22,6 +22,11 @@ span-noun cell is generally called a `vase`.
22
22
23## Examples
23## Examples
24
24
25+```
26+~zod:dojo> :wrap(1)
27+[p=#t/@ud q=1]
28+```
29+
25```
30```
26~zod:dojo> !>(1)
31~zod:dojo> !>(1)
27[p=#t/@ud q=1]
32[p=#t/@ud q=1]
docs/hoon/twig/zap-wild/tis-code.md+9
@@ -17,6 +17,15 @@ Regular: *1-fixed*.
17
17
18## Examples
18## Examples
19
19
20+```
21+~zod:dojo> :code(20)
22+[1 20]
23+~zod:dojo> :code(~zod)
24+[1 0]
25+~zod:dojo> :code((add 2 2))
26+[8 [9 3.110.356 0 31] 9 2 [0 4] [7 [0 3] 1 2 2] 0 11]
27+```
28+
20```
29```
21~zod:dojo> !=(20)
30~zod:dojo> !=(20)
22[1 20]
31[1 20]
docs/hoon/twig/zap-wild/wut-need.md+9
@@ -18,6 +18,15 @@ Regular: *2-fixed*.
18
18
19## Examples
19## Examples
20
20
21+```
22+~zod:dojo> :need(264 (add 2 2))
23+4
24+~zod:dojo> :need(164 (add 2 2))
25+4
26+~zod:dojo> :need(64 (add 2 2))
27+! exit
28+```
29+
21```
30```
22~zod:dojo> !?(264 (add 2 2))
31~zod:dojo> !?(264 (add 2 2))
234
324
docs/hoon/twig/zap-wild/zap-fail.md+5
@@ -21,6 +21,11 @@ Nothing. Always crashes, with span `%void`.
21
21
22## Examples
22## Examples
23
23
24+```
25+~zod:dojo> :fail
26+! exit
27+```
28+
24```
29```
25~zod:dojo> !!
30~zod:dojo> !!
26! exit
31! exit