on master help sign in
adds pseudocode and macro expansions to the "advanced" synthetic twigs
1459d71Joseph Bryan
docs/hoon/twig/col-cell/sig-conl.md+21−1
@@ -9,8 +9,28 @@ sort: 5
9
9
10## Expands to
10## Expands to
11
11
12+*Pseudocode*, `a`, `b`, `c`, ... as elements of `p`
13+
14+```
15+:cons(a :cons(b :cons(c :cons(... :cons(z ~)))))
16+```
17+
18+### Compiler Macro
19+
20+```
21+:loop
22+:ifno p
23+ ~
24+:cons i.p
25+:moar(p t.p)
26+```
27+
12```
28```
29+|-
30+?~ p
31+ ~
32+:- i.p
13−|-(?~(p ~ :cons(i.p $(p t.p))))
33+$(p t.p)
14```
34```
15
35
16## Syntax
36## Syntax
docs/hoon/twig/col-cell/tar-conp.md+25−1
@@ -9,8 +9,32 @@ sort: 4
9
9
10## Expands to
10## Expands to
11
11
12+*Pseudocode*, `a`, `b`, `c`, ... as elements of `p`
13+
14+```
15+:cons(a :cons(b :cons(c :cons(... z)))))
16+```
17+
18+### Compiler Macro
19+
20+```
21+:loop
22+:ifno p
23+ !!
24+:ifno t.p
25+ i.p
26+:cons i.p
27+:moar(p t.p)
28+```
29+
12```
30```
13−|-(?~(p !! ?~(t.p i.p :cons(i.p $(p t.p)))))
31+|-
32+?~ p
33+ !!
34+?~ t.p
35+ i.p
36+:- i.p
37+$(p t.p)
14```
38```
15
39
16## Syntax
40## Syntax
docs/hoon/twig/sem-make/col-wad.md+23−1
@@ -9,8 +9,30 @@ sort: 3
9
9
10## Expands to
10## Expands to
11
11
12+*Pseudocode*, `a`, `b`, `c`, ... as elements of `q`
13+
14+```
15+:call(p a :call(p b :call(p c ...)))
16+```
17+
18+### Compiler Macro
19+
20+```
21+:loop
22+:ifno q !!
23+:ifno t.q !!
24+:ifno t.t.q
25+ :call(p i.q i.t.q)
26+:call(p i.q :moar(q t.q))
27+```
28+
12```
29```
13−|-(?~(q !! ?~(t.q !! ?~(t.t.q :call(p i.q i.t.q) :call(p i.q $(q t.q))))))
30+|-
31+?~ q !!
32+?~ t.q !!
33+?~ t.t.q
34+ (p i.q i.t.q)
35+(p i.q $(q t.q))
14```
36```
15
37
16## Syntax
38## Syntax
docs/hoon/twig/tis-flow/fas-var.md+35−1
@@ -10,8 +10,42 @@ noun with the subject.
10
10
11## Expands to
11## Expands to
12
12
13+*if `p` is a symbol*:
14+
15+```
16+:pin(:name(p q) r)
17+```
18+
19+```
20+=+(^=(p q) r)
21+```
22+
23+*if `p` is a symbol with a mold*:
24+
25+```
26+:pin(:cast(p q) r)
27+```
28+
29+```
30+=+(^-(p q) r)
31+```
32+
33+### Compiler Macro
34+
35+```
36+:ifat p
37+ :pin :name(p q)
38+ r
39+:pin :cast(:coat(p.p q.p) q)
40+r
41+```
42+
13```
43```
14−?@(p :pin(:name(p q) r) :pin(:cast(:coat(p q) r)
44+?@ p
45+ =+ p=q
46+ r
47+=+ ^-($=(p.p q.p) q)
48+r
15```
49```
16
50
17## Syntax
51## Syntax
docs/hoon/twig/wut-test/bar-or.md+18
@@ -9,7 +9,16 @@ sort: 9
9
9
10## Expands to
10## Expands to
11
11
12+*Pseudocode*, `a`, `b`, `c`, ... as elements of `p`
13+
14+```
15+:if(a & :if(b & :if(c & :if(... :if(z & |)))))
16+```
17+
18+### Compiler Macro
19+
12```
20```
21+:loop
13:ifno p
22:ifno p
14 |
23 |
15:if i.p
24:if i.p
@@ -17,6 +26,15 @@ sort: 9
17:moar(p t.p)
26:moar(p t.p)
18```
27```
19
28
29+```
30+|-
31+?~ p
32+ |
33+?: i.p
34+ &
35+$(p t.p)
36+```
37+
20## Syntax
38## Syntax
21
39
22Regular: *running*.
40Regular: *running*.
docs/hoon/twig/wut-test/hep-case.md+23−1
@@ -10,14 +10,36 @@ union, with no default.
10
10
11## Expands to
11## Expands to
12
12
13+*Pseudocode*, `a`, `b`, `c`, ... as elements of `q`
14+
15+```
16+:if :fits(p.a) q.a
17+:if :fits(p.b) q.b
18+:if :fits(p.c) q.c
19+...
20+:show(%mint-lost !!)
21+```
22+
23+### Compiler Macro
24+
13```
25```
26+:loop
14:ifno q
27:ifno q
15− :lost
28+ :show(%mint-lost !!)
16:if :fits(p.i.q p)
29:if :fits(p.i.q p)
17 q.i.q
30 q.i.q
18:moar(q t.q)
31:moar(q t.q)
19```
32```
20
33
34+```
35+|-
36+?. q
37+ ~|(%mint-lost !!)
38+?: ?=(p.i.q p)
39+ q.i.q
40+$(q t.q)
41+```
42+
21## Syntax
43## Syntax
22
44
23Regular: *1-fixed*, then *jogging*.
45Regular: *1-fixed*, then *jogging*.
docs/hoon/twig/wut-test/lus-deft.md+22
@@ -10,7 +10,20 @@ a union, with a default.
10
10
11## Expands to
11## Expands to
12
12
13+*Pseudocode*, `a`, `b`, `c`, ... as elements of `r`
14+
15+```
16+:if :fits(p.a) q.a
17+:if :fits(p.b) q.b
18+:if :fits(p.c) q.c
19+...
20+q
21+```
22+
23+### Compiler Macro
24+
13```
25```
26+:loop
14:ifno r
27:ifno r
15 q
28 q
16:if :fits(p.i.r p)
29:if :fits(p.i.r p)
@@ -18,6 +31,15 @@ a union, with a default.
18:moar(r t.r)
31:moar(r t.r)
19```
32```
20
33
34+```
35+|-
36+?. r
37+ q
38+?: ?=(p.i.r p)
39+ q.i.r
40+$(r t.r)
41+```
42+
21## Syntax
43## Syntax
22
44
23Regular: *2-fixed*, then *jogging*.
45Regular: *2-fixed*, then *jogging*.
docs/hoon/twig/wut-test/pam-and.md+18
@@ -9,7 +9,16 @@ sort: 8
9
9
10## Expands to
10## Expands to
11
11
12+*Pseudocode*, `a`, `b`, `c`, ... as elements of `p`
13+
14+```
15+:lest(a | :lest(b | :lest(c | :lest(... :lest(z | &)))))
16+```
17+
18+### Compiler Macro
19+
12```
20```
21+:loop
13:ifno p
22:ifno p
14 &
23 &
15:lest i.p
24:lest i.p
@@ -17,6 +26,15 @@ sort: 8
17:moar(p t.p)
26:moar(p t.p)
18```
27```
19
28
29+```
30+|-
31+?~ p
32+ &
33+?. i.p
34+ |
35+$(p t.p)
36+```
37+
20## Syntax
38## Syntax
21
39
22Regular: *running*.
40Regular: *running*.