on master help sign in
thru ?
454b23aHenry Ault
docs/system/hoon/runes/wt/wtbr.md+5−29
@@ -1,40 +1,16 @@
1−`?| wutbar`
1+# `:or`, `?|`, "wutbar" `{$or p/(list twig)}`
2−====
3
2
4Logical 'or'.
3Logical 'or'.
5
4
6Computes the logical 'or' operation on a list of boolean expressions `p`.
5Computes the logical 'or' operation on a list of boolean expressions `p`.
7
6
8−Produces
7+Regular form: *running*
9−--------
10
8
11−Twig: `[%wtbr p=tusk]`
9+Irregular form:
12
10
13−Accepts
11+`?(a b c) ?|(a b c)`
14−-------
15
12
16−`p` is a [`++tusk`](), a list of [`++twig`]()s.
17−
18−Tall form
19−---------
20−
21− ?| i.p
22− i.t.p
23− i.t.t.p
24− ==
25−
26−Wide form
27−---------
28−
29− ?|(i.p i.t.p i.t.t.p)
30−
31−Irregular form
32−--------------
33−
34− |(i.p i.t.p i.t.t.p)
35−
36−Examples
13+Examples:
37−--------
38
14
39 ~zod/try=> ?|(& |)
15 ~zod/try=> ?|(& |)
40 %.y
16 %.y
docs/system/hoon/runes/wt/wtcl.md+5−25
@@ -1,32 +1,12 @@
1−`?: wutcol`
1+# `if`, `?:`, "wutcol" `{$if p/twig q/twig r/twig}`
2−====
3
2
4If-then-else.
3If-then-else.
5
4
6−Produces
5+If `p` evaluates to true, then `q`. Else, `e`.
7−--------
8
6
9−Twig: `[%wtcl p=twig q=twig r=twig]`
7+Regular form: *3-fixed*
10
8
11−Accepts
12−-------
13−
14−`p`, `q`, and `r` are [`++twig`]()s.
15−
16−Tall form
17−---------
18−
19− ?: p
20− q
21− r
22−
23−Wide form
24−---------
25−
26− ?:(p q r)
27−
28−Examples
9+Examples:
29−--------
30
10
31 ~zod/try=> ?:((gth 1 2) 1 2)
11 ~zod/try=> ?:((gth 1 2) 1 2)
32 2
12 2
@@ -34,5 +14,5 @@ Examples
34 %yup
14 %yup
35
15
36Here we see two common cases of `?:` in the wide form, one uses an
16Here we see two common cases of `?:` in the wide form, one uses an
37−expression [`++gte`]() that produces a boolean and the other [`?=`]() to
17+expression `++gte` that produces a boolean and the other `?=` to
38produce one of its cases.
18produce one of its cases.
docs/system/hoon/runes/wt/wtdt.md+11−32
@@ -1,45 +1,24 @@
1−`?. wutdot`
1+# `:lest`, `?.`, "wutdot" `{$lest p/twig q/twig r/twig}`
2−====
3
2
4Inverted if-then-else.
3Inverted if-then-else.
5
4
6−Unless `p` is true, evaluate `r`. Used to keep the heavier of `q` and `r` as the bottom expression, which makes for more readable code (see the section on [backstep]()).
5+Unless `p` is true, evaluate `r`. Used to keep the heavier of `q` and `r` as the bottom expression, which makes for more readable code (see the section on backstep in the syntax section).
7
6
8−Produces
7+Regular form: *3-fixed*
9−--------
10
8
11−Twig: `[%wtdt p=twig q=twig r=twig]`
9+Examples:
12−
13−Accepts
14−-------
15−
16−`p`, `q`, and `r` are [`++twig`]()s.
17−
18−Tall form
19−---------
20−
21− ?. p
22− q
23− r
24−
25−Wide form
26−---------
27−
28− ?.(p q r)
29−
30−Examples
31−--------
32
10
33 ~zod/try=> ?.((gth 1 2) 1 2)
11 ~zod/try=> ?.((gth 1 2) 1 2)
34 1
12 1
35 ~zod/try=> ?.(?=(%a 'a') %not-a %yup)
13 ~zod/try=> ?.(?=(%a 'a') %not-a %yup)
36 %yup
14 %yup
15+ > ?. %.y
16+ 'this false case is less heavy than the true case'
17+ ?: =(2 3)
18+ 'two not equal to 3'
19+ 'but see how \'r is much heavier than \'q?'
20+ 'but see how \'r is much heavier than \'q?'
37
21
38Here we see two common cases of `?.` in the wide form, one uses an
22Here we see two common cases of `?.` in the wide form, one uses an
39−expression `gth` that produces a boolean and the other [`?=`]() to
23+expression `gth` that produces a boolean and the other `?=` to
40produce one of its cases.
24produce one of its cases.
41−
42−Equivalent to
43−-------------
44−
45− ?:(p r q)
docs/system/hoon/runes/wt/wtgl.md+3−28
@@ -1,40 +1,15 @@
1−`?< wutgal`
1+# `:deny`, `?<`, "wutgal" `{$deny p/twig q/twig}`
2====
2====
3
3
4Assert `p` is false.
4Assert `p` is false.
5
5
6Asserts that `p` is false before evaluating `q`. Crashes if `p` evaluates to false.
6Asserts that `p` is false before evaluating `q`. Crashes if `p` evaluates to false.
7
7
8−Produces
8+Regular form: *2-fixed*
9−--------
10
9
11−Twig: `[%wtgl p=twig q=twig]`
12−
13−Accepts
14−-------
15−
16−`p` and `q` are [`++twig`]()s.
17−
18−Tall form
19−---------
20−
21− ?< p
22− q
23−
24−Wide form
25−---------
26−
27− ?<(p q)
28−
29−Examples
10+Examples:
30−--------
31
11
32 ~zod/try=> ?<(=(0x1 0) %foo)
12 ~zod/try=> ?<(=(0x1 0) %foo)
33 %foo
13 %foo
34 ~zod/try=> ?<(=(0x1 1) %foo)
14 ~zod/try=> ?<(=(0x1 1) %foo)
35 ! exit
15 ! exit
36−
37−Equivalent to
38−-------------
39−
40− ?:(p !! q)
docs/system/hoon/runes/wt/wtgr.md+4−30
@@ -1,40 +1,14 @@
1−`?> wutgar`
1+# `:sure`, `?>`, "wutgar" `{$sure p/twig q/twig}`
2−====
3
2
4Assert `p` is true.
3Assert `p` is true.
5
4
6−Asserts that `p` is true before evaluating `q`. Crashes if `p` evaluates to true.
5+Asserts that `p` is true before evaluating `q`, crashing if `p` evaluates to false.
7
6
8−Produces
7+Regular form: *2-fixed*
9−--------
10
8
11−Twig: `[%wtgr p=twig q=twig]`
12−
13−Accepts
14−-------
15−
16−`p` and `q` are [`++twig`]()s.
17−
18−Tall form
19−---------
20−
21− ?> p
22− q
23−
24−Wide form
25−---------
26−
27− ?>(p q)
28−
29−Examples
9+Examples:
30−--------
31
10
32 ~zod/try=> ?>(=(0x1 1) %foo)
11 ~zod/try=> ?>(=(0x1 1) %foo)
33 %foo
12 %foo
34 ~zod/try=> ?>(=(0x1 0) %foo)
13 ~zod/try=> ?>(=(0x1 0) %foo)
35 ! exit
14 ! exit
36−
37−Equivalent to
38−-------------
39−
40− ?.(p !! q)
docs/system/hoon/runes/wt/wthp.md+10−43
@@ -1,52 +1,19 @@
1−`?- wuthep`
1+# `:case`, `?-`, "wuthep" `{$case p/wing q/(list (pair twig twig))}`
2−====
3
2
4Switch.
3Switch.
5
4
5+Switches on the value of `p`. `q` is a list of key value pairs, the heads of
6+which `p` attempts to match with. Different from the traditional switch
6−Different from the traditional switch statement in that it switches on a type instead of a value. More specifically, the labels in `q` must match the [span]() of `p`. `q` must be terminated with a `==`.
7+statement in that it switches on a type instead of a value. XX take a close
8+look at this description The most common type used to switch on is the cube,
9+which begins with `%` followed by text.
7
10
8−Produces
11+Regular form: *1-fixed, followed by jogging*
9−--------
10
12
11−Twig: `[%wthp p=wing q=tine]`
12−
13−Accepts
14−-------
15−
16−`p` is a [`++wine`](). `q` is a [`++tine`]().
17−
18−Tall form
19−---------
20−
21−Kingside:
22−
23− ?- p
24− p.i.q q.i.q
25− p.i.t.q q.i.t.q
26− p.i.t.t.q q.i.t.t.q
27− ==
28−
29−Queenside:
30−
31− ?- p
32− p.i.q
33− q.i.q
34− p.i.t.q
35− q.i.t.q
36− p.i.t.t.q
37− q.i.t.t.q
38− ==
39−
40−Wide form
41−---------
42−
43− ?-(p p.i.q q.i.q, p.i.t.q q.i.t.q, p.i.t.t.q q.i.t.t.q)
44−
45−Examples
13+Examples:
46−--------
47
14
48 ~zod/try=>
15 ~zod/try=>
49− =cor |= typ=$?(%a %b)
16+ =cor |= typ/$?(%a %b)
50 ?- typ
17 ?- typ
51 %a 1
18 %a 1
52 %b 2
19 %b 2
@@ -62,7 +29,7 @@ Examples
62Here is a simple example of `?-` that thows its input must have a well
29Here is a simple example of `?-` that thows its input must have a well
63defined type for which all of the cases are covered. We create a core,
30defined type for which all of the cases are covered. We create a core,
64`cor`, that takes an input `typ` which must be either `%a` or `%b` with
31`cor`, that takes an input `typ` which must be either `%a` or `%b` with
65−[`$%`](). Calling `cor` with valid arguments selects one of our cases.
32+`$%`. Calling `cor` with valid arguments selects one of our cases.
66
33
67 ~zod/try=>
34 ~zod/try=>
68 ?- 'a'
35 ?- 'a'
docs/system/hoon/runes/wt/wtkt.md+7−30
@@ -1,32 +1,13 @@
1−`?^ wutket`
1+# `:ifcl`, `?^`, "wutket" `{$ifcl p/wing q/twig r/twig}`
2====
2====
3
3
4If `p` is cell-then-else.
4If `p` is cell-then-else.
5
5
6−Produces
6+If `p` is a cell, then produce `q`. Else, produce `r`.
7−--------
8
7
9−Twig: `[%wtkt p=wing q=twig r=twig]`
8+Regular form: *3-fixed*
10
9
11−Accepts
12−-------
13−
14−`p` is a [`++wing`](). `q` and `r` are [`++twig`]()s.
15−
16−Tall form
17−---------
18−
19− ?^ p
20− q
21− r
22−
23−Wide form
24−---------
25−
26− ?^(p q r)
27−
28−Examples
10+Examples:
29−--------
30
11
31 ~zod/try=> =(*@tas "")
12 ~zod/try=> =(*@tas "")
32 %.y
13 %.y
@@ -39,8 +20,8 @@ Examples
39 %empty
20 %empty
40 %full
21 %full
41
22
42−Here we show that `*@tas`, the [bunt]() of `@tas` is equivalent to the empty
23+Here we show that `*@tas`, the bunt of `@tas` is equivalent to the empty
43−[`++tape`]() `""`, then use it in two `?^` cases.
24+`++tape` `""`, then use it in two `?^` cases.
44
25
45 ~zod/try=> *(unit)
26 ~zod/try=> *(unit)
46 ~
27 ~
@@ -53,10 +34,6 @@ Here we show that `*@tas`, the [bunt]() of `@tas` is equivalent to the empty
53 %empty
34 %empty
54 %full
35 %full
55
36
56−Similar to the above case, we show the bunt of a [`++unit`](), which is
37+Similar to the above case, we show the bunt of a `++unit`, which is
57`~`, and test against it.
38`~`, and test against it.
58
39
59−Equivalent to
60−-------------
61−
62− ?:(?=(^ p) q r)
docs/system/hoon/runes/wt/wtls.md+10−55
@@ -1,56 +1,21 @@
1−`?+ wutlus`
1+# `:defl`, `?+`, "wutlus" `{$deft p/wing q/twig r/(list (pair twig twig))}`
2−====
3
2
4−Switch w/default value.
3+Switch with default value.
5
4
6−Identical to [`?-`]() except for that it takes a default case `q` if none of the cases in `r` match the type of `p`. More specifically, the labels in `q` must match the [span]() of `p`. `q` must be terminated with a `==`.
5+Identical to `?-` except for that it takes a default case `q` if none of the
6+cases in `r` match the type of `p`. More specifically, the labels in `q` must
7+match the span of `p`. As with `?-`, the most common type used to switch on is the cube, which begins with `%` followed by text.
7
8
8−As with `?-`, the most common type used to switch on is the [cube](), which begins with `%` followed by text.
9+Examples:
9
10
10−Produces
11−--------
12−
13−Twig: `[%wtls p=wing q=twig r=tine]`
14−
15−Accepts
16−-------
17−
18−`p` is a [`++wing`](). `q` is a [`++twig`](). `r` is a [`++tine`]().
19−
20−Tall form
21−---------
22−
23−Kingside:
24−
25− ?+ p
11+ ?- p
26− q
27 p.i.r q.i.r
12 p.i.r q.i.r
28 p.i.t.r q.i.t.r
13 p.i.t.r q.i.t.r
29 p.i.t.t.r q.i.t.t.r
14 p.i.t.t.r q.i.t.t.r
15+ * q
30 ==
16 ==
31−
32−Queenside:
33−
34− ?+ p
35− q
36− p.i.r
37− q.i.r
38− p.i.t.r
39− q.i.t.r
40− p.i.t.t.r
41− q.i.t.t.r
42− ==
43−
44−Wide form
45−---------
46−
47− ?+(p q p.i.r q.i.r, p.i.t.r q.i.t.r, p.i.t.t.r q.i.t.t.r)
48−
49−Examples
50−--------
51−
52 ~zod/try=>
17 ~zod/try=>
53− =cor |= typ=@ta
18+ =cor |= typ/@ta
54 ?+ typ 0
19 ?+ typ 0
55 %a 1
20 %a 1
56 %b 2
21 %b 2
@@ -64,7 +29,7 @@ Examples
64 0
29 0
65
30
66Here is a simple example of `?+` showing that although the cases must
31Here is a simple example of `?+` showing that although the cases must
67−match the [span]() of its input, all possible cases don't need to be covered
32+match the span of its input, all possible cases don't need to be covered
68since `?+` has a default case. We create a core, `cor` that takes an
33since `?+` has a default case. We create a core, `cor` that takes an
69input `typ`, a `@ta`. Calling `cor` selects one of our cases when it is
34input `typ`, a `@ta`. Calling `cor` selects one of our cases when it is
70covered, or the default.
35covered, or the default.
@@ -92,13 +57,3 @@ covered, or the default.
92
57
93This example shows how `?+` can fail. Our input span must match the span
58This example shows how `?+` can fail. Our input span must match the span
94of our cases.
59of our cases.
95−
96−Equivalent to
97−-------------
98−
99− ?- p
100− p.i.r q.i.r
101− p.i.t.r q.i.t.r
102− p.i.t.t.r q.i.t.t.r
103− * q
104− ==
docs/system/hoon/runes/wt/wtpm.md+6−30
@@ -1,40 +1,16 @@
1−`?& wutpam`
1+# `:and`, `?&`, "wutpam" `{$and p/(list twig)}`
2−====
3
2
4Logical 'and'.
3Logical 'and'.
5
4
6−Computes the logical 'and' operation on a list of boolean expressions.
5+Computes the logical 'and' operation on a list of boolean expressions `p`.
7
6
8−Produces
7+Regular form: *running*
9−--------
10
8
11−Twig: `[%wtpm p=tusk]`
9+Irregular form:
12
10
13−Accepts
11+`&(a b c) ?&(a b c)`
14−-------
15
12
16−`p` is a [`++tusk`](), a list of [++twig]()s.
17−
18−Tall form
19−---------
20−
21− ?& i.p
22− i.t.p
23− i.t.t.p
24− ==
25−
26−Wide form
27−---------
28−
29− ?&(i.p i.t.p i.t.t.p)
30−
31−Irregular form
32−--------------
33−
34− &(i.p i.t.p i.t.t.p)
35−
36−Examples
13+Examples:
37−--------
38
14
39 ~zod/try=> ?&(& &)
15 ~zod/try=> ?&(& &)
40 %.y
16 %.y
docs/system/hoon/runes/wt/wtpt.md+2−32
@@ -1,36 +1,10 @@
1−`?@ wutpat`
1+# `:ifat`, `?&`, "wutpam" `{$ifat p/wing q/twig r/twig}`
2−====
3
2
4If atom-then-else.
3If atom-then-else.
5
4
6If-then-else statement that tests whether `p` is an atom, producing `q` if true and `r` if false.
5If-then-else statement that tests whether `p` is an atom, producing `q` if true and `r` if false.
7
6
8−Produces
9−--------
10−
11−Twig: `[%wtpt p=wing q=twig r=twig]`
12−
13−Accepts
14−-------
15−
16−`p` is a [`++wing`](). `q` and `r` are [++twig]()s.
17−
18−Tall form
19−---------
20−
21−Kingside:
22−
23− ?@ p
24− q
25− r
26−
27−Wide form
28−---------
29−
30− ?@(p q r)
31−
32−Examples
7+Examples:
33−--------
34
8
35 ~zod/try=> ?@(~ 1 2)
9 ~zod/try=> ?@(~ 1 2)
36 ! mint-vain
10 ! mint-vain
@@ -47,7 +21,3 @@ Examples
47 ~zod/try=> ?@(`*`[1 1] 1 2)
21 ~zod/try=> ?@(`*`[1 1] 1 2)
48 2
22 2
49
23
50−Equivalent to
51−-------------
52−
53− ?:(?=(@ p) q r)
docs/system/hoon/runes/wt/wtsg.md+3−28
@@ -1,4 +1,4 @@
1−`?~ wutsig`
1+# `ifno`, `?~`, "wutsig" `{$ifno p/wing q/twig r/twig}`
2====
2====
3
3
4If-null-then-else.
4If-null-then-else.
@@ -6,30 +6,9 @@ If-null-then-else.
6If-then-else statement that tests whether `p` is null, producing `q` if true
6If-then-else statement that tests whether `p` is null, producing `q` if true
7and `r` if false.
7and `r` if false.
8
8
9−Produces
9+Regular form: *3-fixed*
10−--------
11
10
12−Twig: `[%wtsg p=wing q=twig r=twig]`
13−
14−Accepts
15−-------
16−
17−`p` is a [`++wing`](). `q` and `r` are [`++twig`]()s.
18−
19−Tall form
20−---------
21−
22− ?~ p
23− q
24− r
25−
26−Wide form
27−---------
28−
29− ?~(p q r)
30−
31−Examples
11+Examples:
32−--------
33
12
34 ~zod/try=> ?~('a' 1 2)
13 ~zod/try=> ?~('a' 1 2)
35 2
14 2
@@ -40,7 +19,3 @@ Examples
40 ~zod/try=> ?~((sub 20 20) 1 2)
19 ~zod/try=> ?~((sub 20 20) 1 2)
41 1
20 1
42
21
43−Equivalent to
44−-------------
45−
46− ?:(?=(~ p) q r)
docs/system/hoon/runes/wt/wtts.md+5−25
@@ -1,33 +1,13 @@
1−`?= wuttis`
1+# `:ifits`, `?=`, "wuttis" `{$fits p/twig q/wing}
2====
2====
3
3
4−Is `q` within `++span` `p`.
4+Is `q` within type `p`.
5
5
6−Tests whether `q` is of type (mold) `p`.
6+Tests whether `q` is of mold `p`.
7
7
8−Produces
8+Regular form: *2-fixed*
9−--------
10
9
11−Twig: `[%wtts p=mold q=wing]`
12−
13−Sample
14−------
15−
16−`p` is a mold], `q` is a [`++wing`]().
17−
18−Tall form
19−---------
20−
21− ?= p
22− q
23−
24−Wide form
25−---------
26−
27− ?=(p q)
28−
29−Examples
10+Examples:
30−--------
31
11
32 ~zod/try=> ?=(@ 'a')
12 ~zod/try=> ?=(@ 'a')
33 %.y
13 %.y
docs/system/hoon/runes/wt/wtzp.md+3−28
@@ -1,37 +1,12 @@
1−`?! wutzap`
1+# `:not`, `?!`, "wutzap" `{$not p/twig}`
2−====
3
2
4Logical not.
3Logical not.
5
4
6Produces the logical "not" of `p`.
5Produces the logical "not" of `p`.
7
6
8−Produces
7+Regular form: *1-fixed*
9−--------
10
8
11−Twig: `[%wtzp p=twig]`
12−
13−Accepts
14−-------
15−
16−`p` is a [`++twig`]().
17−
18−Tall form
19−---------
20−
21− ?! p
22−
23−Wide form
24−---------
25−
26− ?!(p)
27−
28−Irregular form
29−--------------
30−
31− !p
32−
33−Examples
9+Examples:
34−--------
35
10
36 ~zod/try=> !&
11 ~zod/try=> !&
37 %.n
12 %.n