on 99bdb21 help sign in
87 lines 1.7 kB history raw
1+++
2title = "5b: Macro Expansion"
3weight = 44
4template = "doc.html"
5+++
7These functions are used internally by the compiler. They should not be used
8directly and are only listed here for completeness.
10## `++ah`
12Tiki engine
14#### Source
16```hoon
17++ ah
18 |_ tik=tiki
19 ++ blue
20 |= gen=hoon
21 ^- hoon
22 ?. &(?=(%| -.tik) ?=(~ p.tik)) gen
23 [%tsgr [%$ 3] gen]
24 ::
25 ++ teal
26 |= mod=spec
27 ^- spec
28 ?: ?=(%& -.tik) mod
29 [%over [%& 3]~ mod]
30 ::
31 ++ tele
32 |= syn=skin
33 ^- skin
34 ?: ?=(%& -.tik) syn
35 [%over [%& 3]~ syn]
36 ::
37 ++ gray
38 |= gen=hoon
39 ^- hoon
40 ?- -.tik
41 %& ?~(p.tik gen [%tstr [u.p.tik ~] [%wing q.tik] gen])
42 %| [%tsls ?~(p.tik q.tik [%ktts u.p.tik q.tik]) gen]
43 ==
44 ::
45 ++ puce
46 ^- wing
47 ?- -.tik
48 %& ?~(p.tik q.tik [u.p.tik ~])
49 %| [[%& 2] ~]
50 ==
51 ::
52 ++ wthp |= opt=(list (pair spec hoon))
53 %+ gray %wthp
54 [puce (turn opt |=([a=spec b=hoon] [a (blue b)]))]
55 ++ wtkt |=([sic=hoon non=hoon] (gray [%wtkt puce (blue sic) (blue non)]))
56 ++ wtls |= [gen=hoon opt=(list (pair spec hoon))]
57 %+ gray %wtls
58 [puce (blue gen) (turn opt |=([a=spec b=hoon] [a (blue b)]))]
59 ++ wtpt |=([sic=hoon non=hoon] (gray [%wtpt puce (blue sic) (blue non)]))
60 ++ wtsg |=([sic=hoon non=hoon] (gray [%wtsg puce (blue sic) (blue non)]))
61 ++ wthx |=(syn=skin (gray [%wthx (tele syn) puce]))
62 ++ wtts |=(mod=spec (gray [%wtts (teal mod) puce]))
63 --
64::
65```
67---
69## `++ax`
71Spec engine
73#### Source
75This core is very large, refer to `hoon.hoon` for the source.
77---
79## `++ap`
81Hoon engine
83#### Source
85This core is very large, refer to `hoon.hoon` for the source.
87---