on master help sign in
Merge pull request #1100 from urbit/revise-irregular-forms
d5e09fdpoprox
hoon/reference/irregular.md+108−55
@@ -7,53 +7,62 @@ aliases = ["docs/reference/hoon-expressions/irregular/"]
7
7
8##### Reading guide
8##### Reading guide
9
9
10+Headings contain runes, phonetics and tokens. Description contains a link to the
10−Headings contain runes, phonetics and tokens. Description contains a link to the docs and a short description of the rune. Both regular (R) and irregular (I) forms are given.
11+docs and a short description of the rune. Both regular and irregular forms are given.
11
12
12Want to `Ctrl-f` to find out the meaning of something weird you saw? Search for `\symbol`. ie `\?` or `\=`. It'll show you to the irregular forms that uses that symbol.
13Want to `Ctrl-f` to find out the meaning of something weird you saw? Search for `\symbol`. ie `\?` or `\=`. It'll show you to the irregular forms that uses that symbol.
13
14
14−## . dot (nock)
15+## `.` dot (nock)
15
16
16Anything Nock can do, Hoon can do also.
17Anything Nock can do, Hoon can do also.
17
18
18−### .+ dotlus
19+### `.+` dotlus
19
20
20[docs](@/docs/hoon/reference/rune/dot.md#dotlus) \\+
21[docs](@/docs/hoon/reference/rune/dot.md#dotlus) \\+
22+
21`[%dtls p=atom]`: increment an atom with Nock 4.
23`[%dtls p=atom]`: increment an atom with Nock 4.
22
24
23−R: `.+(p)`
25+Regular: `.+(p)`
24−I: `+(p)`
26+
27+Irregular: `+(p)`
25
28
26−### .= dottis
29+### `.=` dottis
27
30
28[docs](@/docs/hoon/reference/rune/dot.md#dottis) \\=
31[docs](@/docs/hoon/reference/rune/dot.md#dottis) \\=
32+
29`[%dtts p=hoon q=hoon]`: test for equality with Nock 5.
33`[%dtts p=hoon q=hoon]`: test for equality with Nock 5.
30
34
31−R: `.=(p q)`
35+Regular: `.=(p q)`
32−I: `=(p q)`
33
36
37+Irregular: `=(p q)`
38+
34−## ; mic (make)
39+## `;` mic (make)
35
40
36Miscellaneous useful macros.
41Miscellaneous useful macros.
37
42
38−### ;: miccol
43+### `;:` miccol
39
44
40[docs](@/docs/hoon/reference/rune/mic.md#miccol) \\:
45[docs](@/docs/hoon/reference/rune/mic.md#miccol) \\:
46+
41`[%mccl p=hoon q=(list hoon)]`: call a binary function as an n-ary function.
47`[%mccl p=hoon q=(list hoon)]`: call a binary function as an n-ary function.
42
48
43−R: `;:(p q)`
49+Regular: `;:(p q)`
44−I: `:(p q)`
50+
51+Irregular: `:(p q)`
45
52
46−## : col (cells)
53+## `:` col (cells)
47
54
48The cell runes.
55The cell runes.
49
56
50−### :- colhep
57+### `:-` colhep
51
58
52[docs](@/docs/hoon/reference/rune/col.md#colhep) \\[\\]\\^\\+\\\`\\~
59[docs](@/docs/hoon/reference/rune/col.md#colhep) \\[\\]\\^\\+\\\`\\~
60+
53`[%clhp p=hoon q=hoon]`: construct a cell (2-tuple).
61`[%clhp p=hoon q=hoon]`: construct a cell (2-tuple).
54
62
55−R: `:-(p q)`
63+Regular: `:-(p q)`
56−I:
64+
65+Irregular:
57
66
58```
67```
59 [a b] ==> :-(a b)
68 [a b] ==> :-(a b)
@@ -66,21 +75,24 @@ I:
66 [a b]~ ==> [[a b] ~]
75 [a b]~ ==> [[a b] ~]
67```
76```
68
77
69−## = tis (flow)
78+## `=` tis (flow)
70
79
71Flow hoons change the subject. All non-flow hoons (except cores) pass the subject down unchanged.
80Flow hoons change the subject. All non-flow hoons (except cores) pass the subject down unchanged.
72
81
73−### =< tisgal
82+### `=<` tisgal
74
83
75[docs](@/docs/hoon/reference/rune/tis.md#tisgal) \\:
84[docs](@/docs/hoon/reference/rune/tis.md#tisgal) \\:
85+
76`[%tsgl p=hoon q=hoon]`: compose two hoons, inverted.
86`[%tsgl p=hoon q=hoon]`: compose two hoons, inverted.
77
87
78−R: `=<(p q)`
88+Regular: `=<(p q)`
79−I: `p:q`
80
89
90+Irregular: `p:q`
91+
81−## | bar (core)
92+## `|` bar (core)
82
93
83[docs](@/docs/hoon/reference/rune/bar.md) \\$
94[docs](@/docs/hoon/reference/rune/bar.md) \\$
95+
84Core hoons are flow hoon.
96Core hoons are flow hoon.
85
97
86Technically not irregular syntax, but worth mentioning.
98Technically not irregular syntax, but worth mentioning.
@@ -92,103 +104,143 @@ Technically not irregular syntax, but worth mentioning.
92
104
93The above runes produce a core with a single arm, named `$` ("buc"). We can recompute this arm with changes, useful for recursion among other things. Commonly used with the irregular syntax for `%=`, `:make`, like so: `$()`.
105The above runes produce a core with a single arm, named `$` ("buc"). We can recompute this arm with changes, useful for recursion among other things. Commonly used with the irregular syntax for `%=`, `:make`, like so: `$()`.
94
106
95−## % cen (call)
107+## `%` cen (call)
96
108
97The invocation family of runes.
109The invocation family of runes.
98
110
99−### %= centis
111+### `%=` centis
100
112
101[docs](@/docs/hoon/reference/rune/cen.md#centis) \\(\\)
113[docs](@/docs/hoon/reference/rune/cen.md#centis) \\(\\)
114+
102`[%cnts p=wing q=(list (pair wing hoon))]`: take a wing with changes.
115`[%cnts p=wing q=(list (pair wing hoon))]`: take a wing with changes.
103
116
104−R: `%=(p a 1)`
117+Regular: `%=(p a 1)`
105−I: `p(a 1)`
118+
119+Irregular: `p(a 1)`
106
120
107−### %~ censig
121+### `%~` censig
108
122
109[docs](@/docs/hoon/reference/rune/cen.md#censig) \\~
123[docs](@/docs/hoon/reference/rune/cen.md#censig) \\~
124+
110`[%cnsg p=wing q=hoon r=hoon]`: call with multi-armed door.
125`[%cnsg p=wing q=hoon r=hoon]`: call with multi-armed door.
111
126
112−R: `%~(p q r)`
127+Regular: `%~(p q r)`
113−I: `~(p q r)`
114
128
129+Irregular: `~(p q r)`
130+
115−### %- cenhep
131+### `%-` cenhep
116
132
117[docs](@/docs/hoon/reference/rune/cen.md#cenhep) \\(\\)
133[docs](@/docs/hoon/reference/rune/cen.md#cenhep) \\(\\)
134+
118`[%cnhp p=hoon q=hoon]`: call a gate (function).
135`[%cnhp p=hoon q=hoon]`: call a gate (function).
119
136
120−R: `%-(p q)`
137+Regular: `%-(p q)`
121−I: `(p q)`
138+
139+Irregular: `(p q)`
122
140
123Note: `(p)` becomes `$:p` (`=<($ p)`), which behaves as you would expect (func call w/o args).
141Note: `(p)` becomes `$:p` (`=<($ p)`), which behaves as you would expect (func call w/o args).
124
142
125−## $ buc (mold)
143+## `$` buc (mold)
126
144
127A mold is a gate (function) that helps us build simple and rigorous data structures.
145A mold is a gate (function) that helps us build simple and rigorous data structures.
128
146
129−### $? bucwut
147+### `$?` bucwut
130
148
131[docs](@/docs/hoon/reference/rune/buc.md#bucwut) \\?
149[docs](@/docs/hoon/reference/rune/buc.md#bucwut) \\?
150+
132`[%bcwt p=(list model)]`: mold which normalizes a general union.
151`[%bcwt p=(list model)]`: mold which normalizes a general union.
133
152
134−R: `$?(p)`
153+Regular: `$?(p)`
135−I: `?(p)`
154+
155+Irregular: `?(p)`
136
156
137−### $_ buccab
157+### `$_` buccab
138
158
139[docs](@/docs/hoon/reference/rune/buc.md#buccab) \\_
159[docs](@/docs/hoon/reference/rune/buc.md#buccab) \\_
160+
140`[%bccb p=value]`: mold which normalizes to an example.
161`[%bccb p=value]`: mold which normalizes to an example.
141
162
142−R: `$_(p)`
163+Regular: `$_(p)`
143−I: `_p`
164+
165+Irregular: `_p`
144
166
145−## ? wut (test)
167+## `?` wut (test)
146
168
147Hoon has the usual branches and logical tests.
169Hoon has the usual branches and logical tests.
148
170
149−### ?! wutzap
171+### `?!` wutzap
150
172
151[docs](@/docs/hoon/reference/rune/wut.md#wutzap) \\!
173[docs](@/docs/hoon/reference/rune/wut.md#wutzap) \\!
174+
152`[%wtzp p=hoon]`: logical not.
175`[%wtzp p=hoon]`: logical not.
153
176
154−R: `?!(p)`
177+Regular: `?!(p)`
155−I: `!(p)`
178+
179+Irregular: `!(p)`
156
180
157−### ?& wutpam
181+### `?&` wutpam
158
182
159[docs](@/docs/hoon/reference/rune/wut.md#wutpam) \\&
183[docs](@/docs/hoon/reference/rune/wut.md#wutpam) \\&
184+
160`[%wtpm p=(list hoon)]`: logical and.
185`[%wtpm p=(list hoon)]`: logical and.
161
186
162−R: `?&(p)`
187+Regular: `?&(p)`
163−I: `&(p)`
164
188
189+Irregular: `&(p)`
190+
165−### ?| wutbar
191+### `?|` wutbar
166
192
167[docs](@/docs/hoon/reference/rune/wut.md#wutbar) \\|
193[docs](@/docs/hoon/reference/rune/wut.md#wutbar) \\|
194+
168`[%wtbr p=(list hoon)]`: logical or.
195`[%wtbr p=(list hoon)]`: logical or.
169
196
170−R: `?|(p)`
197+Regular: `?|(p)`
171−I: `|(p)`
198+
199+Irregular: `|(p)`
172
200
173−## ^ ket (cast)
201+## `^` ket (cast)
174
202
175Lets us adjust types without violating type constraints.
203Lets us adjust types without violating type constraints.
176
204
205+### `^:` ketcol
206+
207+[docs](@/docs/hoon/reference/ket.md#ketcol) \\,
208+
209+`[%ktcl p=spec]`: mold gate for type `p`.
210+
211+Regular: `^:(p)`
212+
213+Irregular: `,p`
214+
177−### ^- kethep
215+### `^-` kethep
178
216
179[docs](@/docs/hoon/reference/rune/ket.md#kethep) \\\`
217[docs](@/docs/hoon/reference/rune/ket.md#kethep) \\\`
218+
180`[%kthp p=model q=value]`: typecast by mold.
219`[%kthp p=model q=value]`: typecast by mold.
181
220
182−R: `^-(p q)`
221+Regular: `^-(p q)`
183−I: `` `p`q ``
222+
223+Irregular: `` `p`q ``
224+
225+### `^*` kettar
226+
227+[docs](@/docs/hoon/reference/rune/ket.md#kettar) \\*
228+
229+`[%kttr p=spec]`: produce bunt value of mold.
184
230
231+Regular: `^*(p)`
232+
233+Irregular: `*p`
234+
185−### ^= kettis
235+### `^=` kettis
186
236
187[docs](@/docs/hoon/reference/rune/ket.md#kettis) \\=
237[docs](@/docs/hoon/reference/rune/ket.md#kettis) \\=
238+
188`[%ktts p=toga q=value]`: name a value.
239`[%ktts p=toga q=value]`: name a value.
189
240
190−R: `^=(p q)`
241+Regular: `^=(p q)`
191−I: `p=q`
242+
243+Irregular: `p=q`
192
244
193## Miscellaneous
245## Miscellaneous
194
246
@@ -220,6 +272,7 @@ See [%sand](@/docs/hoon/reference/rune/constants.md#warm) for other irregular de
220### Limbs
272### Limbs
221
273
222[docs](@/docs/hoon/reference/limbs/limb.md) \\+\\.\\^
274[docs](@/docs/hoon/reference/limbs/limb.md) \\+\\.\\^
275+
223`[%limb p=(each @ud [p=@ud q=@tas])]`: attribute of subject.
276`[%limb p=(each @ud [p=@ud q=@tas])]`: attribute of subject.
224
277
225- `+15` is slot 15
278- `+15` is slot 15