on master help sign in
update stdlib 4c to 4f

- 4c - add ++wash, - remove rig:re, din:re, fit:re and wig:re - remove ++shep, ++shop - update ToC and glossary.js as appropriate - refresh existing functions - 4d - refresh existing functions - 4e - refresh existing functions - 4f - add ++fuss, ++inde, ++perk, ++punt - update ToC and glossary.js as appropriate - refresh existing functions

commitb89ac891aa29f43e2f89a20f85564520ff9d1bfa authorTinnus Napbus <admin@tinnus-napbus.xyz> dateSat 1 Jan 2022, 00:19 (5 years ago) parent5984617
6 files changed+1281−1058
content/docs/hoon/reference/stdlib/4c.md+296−260 content/docs/hoon/reference/stdlib/4d.md+33−33 content/docs/hoon/reference/stdlib/4e.md+194−186 content/docs/hoon/reference/stdlib/4f.md+710−521 content/docs/hoon/reference/stdlib/table-of-contents.md+12−15 lib/glossary.js+36−43
content/docs/hoon/reference/stdlib/4c.md+296−260
@@ -4,357 +4,393 @@ weight = 30
44template = "doc.html"
55+++
66
7−## `++re`
7+## `++wash`
88
9−Pretty-printing engine
9+Render tank at width
1010
11−Pretty-printing engine that accepts a `++tank` sample and contains arms that perform computation on it.
11+Render `tac` with indent `tab` and maximum width `edg`. If `tac` cannot be
12+rendered in-line in less than `tac` characters, it will be split into multiple
13+lines if possible. If `tac` cannot be made to fit, `wash` will crash.
1214
1315#### Accepts
1416
15−`tac` is a `++tank`.
17+`[tab=@ edg=@]` - `tab` is the number of characters of indentation and `edge` is
18+the maximum number of characters of width.
19+
20+`tac` is a `tank`.
1621
1722#### Produces
1823
24+A `wall` (list of `tape`s).
25+
26+#### Source
27+
1928```hoon
20− ++ re
21− |_ tac/tank
29+++ wash
30+ |= [[tab=@ edg=@] tac=tank] ^- wall
31+ (~(win re tac) tab edg)
2232```
2333
2434#### Examples
2535
2636```
27− > ~(. re leaf+"ham")
28− <2.gdc {tac/{$leaf ""} <402.arm 110.jyx 1.ztu $151>}>
29−```
37+> =rose `tank`[%rose [" " "[" "]"] ~['abc' 'def' 'ghi']]
3038
31−---
39+> ((slog (crip (of-wall:format (wash [0 80] rose))) ~) ~)
40+[abc def ghi]
3241
33−### `++ram:re`
3442
35−Flatten to tape
43+> ((slog (crip (of-wall:format (wash [0 8] rose))) ~) ~)
44+[ abc
45+ def
46+ ghi
47+]
3648
37−Flatten `++tank` out into a `++tape`.
49+> ((slog (crip (of-wall:format (wash [3 15] rose))) ~) ~)
50+ [ abc
51+ def
52+ ghi
53+ ]
54+```
3855
39−#### Accepts
56+## `++re`
4057
41−`tac` is a `++tank`, taken from sample of `++re` core.
58+Pretty-printing engine
4259
43−#### Produces
60+Container core for a pretty-printing engine that accepts a `tank` sample and contains arms that perform computation on it.
61+
62+#### Accepts
4463
45−A `++tape`.
64+`tac` is a `tank`.
4665
4766#### Source
4867
4968```hoon
50− ++ ram
51− ^- tape
52− ?- -.tac
53− $leaf p.tac
54− $palm ram(tac [%rose [p.p.tac (weld q.p.tac r.p.tac) s.p.tac] q.tac])
55− $rose
56− %+ weld
57− q.p.tac
58− |- ^- tape
59− ?~ q.tac
60− r.p.tac
61− =+ voz=$(q.tac t.q.tac)
62− (weld ram(tac i.q.tac) ?~(t.q.tac voz (weld p.p.tac voz)))
63− ==
64− ::
65−```
66−
67−#### Examples
68−
69−```
70− > ~(ram re leaf+"foo")
71− "foo"
72− > ~(ram re rose+["." "(" ")"]^~[leaf+"bar" leaf+"baz" leaf+"bam"])
73− "(bar.baz.bam)"
69+++ re
70+ |_ tac=tank
7471```
7572
7673---
7774
78−### `++win:re`
75+### `++ram:re`
7976
80−Render at indent
77+Flatten to tape
8178
82−Render at indent level `tab` and width `edg`.
79+Flatten `tank` out into a `tape`.
8380
8481#### Accepts
8582
86−`tac` is a `++tank`, taken from sample of `++re` core.
87−
88−`tab` and `edg` are atoms.
83+`tac` is a `tank`, taken from sample of `++re` core.
8984
9085#### Produces
9186
92−A `++wall` (`++list` of `++tapes`).
87+A `tape`.
9388
9489#### Source
9590
9691```hoon
97− ++ win
98− |= {tab/@ edg/@}
99− =+ lug=`wall`~
100− |^ |- ^- wall
101− ?- -.tac
102− $leaf (rig p.tac)
103− $palm
104− ?: fit
105− (rig ram)
106− ?~ q.tac
107− (rig q.p.tac)
108− ?~ t.q.tac
109− (rig(tab (add 2 tab), lug $(tac i.q.tac)) q.p.tac)
110− => .(q.tac `(list tank)`q.tac)
111− =+ lyn=(mul 2 (lent q.tac))
112− =+ ^= qyr
113− |- ^- wall
114− ?~ q.tac
115− lug
116− %= ^$
117− tac i.q.tac
118− tab (add tab (sub lyn 2))
119− lug $(q.tac t.q.tac, lyn (sub lyn 2))
120− ==
121− (wig(lug qyr) q.p.tac)
122− ::
92+++ ram
93+ ^- tape
94+ ?@ tac
95+ (trip tac)
96+ ?- -.tac
97+ %leaf p.tac
98+ ::
99+ :: flat %palm rendered as %rose with welded openers
100+ ::
101+ %palm
102+ =* mid p.p.tac
103+ =* for (weld q.p.tac r.p.tac)
104+ =* end s.p.tac
105+ ram(tac [%rose [mid for end] q.tac])
106+ ::
107+ :: flat %rose rendered with open/mid/close
108+ ::
109+ %rose
110+ =* mid p.p.tac
111+ =* for q.p.tac
112+ =* end r.p.tac
113+ =* lit q.tac
114+ %+ weld
115+ for
116+ |- ^- tape
117+ ?~ lit
118+ end
119+ %+ weld
120+ ram(tac i.lit)
121+ =* voz $(lit t.lit)
122+ ?~(t.lit voz (weld mid voz))
123+ ==
123124```
124125
125126#### Examples
126127
127128```
128− > (~(win re leaf+"samoltekon-lapdok") 0 20)
129− <<"samoltekon-lapdok">>
130−
131− > (~(win re leaf+"samoltekon-lapdok") 0 10)
132− <<"\/samolt\/" " ekon-l" " apdok" "\/ \/">>
133−
134− > (~(win re rose+["--" "[" "]"]^~[leaf+"1423" leaf+"2316"]) 0 20)
135− <<"[1423--2316]">>
129+> ~(ram re leaf+"foo")
130+"foo"
136131
137− > (~(win re rose+["--" "[" "]"]^~[leaf+"1423" leaf+"2316"]) 0 10)
138− <<"[ 1423" " 2316" "]">>
132+> ~(ram re [%rose [" " "[" "]"] ~['abc' 'def' 'ghi']])
133+"[abc def ghi]"
139134```
140135
141136---
142137
143−### `++din:re`
144−
145−XX document
146−
147−#### Accepts
148−
149−#### Produces
150−
151−#### Source
152−
153− ++ din (mod (add 2 tab) (mul 2 (div edg 3)))
154−
155−---
156−
157−### `++fit:re`
158−
159−Fit on one line test
160−
161−Determine whether `tac` fits on one line. Internal to `++win`
162−
163−#### Accepts
164−
165−#### Produces
166−
167−#### Source
168−
169−++ fit (lte (lent ram) (sub edg tab))
170−
171−#### Examples
172−
173−---
174−
175−### `++rig:re`
138+### `++win:re`
176139
177−Wrap in `\/`
140+Render at indent
178141
179−Wrap `++tape` in `\/` if it doesn't fit at current indentation. Internal to
180−`++win`
142+Render at indent level `tab` and width `edg`.
181143
182144#### Accepts
183145
184−`tac` is a `++tank`, taken from sample of `++re` core.
146+`tac` is a `tank`, taken from sample of `++re` core.
185147
186−`hom` is a `++tape`.
148+`tab` and `edg` are atoms.
187149
188150#### Produces
189151
190−A `++wall` (list of `++tape`s).
152+A `wall` (list of `tape`).
191153
192154#### Source
193155
194156```hoon
195− ++ rig
196− |= hom/tape
197− ^- wall
198− ?: & ::(lte (lent hom) (sub edg tab))
199− [(runt [tab ' '] hom) lug]
200− => .(tab (add tab 2), edg (sub edg 2))
201− =+ mut=(trim (sub edg tab) hom)
202− :- (runt [(sub tab 2) ' '] ['\\' '/' (weld p.mut `_hom`['\\' '/' ~])])
203− => .(hom q.mut)
204− |-
205− ?~ hom
206− :- %+ runt
207− [(sub tab 2) ' ']
208− ['\\' '/' (runt [(sub edg tab) ' '] ['\\' '/' ~])]
157+++ win
158+ |= [tab=@ud edg=@ud]
159+ :: output stack
160+ ::
161+ =| lug=wall
162+ |^ ^- wall
163+ ?@ tac
164+ (rig (trip tac))
165+ ?- -.tac
166+ %leaf (rig p.tac)
167+ ::
168+ %palm
169+ =/ hom ram
170+ ?: (lte (lent hom) (sub edg tab))
171+ (rig hom)
172+ ::
173+ =* for q.p.tac
174+ =* lit q.tac
175+ ?~ lit
176+ (rig for)
177+ ?~ t.lit
178+ =: tab (add 2 tab)
179+ lug $(tac i.lit)
180+ ==
181+ (rig for)
182+ ::
183+ => .(lit `(list tank)`lit)
184+ =/ lyn (mul 2 (lent lit))
185+ =. lug
186+ |- ^- wall
187+ ?~ lit
209188 lug
210− => .(mut (trim (sub edg tab) hom))
211− [(runt [tab ' '] p.mut) $(hom q.mut)]
189+ =/ nyl (sub lyn 2)
190+ %= ^$
191+ tac i.lit
192+ tab (add tab nyl)
193+ lug $(lit t.lit, lyn nyl)
194+ ==
195+ (wig for)
196+ ::
197+ %rose
198+ =/ hom ram
199+ ?: (lte (lent hom) (sub edg tab))
200+ (rig hom)
212201 ::
202+ =* for q.p.tac
203+ =* end r.p.tac
204+ =* lit q.tac
205+ =. lug
206+ |- ^- wall
207+ ?~ lit
208+ ?~(end lug (rig end))
209+ %= ^$
210+ tac i.lit
211+ tab (mod (add 2 tab) (mul 2 (div edg 3)))
212+ lug $(lit t.lit)
213+ ==
214+ ?~(for lug (wig for))
215+ ==
216+ :: +rig: indent tape and cons with output stack
217+ ::
218+ ++ rig
219+ |= hom=tape
220+ ^- wall
221+ [(runt [tab ' '] hom) lug]
222+ :: +wig: indent tape and cons with output stack
223+ ::
224+ :: joined with the top line if whitespace/indentation allow
225+ ::
226+ ++ wig
227+ |= hom=tape
228+ ^- wall
229+ ?~ lug
230+ (rig hom)
231+ =/ wug :(add 1 tab (lent hom))
232+ ?. =+ mir=i.lug
233+ |- ^- ?
234+ ?~ mir |
235+ ?| =(0 wug)
236+ ?&(=(' ' i.mir) $(mir t.mir, wug (dec wug)))
237+ ==
238+ (rig hom) :: ^ XX regular form?
239+ :_ t.lug
240+ %+ runt [tab ' ']
241+ (weld hom `tape`[' ' (slag wug i.lug)])
242+ --
213243```
214244
215245#### Examples
216246
217−---
218−
219−### `++wig:re`
220−
221−`++win` render tape
222−
223−Render `++tape`. Internal to `++win`.
224−
225−#### Accepts
247+```
248+> =rose `tank`[%rose [" " "[" "]"] ~['abc' 'def' 'ghi']]
226249
227−`tac` is a `++tank`, taken from sample of `++re` core.
250+> ((slog (crip (of-wall:format (~(win re rose) 0 80))) ~) ~)
251+[abc def ghi]
228252
229−`hom` is a `++tape`.
253+> ((slog (crip (of-wall:format (~(win re rose) 3 80))) ~) ~)
254+ [abc def ghi]
230255
231−#### Produces
256+> ((slog (crip (of-wall:format (~(win re rose) 0 10))) ~) ~)
257+[ abc
258+ def
259+ ghi
260+]
232261
233−```hoon
234− ++ wig
235− |= hom/tape
236− ^- wall
237− ?~ lug
238− (rig hom)
239− =+ lin=(lent hom)
240− =+ wug=:(add 1 tab lin)
241− ?. =+ mir=i.lug
242− |- ?~ mir
243− |
244− ?|(=(0 wug) ?&(=(' ' i.mir) $(mir t.mir, wug (dec wug))))
245− (rig hom) :: ^ XX regular form?
246− [(runt [tab ' '] (weld hom `tape`[' ' (slag wug i.lug)])) t.lug]
247− --
248− --
262+> ((slog (crip (of-wall:format (~(win re rose) 3 15))) ~) ~)
263+ [ abc
264+ def
265+ ghi
266+ ]
249267```
250268
251269---
252270
253271## `++show`
254272
255−```hoon
256− ++ show :: XX deprecated, use span
257− |= vem/*
258− |^ ^- tank
259− ?: ?=(@ vem)
260− [%leaf (mesc (trip vem))]
261− ?- vem
262− {s/$~ c/*}
263− [%leaf '\'' (weld (mesc (tape +.vem)) `tape`['\'' ~])]
264− ::
265− {s/$a c/@} [%leaf (mesc (trip c.vem))]
266− {s/$b c/*} (shop c.vem |=(a/@ ~(rub at a)))
267− {s/{$c p/@} c/*}
268− :+ %palm
269− [['.' ~] ['-' ~] ~ ~]
270− [[%leaf (mesc (trip p.s.vem))] $(vem c.vem) ~]
271− ::
272− {s/$d c/*} (shop c.vem |=(a/@ ~(rud at a)))
273− {s/$k c/*} (tank c.vem)
274− {s/$h c/*}
275− :+ %rose
276− [['/' ~] ['/' ~] ~]
277− =+ yol=((list @ta) c.vem)
278− (turn yol |=(a/@ta [%leaf (trip a)]))
279− ::
280− {s/$l c/*} (shol c.vem)
281− {s/$o c/*}
282− %= $
283− vem
284− :- [%m '%h:<[%d %d].[%d %d]>']
285− [-.c.vem +<-.c.vem +<+.c.vem +>-.c.vem +>+.c.vem ~]
286− ==
287− ::
288− {s/$p c/*} (shop c.vem |=(a/@ ~(rup at a)))
289− {s/$q c/*} (shop c.vem |=(a/@ ~(r at a)))
290− {s/$r c/*} $(vem [[%r ' ' '{' '}'] c.vem])
291− {s/$t c/*} (shop c.vem |=(a/@ ~(rt at a)))
292− {s/$v c/*} (shop c.vem |=(a/@ ~(ruv at a)))
293− {s/$x c/*} (shop c.vem |=(a/@ ~(rux at a)))
294− {s/{$m p/@} c/*} (shep p.s.vem c.vem)
295− {s/{$r p/@} c/*}
296− $(vem [[%r ' ' (cut 3 [0 1] p.s.vem) (cut 3 [1 1] p.s.vem)] c.vem])
297− ::
298− {s/{$r p/@ q/@ r/@} c/*}
299− :+ %rose
300− :* p=(mesc (trip p.s.vem))
301− q=(mesc (trip q.s.vem))
302− r=(mesc (trip r.s.vem))
303− ==
304− |- ^- (list tank)
305− ?@ c.vem
306− ~
307− [^$(vem -.c.vem) $(c.vem +.c.vem)]
308− ::
309− {s/$z c/*} $(vem [[%r %$ %$ %$] c.vem])
310− * !!
311− ==
312−```
273+Pretty-printer (deprecated)
313274
314−XX document
275+Pretty prints noun `vem`, producing a `tank`. This function is deprecated and in
276+most cases produces outdated syntax or incorrect results.
315277
316−## `++shep`
278+#### Accepts
317279
318−```hoon
319− ++ shep
320− |= {fom/@ gar/*}
321− ^- tank
322− =+ l=(met 3 fom)
323− =+ i=0
324− :- %leaf
325− |- ^- tape
326− ?: (gte i l)
327− ~
328− =+ c=(cut 3 [i 1] fom)
329− ?. =(37 c)
330− (weld (mesc [c ~]) $(i +(i)))
331− =+ d=(cut 3 [+(i) 1] fom)
332− ?. .?(gar)
333− ['\\' '#' $(i (add 2 i))]
334− (weld ~(ram re (show d -.gar)) $(i (add 2 i), gar +.gar))
335− ::
336−```
280+`vem` is a noun.
337281
338−XX document
282+#### Produces
339283
340−## `++shop`
284+A `tank`.
285+
286+#### Source
341287
342288```hoon
343− ++ shop
344− |= {aug/* vel/$-(a/@ tape)}
345− ^- tank
346− ?: ?=(@ aug)
347− [%leaf (vel aug)]
289+++ show
290+ |= vem=*
291+ |^ ^- tank
292+ ?: ?=(@ vem)
293+ [%leaf (mesc (trip vem))]
294+ ?- vem
295+ [s=~ c=*]
296+ [%leaf '\'' (weld (mesc (tape +.vem)) `tape`['\'' ~])]
297+ ::
298+ [s=%a c=@] [%leaf (mesc (trip c.vem))]
299+ [s=%b c=*] (shop c.vem |=(a=@ ~(rub at a)))
300+ [s=[%c p=@] c=*]
301+ :+ %palm
302+ [['.' ~] ['-' ~] ~ ~]
303+ [[%leaf (mesc (trip p.s.vem))] $(vem c.vem) ~]
304+ ::
305+ [s=%d c=*] (shop c.vem |=(a=@ ~(rud at a)))
306+ [s=%k c=*] (tank c.vem)
307+ [s=%h c=*]
308+ :+ %rose
309+ [['/' ~] ['/' ~] ~]
310+ =+ yol=((list @ta) c.vem)
311+ (turn yol |=(a=@ta [%leaf (trip a)]))
312+ ::
313+ [s=%l c=*] (shol c.vem)
314+ [s=%o c=*]
315+ %= $
316+ vem
317+ :- [%m '%h::[%d %d].[%d %d]>']
318+ [-.c.vem +<-.c.vem +<+.c.vem +>-.c.vem +>+.c.vem ~]
319+ ==
320+ ::
321+ [s=%p c=*] (shop c.vem |=(a=@ ~(rup at a)))
322+ [s=%q c=*] (shop c.vem |=(a=@ ~(r at a)))
323+ [s=%r c=*] $(vem [[%r ' ' '{' '}'] c.vem])
324+ [s=%t c=*] (shop c.vem |=(a=@ ~(rt at a)))
325+ [s=%v c=*] (shop c.vem |=(a=@ ~(ruv at a)))
326+ [s=%x c=*] (shop c.vem |=(a=@ ~(rux at a)))
327+ [s=[%m p=@] c=*] (shep p.s.vem c.vem)
328+ [s=[%r p=@] c=*]
329+ $(vem [[%r ' ' (cut 3 [0 1] p.s.vem) (cut 3 [1 1] p.s.vem)] c.vem])
330+ ::
331+ [s=[%r p=@ q=@ r=@] c=*]
348332 :+ %rose
349− [[' ' ~] ['[' ~] [']' ~]]
350− => .(aug `*`aug)
333+ :* p=(mesc (trip p.s.vem))
334+ q=(mesc (trip q.s.vem))
335+ r=(mesc (trip r.s.vem))
336+ ==
351337 |- ^- (list tank)
352− ?: ?=(@ aug)
353− [^$ ~]
354− [^$(aug -.aug) $(aug +.aug)]
338+ ?@ c.vem
339+ ~
340+ [^$(vem -.c.vem) $(c.vem +.c.vem)]
355341 ::
342+ [s=%z c=*] $(vem [[%r %$ %$ %$] c.vem])
343+ * !!
344+ ==
345+ ++ shep
346+ |= [fom=@ gar=*]
347+ ^- tank
348+ =+ l=(met 3 fom)
349+ =+ i=0
350+ :- %leaf
351+ |- ^- tape
352+ ?: (gte i l)
353+ ~
354+ =+ c=(cut 3 [i 1] fom)
355+ ?. =(37 c)
356+ (weld (mesc [c ~]) $(i +(i)))
357+ =+ d=(cut 3 [+(i) 1] fom)
358+ ?. .?(gar)
359+ ['\\' '#' $(i (add 2 i))]
360+ (weld ~(ram re (show d -.gar)) $(i (add 2 i), gar +.gar))
361+ ::
362+ ++ shop
363+ |= [aug=* vel=$-(a=@ tape)]
364+ ^- tank
365+ ?: ?=(@ aug)
366+ [%leaf (vel aug)]
367+ :+ %rose
368+ [[' ' ~] ['[' ~] [']' ~]]
369+ => .(aug `*`aug)
370+ |- ^- (list tank)
371+ ?: ?=(@ aug)
372+ [^$ ~]
373+ [^$(aug -.aug) $(aug +.aug)]
374+ ::
375+ ++ shol
376+ |= lim=*
377+ :+ %rose
378+ [['.' ~] ~ ~]
379+ |- ^- (list tank)
380+ ?: ?=(@ lim) ~
381+ :_ $(lim +.lim)
382+ ?+ -.lim (show '#')
383+ ~ (show '$')
384+ c=@ (show c.lim)
385+ [%& %1] (show '.')
386+ [%& c=@]
387+ [%leaf '+' ~(rud at c.lim)]
388+ ::
389+ [%| @ ~] (show ',')
390+ [%| n=@ ~ c=@]
391+ [%leaf (weld (reap n.lim '^') ?~(c.lim "$" (trip c.lim)))]
392+ ==
393+ --
356394```
357395
358−XX document
359−
360396---
content/docs/hoon/reference/stdlib/4d.md+33−33
@@ -13,10 +13,10 @@ whichever is further along.
1313
1414#### Accepts
1515
16−`naz` is a `hair`.
17−
1816`zyc` is a `hair`.
1917
18+`naz` is a `hair`.
19+
2020#### Produces
2121
2222A `hair`.
@@ -24,27 +24,27 @@ A `hair`.
2424#### Source
2525
2626```hoon
27− ++ last |= [zyc=hair naz=hair]
28− ^- hair
29− ?: =(p.zyc p.naz)
30− ?:((gth q.zyc q.naz) zyc naz)
31− ?:((gth p.zyc p.naz) zyc naz)
27+++ last |= [zyc=hair naz=hair]
28+ ^- hair
29+ ?: =(p.zyc p.naz)
30+ ?:((gth q.zyc q.naz) zyc naz)
31+ ?:((gth p.zyc p.naz) zyc naz)
3232```
3333
3434#### Examples
3535
3636```
37− > (last [1 1] [1 2])
38− [p=1 q=2]
37+> (last [1 1] [1 2])
38+[p=1 q=2]
3939
40− > (last [2 1] [1 2])
41− [p=2 q=1]
40+> (last [2 1] [1 2])
41+[p=2 q=1]
4242
43− > (last [0 0] [99 0])
44− [p=99 q=0]
43+> (last [0 0] [99 0])
44+[p=99 q=0]
4545
46− > (last [7 7] [7 7])
47− [p=7 q=7]
46+> (last [7 7] [7 7])
47+[p=7 q=7]
4848```
4949
5050---
@@ -64,37 +64,37 @@ any other character.
6464
6565#### Produces
6666
67−A hair.
67+A `hair`.
6868
6969#### Source
7070
7171```hoon
72− ++ lust |= [weq=char naz=hair]
73− ^- hair
74− ?:(=(`@`10 weq) [+(p.naz) 1] [p.naz +(q.naz)])
72+++ lust |= [weq=char naz=hair]
73+ ^- hair
74+ ?:(=(`@`10 weq) [+(p.naz) 1] [p.naz +(q.naz)])
7575```
7676
7777#### Examples
7878
7979```
80− > (lust `a` [1 1])
81− [p=1 q=2]
80+> (lust `a` [1 1])
81+[p=1 q=2]
8282
83− > (lust `@t`10 [1 1])
84− [p=2 q=1]
83+> (lust `@t`10 [1 1])
84+[p=2 q=1]
8585
86− > (lust '9' [10 10])
87− [p=10 q=11]
86+> (lust '9' [10 10])
87+[p=10 q=11]
8888
89− > (roll "maze" [.(+<+ [1 1])]:lust)
90− [1 5]
89+> (roll "maze" [.(+<+ [1 1])]:lust)
90+[1 5]
9191
92− > %- roll :_ [.(+<+ [1 1])]:lust
93− """
94− Sam
95− lokes
96− """
97− [2 6]
92+> %- roll :_ [.(+<+ [1 1])]:lust
93+ """
94+ Sam
95+ lokes
96+ """
97+[2 6]
9898```
9999
100100---
content/docs/hoon/reference/stdlib/4e.md+194−186
@@ -8,7 +8,7 @@ template = "doc.html"
88
99Conditional composer
1010
11−Parsing composer: connects the `++edge` `vex` with the subsequent `++rule` `sab`
11+Parsing composer: connects the `edge` `vex` with the subsequent `rule` `sab`
1212as an optional suffix, using gate `raq` to compose or reject its
1313result. If there is no suffix, or if the suffix fails to be composed
1414with the current result, the current result is produced. Used to map a
@@ -24,50 +24,52 @@ group of rules to a specified output.
2424
2525#### Produces
2626
27−A `++rule`.
27+A `rule`.
2828
2929#### Source
3030
3131```hoon
32− ++ bend :: conditional comp
33− ~/ %bend
34− |* raq/_|*({a/* b/*} [~ u=[a b]])
35− ~/ %fun
36− |* {vex/edge sab/rule}
37− ?~ q.vex
38− vex
39− =+ yit=(sab q.u.q.vex)
40− =+ yur=(last p.vex p.yit)
41− ?~ q.yit
42− [p=yur q=q.vex]
43− =+ vux=(raq p.u.q.vex p.u.q.yit)
44− ?~ vux
45− [p=yur q=q.vex]
46− [p=yur q=[~ u=[p=u.vux q=q.u.q.yit]]]
47− ::
32+++ bend
33+ ~/ %bend
34+ =+ raq=|*([a=* b=*] [~ u=[a b]])
35+ |@
36+ ++ $
37+ ~/ %fun
38+ |* [vex=edge sab=rule]
39+ ?~ q.vex
40+ vex
41+ =+ yit=(sab q.u.q.vex)
42+ =+ yur=(last p.vex p.yit)
43+ ?~ q.yit
44+ [p=yur q=q.vex]
45+ =+ vux=(raq p.u.q.vex p.u.q.yit)
46+ ?~ vux
47+ [p=yur q=q.vex]
48+ [p=yur q=[~ u=[p=u.vux q=q.u.q.yit]]]
49+ --
4850```
4951
5052#### Examples
5153
5254```
53− > (;~((bend |=([a/char b/char] ?.(=(a b) ~ (some +(a))))) prn prn) [1 1] "qs")
54− [p=[p=1 q=3] q=[~ u=[p=~~q q=[p=[p=1 q=2] q="s"]]]]
55+> (;~((bend |=([a=char b=char] ?.(=(a b) ~ (some +(a))))) prn prn) [1 1] "qs")
56+[p=[p=1 q=3] q=[~ u=[p=113 q=[p=[p=1 q=2] q="s"]]]]
5557
56− > (;~((bend |=([a/char b/char] ?.(=(a b) ~ (some +(a))))) prn prn) [1 1] "qqq")
57− [p=[p=1 q=3] q=[~ u=[p=~~r q=[p=[p=1 q=3] q="q"]]]]
58+> (;~((bend |=([a=char b=char] ?.(=(a b) ~ (some +(a))))) prn prn) [1 1] "qqq")
59+[p=[p=1 q=3] q=[~ u=[p=114 q=[p=[p=1 q=3] q="q"]]]]
5860
59− > (scan "aa" ;~((bend |=([a/char b/char] ?.(=(a b) ~ (some +(a))))) prn prn))
60− ~~b
61+> `@t`(scan "aa" ;~((bend |=([a=char b=char] ?.(=(a b) ~ (some +(a))))) prn prn))
62+'b'
6163
62− > (scan "ba" ;~((bend |=([a/char b/char] ?.(=(a b) ~ (some +(a))))) prn prn))
63− ! {1 3}
64− ! exit
64+> (scan "ba" ;~((bend |=([a=char b=char] ?.(=(a b) ~ (some +(a))))) prn prn))
65+{1 3}
66+syntax error
6567
66− > `(unit @tas)`(scan "" ;~((bend) (easy ~) sym))
67− ~
68+> `(unit @tas)`(scan "" ;~((bend) (easy ~) sym))
69+~
6870
69− > `(unit @tas)`(scan "sep" ;~((bend) (easy ~) sym))
70− [~ %sep]
71+> `(unit @tas)`(scan "sep" ;~((bend) (easy ~) sym))
72+[~ %sep]
7173```
7274
7375---
@@ -76,50 +78,53 @@ A `++rule`.
7678
7779Arbitrary compose
7880
79−Parsing composer: connects the `++edge` `vex` with a following `++rule` `sab`,
81+Parsing composer: connects the `edge` `vex` with a following `rule` `sab`,
8082combining the contents of `vex` with the result of `sab` using a binary
81−gate `raq`. Used to fold over the results of several `++rules`.
83+gate `raq`. Used to fold over the results of several `rule`s.
8284
8385#### Accepts
8486
8587`raq` is a gate that accepts a cell of two nouns, `a` and `b`, and
8688produces a cell of two nouns.
8789
88−`sab` is a rule.
89−
9090`vex` is an edge.
9191
92+`sab` is a rule.
93+
9294#### Produces
9395
94−A `++rule`.
96+A `rule`.
9597
9698#### Source
9799
98100```hoon
99− ++ comp
100− ~/ %comp
101− |* raq/_|*({a/* b/*} [a b]) :: arbitrary compose
102− ~/ %fun
103− |* {vex/edge sab/rule}
104− ~! +<
105− ?~ q.vex
106− vex
107− =+ yit=(sab q.u.q.vex)
108− =+ yur=(last p.vex p.yit)
109− ?~ q.yit
110− [p=yur q=q.yit]
111− [p=yur q=[~ u=[p=(raq p.u.q.vex p.u.q.yit) q=q.u.q.yit]]]
112− ::
101+++ comp
102+ ~/ %comp
103+ =+ raq=|*([a=* b=*] [a b])
104+ |@
105+ ++ $
106+ ~/ %fun
107+ |* [vex=edge sab=rule]
108+ ~! +<
109+ ?~ q.vex
110+ vex
111+ =+ yit=(sab q.u.q.vex)
112+ =+ yur=(last p.vex p.yit)
113+ ?~ q.yit
114+ [p=yur q=q.yit]
115+ [p=yur q=[~ u=[p=(raq p.u.q.vex p.u.q.yit) q=q.u.q.yit]]]
116+ --
113117```
114118
115119#### Examples
116120
117121```
118− > (scan "123" ;~((comp |=([a/@u b/@u] (add a b))) dit dit dit))
119− 6
120− > (scan "12" ;~((comp |=([a/@u b/@u] (add a b))) dit dit dit))
121− ! {1 3}
122− ! exit
122+> (scan "123" ;~((comp |=([a=@ud b=@ud] (add a b))) dit dit dit))
123+6
124+
125+> (scan "12" ;~((comp |=([a=@ud b=@ud] (add a b))) dit dit dit))
126+{1 3}
127+syntax error
123128```
124129
125130---
@@ -128,31 +133,31 @@ A `++rule`.
128133
129134Never parse
130135
131−Produces an `++edge` at the same text position (`++hair`) with a failing
136+Produces an `edge` at the same text position (`hair`) with a failing
132137result (`q=~`).
133138
134139#### Accepts
135140
136−`tub` is a `++nail`.
141+`tub` is a `nail`.
137142
138143#### Produces
139144
140−An `++edge`.
145+An `edge`.
141146
142147#### Source
143148
144149```hoon
145− ++ fail |=(tub/nail [p=p.tub q=~]) :: never parse
150+++ fail |=(tub=nail [p=p.tub q=~])
146151```
147152
148153#### Examples
149154
150155```
151− > (fail [[1 1] "abc"])
152− [p=[p=1 q=1] q=~]
156+> (fail [[1 1] "abc"])
157+[p=[p=1 q=1] q=~]
153158
154− > (fail [[p=1.337 q=70] "Parse me, please?"])
155− [p=[p=1.337 q=70] q=~]
159+> (fail [[p=1.337 q=70] "Parse me, please?"])
160+[p=[p=1.337 q=70] q=~]
156161```
157162
158163---
@@ -161,46 +166,41 @@ An `++edge`.
161166
162167Skip delimiter
163168
164−Parsing composer: connects an `++edge` `vex` with a following `++rule` `sab` by
165−parsing the `++rule` `bus` (the delimiting symbol) and throwing out the
169+Parsing composer: connects an `edge` `vex` with a following `rule` `sab` by
170+parsing the `rule` `bus` (the delimiting symbol) and throwing out the
166171result.
167172
168173#### Accepts
169174
170−`bus` is a `++rule`.
175+`bus` is a `rule`.
171176
172−`sab` is a `++rule`.
177+`vex` is an `edge`.
173178
174−`vex` is an `++edge`.
179+`sab` is a `rule`.
175180
176181#### Produces
177182
183+A `rule`.
184+
178185#### Source
179186
180187```hoon
181− ++ glue :: add rule
182− ~/ %glue
183− |* bus/rule
184− ~/ %fun
185− |* {vex/edge sab/rule}
186− (plug vex ;~(pfix bus sab))
187− ::
188+++ glue
189+ ~/ %glue
190+ |* bus=rule
191+ ~/ %fun
192+ |* [vex=edge sab=rule]
193+ (plug vex ;~(pfix bus sab))
188194```
189195
190196#### Examples
191197
192198```
193− > (scan "200|mal|bon" ;~((glue bar) dem sym sym))
194− [q=200 7.102.829 7.237.474]
195−
196− > `[@u @tas @tas]`(scan "200|mal|bon" ;~((glue bar) dem sym sym))
197− [200 %mal %bon]
199+> `[@ud @tas @tas]`(scan "200|mal|bon" ;~((glue bar) dem sym sym))
200+[200 %mal %bon]
198201
199− > (scan "200|;|bon" ;~((glue bar) dem sem sym))
200− [q=200 ~~~3b. 7.237.474]
201−
202− > (scan "200.;.bon" ;~((glue dot) dem sem sym))
203− [q=200 ~~~3b. 7.237.474]
202+> `[@ud @t @tas]`(scan "200|;|bon" ;~((glue bar) dem mic sym))
203+[200 ';' %bon]
204204```
205205
206206---
@@ -209,42 +209,43 @@ result.
209209
210210Parse unless
211211
212−Parsing composer: if an `++edge` `vex` reflects a success, fail. Otherwise,
213−connect `vex` with the following `++rule`.
212+Parsing composer: if an `edge` `vex` reflects a success, fail. Otherwise,
213+connect `vex` with the following `rule`.
214214
215215#### Accepts
216216
217−`sab` is a `++rule`.
217+`vex` is an `edge`.
218218
219−`vex` is an `++edge`.
219+`sab` is a `rule`.
220220
221221#### Produces
222222
223+An `edge`.
224+
223225#### Source
224226
225227```hoon
226− ++ less :: no first and second
227− |* {vex/edge sab/rule}
228− ?~ q.vex
229− =+ roq=(sab)
230− [p=(last p.vex p.roq) q=q.roq]
231− (fail +<.sab)
232− ::
228+++ less
229+ |* [vex=edge sab=rule]
230+ ?~ q.vex
231+ =+ roq=(sab)
232+ [p=(last p.vex p.roq) q=q.roq]
233+ (fail +<.sab)
233234```
234235
235236#### Examples
236237
237238```
238− > (scan "sas-/lo" (star ;~(less lus bar prn)))
239− "sas-/lo"
239+> (scan "sas-/lo" (star ;~(less lus bar prn)))
240+"sas-/lo"
240241
241− > (scan "sas-/l+o" (star ;~(less lus bar prn)))
242− ! {1 8}
243− ! exit
242+> (scan "sas-/l+o" (star ;~(less lus bar prn)))
243+! {1 8}
244+! exit
244245
245− > (scan "sas|-/lo" (star ;~(less lus bar prn)))
246− ! {1 5}
247− ! exit
246+> (scan "sas|-/lo" (star ;~(less lus bar prn)))
247+! {1 5}
248+! exit
248249```
249250
250251---
@@ -253,31 +254,37 @@ connect `vex` with the following `++rule`.
253254
254255Discard first rule
255256
256−Parsing composer: connects an `++edge` `vex` with two subsequent `++rule`s,
257+Parsing composer: connects an `edge` `vex` with two subsequent `rule`s,
257258ignoring the result of the first and producing the result of the second.
258259
259260#### Accepts
260261
261−`vex` is an edge.
262+`vex` is an `edge`.
263+
264+`sab` is a `rule`.
262265
263266#### Produces
264267
268+An `edge`.
269+
265270#### Source
266271
267272```hoon
268− ++ pfix :: discard first rule
269− ~/ %pfix
270− (comp |*({a/* b/*} b))
273+++ pfix
274+ ~/ %pfix
275+ |* sam=[vex=edge sab=rule]
276+ %. sam
277+ (comp |*([a=* b=*] b))
271278```
272279
273280#### Examples
274281
275282```
276− > `@t`(scan "%him" ;~(pfix cen sym))
277− 'him'
283+> `@t`(scan "%him" ;~(pfix cen sym))
284+'him'
278285
279− > (scan "+++10" ;~(pfix (star lus) dem))
280− q=10
286+> (scan "+++10" ;~(pfix (star lus) dem))
287+10
281288```
282289
283290---
@@ -286,45 +293,40 @@ ignoring the result of the first and producing the result of the second.
286293
287294Parse to tuple
288295
289−Parsing composer: connects an `++edge` `vex` with a following `++rule` `sab`, producing
290−a cell of both the results. See also: the monad applicator ;\~ for a
296+Parsing composer: connects an `edge` `vex` with a following `rule` `sab`,
297+producing a cell of both the results. See also: the monad applicator `;~` for a
291298more detailed explanation.
292299
293300#### Accepts
294301
295−`sab` is a `++rule`.
302+`vex` is an `edge`.
296303
297−`vex` is an `++edge`.
304+`sab` is a `rule`.
298305
299306#### Produces
300307
308+An `edge`.
309+
301310#### Source
302311
303312```hoon
304− ++ plug :: first then second
305− ~/ %plug
306− |* {vex/edge sab/rule}
307− ?~ q.vex
308− vex
309− =+ yit=(sab q.u.q.vex)
310− =+ yur=(last p.vex p.yit)
311− ?~ q.yit
312− [p=yur q=q.yit]
313− [p=yur q=[~ u=[p=[p.u.q.vex p.u.q.yit] q=q.u.q.yit]]]
314− ::
313+++ plug
314+ ~/ %plug
315+ |* [vex=edge sab=rule]
316+ ?~ q.vex
317+ vex
318+ =+ yit=(sab q.u.q.vex)
319+ =+ yur=(last p.vex p.yit)
320+ ?~ q.yit
321+ [p=yur q=q.yit]
322+ [p=yur q=[~ u=[p=[p.u.q.vex p.u.q.yit] q=q.u.q.yit]]]
315323```
316324
317325#### Examples
318326
319327```
320− > (scan "1..20" ;~(plug dem dot dot dem))
321− [q=1 ~~~. ~~~. q=20]
322−
323− > (scan "moke/~2014.1.1" ;~(plug sym fas nuck:so))
324− [1.701.539.693 ~~~2f. [% p=[p=~.da q=170.141.184.500.766.106.671.844.917.172.921.958.400]]]
325−
326− > ;;(,[@tas @t ~ %da @da] (scan "moke/~2014.1.1" ;~(plug sym fas nuck:so)))
327− [%moke '/' ~ %da ~2014.1.1]
328+> (scan "1..20" ;~(plug dem dot dot dem))
329+[1 '.' '.' 20]
328330```
329331
330332---
@@ -334,44 +336,45 @@ more detailed explanation.
334336Parse options
335337
336338Parsing composer: if `vex` reflects a failure, connect it with the
337−following rule `sab`. See also: the monad applicator ;\~
339+following rule `sab`. See also: the monad applicator `;~`
338340
339341#### Accepts
340342
341−`sab` is a `++rule`.
343+`vex` is an `edge`.
342344
343−`vex` is an `++edge`.
345+`sab` is a `rule`.
344346
345347#### Produces
346348
349+An `edge`.
350+
347351#### Source
348352
349353```hoon
350− ++ pose :: first or second
351− ~/ %pose
352− |* {vex/edge sab/rule}
353− ?~ q.vex
354− =+ roq=(sab)
355− [p=(last p.vex p.roq) q=q.roq]
356− vex
357− ::
354+++ pose
355+ ~/ %pose
356+ |* [vex=edge sab=rule]
357+ ?~ q.vex
358+ =+ roq=(sab)
359+ [p=(last p.vex p.roq) q=q.roq]
360+ vex
358361```
359362
360363#### Examples
361364
362365```
363− > `@t`(scan "+" ;~(pose lus tar cen))
364− '+'
366+> `@t`(scan "+" ;~(pose lus tar cen))
367+'+'
365368
366− > `@t`(scan "*" ;~(pose lus tar cen))
367− '*'
369+> `@t`(scan "*" ;~(pose lus tar cen))
370+'*'
368371
369− > `@t`(scan "%" ;~(pose lus tar cen))
370− '%'
372+> `@t`(scan "%" ;~(pose lus tar cen))
373+'%'
371374
372− > `@t`(scan "-" ;~(pose lus tar cen))
373− ! {1 1}
374− ! exit
375+> `@t`(scan "-" ;~(pose lus tar cen))
376+! {1 1}
377+! exit
375378```
376379
377380---
@@ -380,33 +383,37 @@ following rule `sab`. See also: the monad applicator ;\~
380383
381384Discard second rule
382385
383−Parsing composer: connects `++edge`s `vex` with two subsequent `++rule`s returning the
386+Parsing composer: connects `edge` `vex` with two subsequent `rule`s returning the
384387result of the first and discarding the result of the second.
385388
386389#### Accepts
387390
388−`a` is the result of parsing the first `++rule`.
391+`vex` is an `edge`.
389392
390−`b` is the result of of parsing the second `++rule`.
393+`sab` is a `rule`.
391394
392395#### Produces
393396
397+An `edge`.
398+
394399#### Source
395400
396401```hoon
397− ++ sfix :: discard second rule
398− ~/ %sfix
399− (comp |*({a/* b/*} a))
402+++ sfix
403+ ~/ %sfix
404+ |* sam=[vex=edge sab=rule]
405+ %. sam
406+ (comp |*([a=* b=*] a))
400407```
401408
402409#### Examples
403410
404411```
405− > `@t`(scan "him%" ;~(sfix sym cen))
406− 'him'
412+> `@t`(scan "him%" ;~(sfix sym cen))
413+'him'
407414
408− > (scan "10+++" ;~(sfix dem (star lus)))
409− q=10
415+> (scan "10+++" ;~(sfix dem (star lus)))
416+q=10
410417```
411418
412419---
@@ -415,44 +422,45 @@ result of the first and discarding the result of the second.
415422
416423First and second
417424
418−Parsing composer: if an `++edge` `vex` reflects a failure, fail. Otherwise,
419−connect `vex` with the following `++rule`.
425+Parsing composer: if an `edge` `vex` reflects a failure, fail. Otherwise,
426+connect `vex` with the following `rule`.
420427
421428#### Accepts
422429
423−`sab` is a `++rule`.
430+`vex` is an `edge`.
424431
425−`vex` is an `++edge`.
432+`sab` is a `rule`.
426433
427434#### Produces
428435
436+An `edge`.
437+
429438#### Source
430439
431440```hoon
432− ++ simu :: first and second
433− |* {vex/edge sab/rule}
434− ?~ q.vex
435− vex
436− =+ roq=(sab)
437− roq
438− ::
441+++ simu
442+ |* [vex=edge sab=rule]
443+ ?~ q.vex
444+ vex
445+ =+ roq=(sab)
446+ roq
439447```
440448
441449#### Examples
442450
443451```
444− > (scan "~zod" scat:vast)
445− [%dtzy p=%p q=0]
452+> (scan "~zod" scat:vast)
453+[%dtzy p=%p q=0]
446454
447− > (scan "%zod" scat:vast)
448− [%dtzz p=%tas q=6.582.138]
455+> (scan "%zod" scat:vast)
456+[%dtzz p=%tas q=6.582.138]
449457
450− > (scan "%zod" ;~(simu cen scat:vast))
451− [%dtzz p=%tas q=6.582.138]
458+> (scan "%zod" ;~(simu cen scat:vast))
459+[%dtzz p=%tas q=6.582.138]
452460
453− > (scan "~zod" ;~(simu cen scat:vast))
454− ! {1 1}
455− ! exit
461+> (scan "~zod" ;~(simu cen scat:vast))
462+! {1 1}
463+! exit
456464```
457465
458466---
content/docs/hoon/reference/stdlib/4f.md+710−521
@@ -7,41 +7,40 @@ template = "doc.html"
77## `++bass`
88
99Parser modifier: LSB
10−ordered `++list` as atom of a `++base`.
10+ordered `list` as atom of a `base`.
1111
1212#### Accepts
1313
1414`wuc` is an atom.
1515
16−`tyd` is a `++rule`.
16+`tyd` is a `rule`.
1717
1818#### Produces
1919
20−A `++rule`.
20+A `rule`.
2121
2222#### Source
2323
2424```hoon
25− ++ bass
26− |* {wuc/@ tyd/rule}
27− %+ cook
28− |= waq/(list @)
29− %+ roll
30− waq
31− =|({p/@ q/@} |.((add p (mul wuc q))))
32− tyd
33− ::
25+++ bass
26+ |* [wuc=@ tyd=rule]
27+ %+ cook
28+ |= waq=(list @)
29+ %+ roll
30+ waq
31+ =|([p=@ q=@] |.((add p (mul wuc q))))
32+ tyd
3433```
3534
3635#### Examples
3736
3837```
39− > (scan "123" (bass 10 (star dit)))
40− q=123
41− > (scan "123" (bass 8 (star dit)))
42− q=83
43− > `@ub`(scan "123" (bass 8 (star dit)))
44− 0b101.0011
38+> (scan "123" (bass 10 (star dit)))
39+q=123
40+> (scan "123" (bass 8 (star dit)))
41+q=83
42+> `@ub`(scan "123" (bass 8 (star dit)))
43+0b101.0011
4544```
4645
4746---
@@ -50,43 +49,42 @@ A `++rule`.
5049
5150Parser modifier: LSB
5251
53−Ordered `++list` as atom of a `++base`.
52+Ordered `list` as atom of a `base`.
5453
5554#### Accepts
5655
5756`wuc` is an atom.
5857
59−`tyd` is a `++rule`.
58+`tyd` is a `rule`.
6059
6160#### Produces
6261
63−A `++rule`.
62+A `rule`.
6463
6564#### Source
6665
6766```hoon
68− ++ boss
69− |* {wuc/@ tyd/rule}
70− %+ cook
71− |= waq/(list @)
72− %+ reel
73− waq
74− =|({p/@ q/@} |.((add p (mul wuc q))))
75− tyd
76− ::
67+++ boss
68+ |* [wuc=@ tyd=rule]
69+ %+ cook
70+ |= waq=(list @)
71+ %+ reel
72+ waq
73+ =|([p=@ q=@] |.((add p (mul wuc q))))
74+ tyd
7775```
7876
7977#### Examples
8078
8179```
82− > (scan "123" (boss 10 (star dit)))
83− q=321
80+> (scan "123" (boss 10 (star dit)))
81+321
8482
85− > `@t`(scan "bam" (boss 256 (star alp)))
86− 'bam'
83+> `@t`(scan "bam" (boss 256 (star alp)))
84+'bam'
8785
88− > `@ux`(scan "bam" (boss 256 (star alp)))
89− 0x6d.6162
86+> `@ux`(scan "bam" (boss 256 (star alp)))
87+0x6d.6162
9088```
9189
9290---
@@ -95,41 +93,41 @@ A `++rule`.
9593
9694Replace with constant
9795
98−Parser modifier. Accepts a `++rule` `sef` and produces a parser that
99−produces a constant `cus`, assuming `sef` is successful.
96+Parser modifier. Accepts a `rule` `sef` and produces a parser that produces a
97+constant `cus`, assuming `sef` is successful.
10098
10199#### Accepts
102100
103101`cus` is a constant noun.
104102
105−`sef` is a `++rule`.
103+`sef` is a `rule`.
106104
107105#### Produces
108106
109−An `++edge`.
107+An `edge`.
110108
111109#### Source
112110
113111```hoon
114− ++ cold :: replace w+ constant
115− ~/ %cold
116− |* {cus/* sef/rule}
117− ~/ %fun
118− |= tub/nail
119− =+ vex=(sef tub)
120− ?~ q.vex
121− vex
122− [p=p.vex q=[~ u=[p=cus q=q.u.q.vex]]]
112+++ cold
113+ ~/ %cold
114+ |* [cus=* sef=rule]
115+ ~/ %fun
116+ |= tub=nail
117+ =+ vex=(sef tub)
118+ ?~ q.vex
119+ vex
120+ [p=p.vex q=[~ u=[p=cus q=q.u.q.vex]]]
123121```
124122
125123#### Examples
126124
127125```
128− > ((cold %foo (just 'a')) [[1 1] "abc"])
129− [p=[p=1 q=2] q=[~ u=[p=%foo q=[p=[p=1 q=2] q="bc"]]]]
126+> ((cold %foo (just 'a')) [[1 1] "abc"])
127+[p=[p=1 q=2] q=[~ u=[p=%foo q=[p=[p=1 q=2] q="bc"]]]]
130128
131− > ((cold %foo (just 'a')) [[1 1] "bc"])
132− [p=[p=1 q=1] q=~]
129+> ((cold %foo (just 'a')) [[1 1] "bc"])
130+[p=[p=1 q=1] q=~]
133131```
134132
135133---
@@ -139,47 +137,46 @@ An `++edge`.
139137Apply gate
140138
141139Parser modifier. Produces a parser that takes a (successful) result of a
142−`++rule` `sef` and slams it through `poq`.
140+`rule` `sef` and slams it through `poq`.
143141
144142#### Accepts
145143
146144`poq` is a gate.
147145
148−`sef` is a `++rule`.
146+`sef` is a `rule`.
149147
150148#### Produces
151149
152−An `++rule`.
150+An `rule`.
153151
154152#### Source
155153
156154```hoon
157− ++ cook :: apply gate
158− ~/ %cook
159− |* {poq/gate sef/rule}
160− ~/ %fun
161− |= tub/nail
162− =+ vex=(sef tub)
163− ?~ q.vex
164− vex
165− [p=p.vex q=[~ u=[p=(poq p.u.q.vex) q=q.u.q.vex]]]
166− ::
155+++ cook
156+ ~/ %cook
157+ |* [poq=gate sef=rule]
158+ ~/ %fun
159+ |= tub=nail
160+ =+ vex=(sef tub)
161+ ?~ q.vex
162+ vex
163+ [p=p.vex q=[~ u=[p=(poq p.u.q.vex) q=q.u.q.vex]]]
167164```
168165
169166#### Examples
170167
171168```
172− > ((cook ,@ud (just 'a')) [[1 1] "abc"])
173− [p=[p=1 q=2] q=[~ u=[p=97 q=[p=[p=1 q=2] q="bc"]]]]
169+> ((cook ,@ud (just 'a')) [[1 1] "abc"])
170+[p=[p=1 q=2] q=[~ u=[p=97 q=[p=[p=1 q=2] q="bc"]]]]
174171
175− > ((cook ,@tas (just 'a')) [[1 1] "abc"])
176− [p=[p=1 q=2] q=[~ u=[p=%a q=[p=[p=1 q=2] q="bc"]]]]
172+> ((cook ,@tas (just 'a')) [[1 1] "abc"])
173+[p=[p=1 q=2] q=[~ u=[p=%a q=[p=[p=1 q=2] q="bc"]]]]
177174
178− > ((cook |=(a=@ +(a)) (just 'a')) [[1 1] "abc"])
179− [p=[p=1 q=2] q=[~ u=[p=98 q=[p=[p=1 q=2] q="bc"]]]]
175+> ((cook |=(a=@ +(a)) (just 'a')) [[1 1] "abc"])
176+[p=[p=1 q=2] q=[~ u=[p=98 q=[p=[p=1 q=2] q="bc"]]]]
180177
181− > ((cook |=(a=@ `@t`+(a)) (just 'a')) [[1 1] "abc"])
182− [p=[p=1 q=2] q=[~ u=[p='b' q=[p=[p=1 q=2] q="bc"]]]]
178+> ((cook |=(a=@ `@t`+(a)) (just 'a')) [[1 1] "abc"])
179+[p=[p=1 q=2] q=[~ u=[p='b' q=[p=[p=1 q=2] q="bc"]]]]
183180```
184181
185182---
@@ -197,32 +194,71 @@ without consuming any text.
197194
198195#### Produces
199196
200−A `++rule`.
197+A `rule`.
201198
202199#### Source
203200
204201```hoon
205− ++ easy :: always parse
206− ~/ %easy
207− |* huf=*
208− ~/ %fun
209− |= tub=nail
210− ^- (like ,_huf)
211− [p=p.tub q=[~ u=[p=huf q=tub]]]
212− ::
202+++ easy
203+ ~/ %easy
204+ |* huf=*
205+ ~/ %fun
206+ |= tub=nail
207+ ^- (like _huf)
208+ [p=p.tub q=[~ u=[p=huf q=tub]]]
213209```
214210
215211#### Examples
216212
217213```
218− > ((easy %foo) [[1 1] "abc"])
219− [p=[p=1 q=1] q=[~ [p=%foo q=[p=[p=1 q=1] q="abc"]]]]
214+> ((easy %foo) [[1 1] "abc"])
215+[p=[p=1 q=1] q=[~ [p=%foo q=[p=[p=1 q=1] q="abc"]]]]
220216
221− > ((easy %foo) [[1 1] "bc"])
222− [p=[p=1 q=1] q=[~ [p=%foo q=[p=[p=1 q=1] q="bc"]]]]
217+> ((easy %foo) [[1 1] "bc"])
218+[p=[p=1 q=1] q=[~ [p=%foo q=[p=[p=1 q=1] q="bc"]]]]
223219
224− > ((easy 'a') [[1 1] "bc"])
225− [p=[p=1 q=1] q=[~ [p='a' q=[p=[p=1 q=1] q="bc"]]]]
220+> ((easy 'a') [[1 1] "bc"])
221+[p=[p=1 q=1] q=[~ [p='a' q=[p=[p=1 q=1] q="bc"]]]]
222+```
223+
224+---
225+
226+## `++fuss`
227+
228+Has A or B?
229+
230+If string `sic` is parsed: `%.y`. If string `non` is parsed: `%.n`. Otherwise, fail.
231+
232+#### Accepts
233+
234+`sic` is a `@t`.
235+
236+`non` is a `@t`.
237+
238+#### Produces
239+
240+A `rule`.
241+
242+#### Source
243+
244+```hoon
245+++ fuss
246+ |= [sic=@t non=@t]
247+ ;~(pose (cold %& (jest sic)) (cold %| (jest non)))
248+```
249+
250+#### Examples
251+
252+```
253+> (rash 'foo' (fuss 'foo' 'bar'))
254+%.y
255+
256+> (rash 'bar' (fuss 'foo' 'bar'))
257+%.n
258+
259+> (rash 'baz' (fuss 'foo' 'bar'))
260+{1 3}
261+syntax error
226262```
227263
228264---
@@ -231,39 +267,38 @@ A `++rule`.
231267
232268Parse to end
233269
234−Parser modifier. Accepts a `++rule` `sef`, and produces a parser that succeeds only
235−when the of `tub` is fully consumed using `sef`.
270+Parser modifier. Accepts a `rule` `sef`, and produces a parser that succeeds
271+only when the `tape` of `tub` is fully consumed using `sef`.
236272
237273#### Accepts
238274
239−`sef` is a `++rule`.
275+`sef` is a `rule`.
240276
241277#### Produces
242278
243−A `++rule`.
279+A `rule`.
244280
245281#### Source
246282
247283```hoon
248− ++ full :: parse to end
249− |* sef=_rule
250− |= tub=nail
251− =+ vex=(sef tub)
252− ?~(q.vex vex ?:(=(~ q.q.u.q.vex) vex [p=p.vex q=~]))
253− ::
284+++ full
285+ |* sef=rule
286+ |= tub=nail
287+ =+ vex=(sef tub)
288+ ?~(q.vex vex ?:(=(~ q.q.u.q.vex) vex [p=p.vex q=~]))
254289```
255290
256291#### Examples
257292
258293```
259− > ((full (just 'a')) [[1 1] "ab"])
260− [p=[p=1 q=2] q=~]
294+> ((full (just 'a')) [[1 1] "ab"])
295+[p=[p=1 q=2] q=~]
261296
262− > ((full (jest 'ab')) [[1 1] "ab"])
263− [p=[p=1 q=3] q=[~ u=[p='ab' q=[p=[p=1 q=3] q=""]]]]
297+> ((full (jest 'ab')) [[1 1] "ab"])
298+[p=[p=1 q=3] q=[~ u=[p='ab' q=[p=[p=1 q=3] q=""]]]]
264299
265− > ((full ;~(plug (just 'a') (just 'b'))) [[1 1] "ab"])
266− [p=[p=1 q=3] q=[~ u=[p=[~~a ~~b] q=[p=[p=1 q=3] q=""]]]]
300+> ((full ;~(plug (just 'a') (just 'b'))) [[1 1] "ab"])
301+[p=[p=1 q=3] q=[~ u=[p=['a' 'b'] q=[p=[p=1 q=3] q=""]]]]
267302```
268303
269304---
@@ -272,35 +307,35 @@ A `++rule`.
272307
273308Add to tape
274309
275−Parser modifier: prepend text to `++tape` before applying parser.
310+Parser modifier: prepend text to `tape` before applying parser.
276311
277312#### Accepts
278313
279−`pre` is a `++tape`
314+`pre` is a `tape`
280315
281−`sef` is a `++rule`
316+`sef` is a `rule`
282317
283318#### Produces
284319
285−A `++rule`.
320+A `rule`.
286321
287322#### Source
288323
289324```hoon
290− ++ funk :: add to tape first
291− |* {pre/tape sef/rule}
292− |= tub/nail
293− (sef p.tub (weld pre q.tub))
325+++ funk
326+ |* [pre=tape sef=rule]
327+ |= tub=nail
328+ (sef p.tub (weld pre q.tub))
294329```
295330
296331#### Examples
297332
298333```
299− > ((funk "abc prefix-" (jest 'abc')) [[1 1] "to be parsed"])
300− [p=[p=1 q=4] q=[~ [p='abc' q=[p=[p=1 q=4] q=" prefix-to be parsed"]]]]
334+> ((funk "abc prefix-" (jest 'abc')) [[1 1] "to be parsed"])
335+[p=[p=1 q=4] q=[~ [p='abc' q=[p=[p=1 q=4] q=" prefix-to be parsed"]]]]
301336
302− > ((funk "parse" (just 'a')) [[1 4] " me"])
303− [p=[p=1 q=4] q=~]
337+> ((funk "parse" (just 'a')) [[1 4] " me"])
338+[p=[p=1 q=4] q=~]
304339```
305340
306341---
@@ -311,85 +346,139 @@ Place-based apply
311346
312347Parser modifier. Similar to `++cook` in that it produces a parser that takes a
313348(successful) result of `sef` and slams it through `hez`. `hez` accepts a
314−`++pint` `a` and a noun `b`, which is what the parser parsed.
349+`pint` `a` and a noun `b`, which is what the parser parsed.
315350
316351#### Accepts
317352
318353`hez` is a gate.
319354
320−`sef` is a `++rule`
355+`sef` is a `rule`
321356
322357#### Produces
323358
324−A `++rule`.
359+A `rule`.
325360
326361#### Source
327362
328363```hoon
329− ++ here :: place-based apply
330− ~/ %here
331− |* {hez/_|=({a/pint b/*} [a b]) sef/rule}
332− ~/ %fun
333− |= tub/nail
334− =+ vex=(sef tub)
335− ?~ q.vex
336− vex
337− [p=p.vex q=[~ u=[p=(hez [p.tub p.q.u.q.vex] p.u.q.vex) q=q.u.q.vex]]]
338− ::
364+++ here
365+ ~/ %here
366+ =+ [hez=|=([a=pint b=*] [a b]) sef=*rule]
367+ |@
368+ ++ $
369+ ~/ %fun
370+ |= tub=nail
371+ =+ vex=(sef tub)
372+ ?~ q.vex
373+ vex
374+ [p=p.vex q=[~ u=[p=(hez [p.tub p.q.u.q.vex] p.u.q.vex) q=q.u.q.vex]]]
375+ --
339376```
340377
341378#### Examples
342379
343380```
344− > (scan "abc" (star alf))
345− "abc"
381+> (scan "abc" (star alf))
382+"abc"
383+
384+> (scan "abc" (here |*(^ +<) (star alf)))
385+[[[p=1 q=1] p=1 q=4] "abc"]
386+
387+> (scan "abc" (star (here |*(^ +<) alf)))
388+~[[[[p=1 q=1] p=1 q=2] ~~a] [[[p=1 q=2] p=1 q=3] ~~b] [[[p=1 q=3] p=1 q=4] ~~c]]
389+```
390+
391+## `++inde`
392+
393+Indentation block
394+
395+Apply `rule` to indented block starting at current column number, omitting the
396+leading whitespace.
397+
398+#### Accepts
399+
400+`sef` is a `rule`.
401+
402+#### Produces
403+
404+A `rule`.
405+
406+#### Source
407+
408+```hoon
409+++ inde |* sef=rule
410+ |= nail ^+ (sef)
411+ =+ [har tap]=[p q]:+<
412+ =+ lev=(fil 3 (dec q.har) ' ')
413+ =+ eol=(just `@t`10)
414+ =+ =- roq=((star ;~(pose prn ;~(sfix eol (jest lev)) -)) har tap)
415+ ;~(simu ;~(plug eol eol) eol)
416+ ?~ q.roq roq
417+ =+ vex=(sef har(q 1) p.u.q.roq)
418+ =+ fur=p.vex(q (add (dec q.har) q.p.vex))
419+ ?~ q.vex vex(p fur)
420+ =- vex(p fur, u.q -)
421+ :+ &3.vex
422+ &4.vex(q.p (add (dec q.har) q.p.&4.vex))
423+ =+ res=|4.vex
424+ |- ?~ res |4.roq
425+ ?. =(10 -.res) [-.res $(res +.res)]
426+ (welp [`@t`10 (trip lev)] $(res +.res))
427+```
346428
347− > (scan "abc" (here |*(^ +<) (star alf)))
348− [[[p=1 q=1] p=1 q=4] "abc"]
429+#### Examples
349430
350− > (scan "abc" (star (here |*(^ +<) alf)))
351− ~[[[[p=1 q=1] p=1 q=2] ~~a] [[[p=1 q=2] p=1 q=3] ~~b] [[[p=1 q=3] p=1 q=4] ~~c]]
431+```
432+> `tape`(scan " foo\0a bar" ;~(pfix ace ace ace (inde (star ;~(pose prn (just '\0a'))))))
433+"foo\0abar"
352434```
353435
436+#### Discussion
437+
438+Note the amount of indentation whitespace to be stripped from the beginning of
439+each line is determined by the value of `q` (the column) in the `hair` when
440+`++inde` is first called. This means something like the `pfix` expression in the
441+example above is necessary to set the level of indentation. Additionally, the
442+`rule` given to `++inde` must consume the whole line including the line ending.
443+
354444---
355445
356446## `++ifix`
357447
358448Infix
359449
360−Parser modifier: surround with pair of `++rule`s, the output of which is
450+Parser modifier: surround with pair of `rule`s, the output of which is
361451discarded.
362452
363453#### Accepts
364454
365−`fel` is a pair of `++rule`s.
455+`fel` is a pair of `rule`s.
366456
367−`hof` is a `++rule`.
457+`hof` is a `rule`.
368458
369459#### Produces
370460
371−A `++rule`.
461+A `rule`.
372462
373463#### Source
374464
375465```hoon
376− ++ ifix
377− |* {fel/{rule rule} hof/rule}
378− ~! +<
379− ~! +<:-.fel
380− ~! +<:+.fel
381− ;~(pfix -.fel ;~(sfix hof +.fel))
382− ::
466+++ ifix
467+ |* [fel=[rule rule] hof=rule]
468+ ~! +<
469+ ~! +<:-.fel
470+ ~! +<:+.fel
471+ ;~(pfix -.fel ;~(sfix hof +.fel))
383472```
384473
385474#### Examples
386475
387476```
388− > (scan "-40-" (ifix [hep hep] dem))
389− q=40
477+> (scan "-40-" (ifix [hep hep] dem))
478+40
390479
391− > (scan "4my4" (ifix [dit dit] (star alf)))
392− "my"
480+> (scan "4my4" (ifix [dit dit] (star alf)))
481+"my"
393482```
394483
395484---
@@ -406,43 +495,42 @@ Match and consume a cord.
406495
407496#### Produces
408497
409−An `++edge`.
498+A `rule`.
410499
411500#### Source
412501
413502```hoon
414− ++ jest :: match a cord
415− |= daf/@t
416− |= tub/nail
417− =+ fad=daf
418− |- ^- (like @t)
419− ?: =(`@`0 daf)
420− [p=p.tub q=[~ u=[p=fad q=tub]]]
421− ?: |(?=($~ q.tub) !=((end 3 1 daf) i.q.tub))
422− (fail tub)
423− $(p.tub (lust i.q.tub p.tub), q.tub t.q.tub, daf (rsh 3 1 daf))
424− ::
503+++ jest
504+ |= daf=@t
505+ |= tub=nail
506+ =+ fad=daf
507+ |- ^- (like @t)
508+ ?: =(`@`0 daf)
509+ [p=p.tub q=[~ u=[p=fad q=tub]]]
510+ ?: |(?=(~ q.tub) !=((end 3 daf) i.q.tub))
511+ (fail tub)
512+ $(p.tub (lust i.q.tub p.tub), q.tub t.q.tub, daf (rsh 3 daf))
425513```
426514
427515#### Examples
428516
429517```
430− > ((jest 'abc') [[1 1] "abc"])
431− [p=[p=1 q=4] q=[~ [p='abc' q=[p=[p=1 q=4] q=""]]]]
518+> ((jest 'abc') [[1 1] "abc"])
519+[p=[p=1 q=4] q=[~ [p='abc' q=[p=[p=1 q=4] q=""]]]]
432520
433− > (scan "abc" (jest 'abc'))
434− 'abc'
521+> (scan "abc" (jest 'abc'))
522+'abc'
435523
436− > (scan "abc" (jest 'acb'))
437− ! {1 2}
438− ! 'syntax-error'
439− ! exit
524+> (scan "abc" (jest 'acb'))
525+! {1 2}
526+! 'syntax-error'
527+! exit
440528
441− > ((jest 'john doe') [[1 1] "john smith"])
442− [p=[p=1 q=6] q=~]
529+> ((jest 'john doe') [[1 1] "john smith"])
530+[p=[p=1 q=6] q=~]
443531
444− > ((jest 'john doe') [[1 1] "john doe"])
445− [p=[p=1 q=9] q=[~ [p='john doe' q=[p=[p=1 q=9] q=""]]]]
532+> ((jest 'john doe') [[1 1] "john doe"])
533+[p=[p=1 q=9] q=[~ [p='john doe' q=[p=[p=1 q=9] q=""]]]]
446534```
447535
448536---
@@ -455,45 +543,44 @@ Match and consume a single character.
455543
456544#### Accepts
457545
458−`daf` is a `++char`
546+`daf` is a `char`
459547
460548#### Produces
461549
462−A `++rule`.
550+A `rule`.
463551
464552#### Source
465553
466554```hoon
467− ++ just :: XX redundant, jest
468− ~/ %just :: match a char
469− |= daf/char
470− ~/ %fun
471− |= tub/nail
472− ^- (like char)
473− ?~ q.tub
474− (fail tub)
475− ?. =(daf i.q.tub)
476− (fail tub)
477− (next tub)
478− ::
555+++ just
556+ ~/ %just
557+ |= daf=char
558+ ~/ %fun
559+ |= tub=nail
560+ ^- (like char)
561+ ?~ q.tub
562+ (fail tub)
563+ ?. =(daf i.q.tub)
564+ (fail tub)
565+ (next tub)
479566```
480567
481568#### Examples
482569
483570```
484− > ((just 'a') [[1 1] "abc"])
485− [p=[p=1 q=2] q=[~ [p=~~a q=[p=[p=1 q=2] q="bc"]]]]
571+> ((just 'a') [[1 1] "abc"])
572+[p=[p=1 q=2] q=[~ [p='a' q=[p=[p=1 q=2] q="bc"]]]]
486573
487− > (scan "abc" (just 'a'))
488− ! {1 2}
489− ! 'syntax-error'
490− ! exit
574+> (scan "abc" (just 'a'))
575+! {1 2}
576+! 'syntax-error'
577+! exit
491578
492− > (scan "a" (just 'a'))
579+> (scan "a" (just 'a'))
580+'a'
493581
494− ~~a
495− > (scan "%" (just '%'))
496− ~~~25.
582+> (scan "%" (just '%'))
583+'%'
497584```
498585
499586---
@@ -509,47 +596,49 @@ compiled.
509596
510597`gar` is a noun.
511598
512−`sef` is a gate that accepts a `++rule`
599+`sef` is a gate that accepts a `rule`
513600
514601#### Produces
515602
516−A `++rule`.
603+A `rule`.
517604
518605#### Source
519606
520607```hoon
521− ++ knee :: callbacks
522− |* {gar/* sef/_|.(*rule)}
523− |= tub/nail
524− ^- (like _gar)
525− ((sef) tub)
526− ::
608+++ knee
609+ =| [gar=* sef=_|.(*rule)]
610+ |@ ++ $
611+ |= tub=nail
612+ ^- (like _gar)
613+ ((sef) tub)
614+ --
527615```
528616
529617#### Examples
530618
531619```
532− > |-(;~(plug prn ;~(pose $ (easy ~))))
533− ! rest-loop
534− ! exit
535−
536− > |-(;~(plug prn ;~(pose (knee *tape |.(^$)) (easy ~))))
537− < 1.obo
538− [ c=c=tub=[p=[p=@ud q=@ud] q=""]
539− b
540− < 1.bes
541− [ c=tub=[p=[p=@ud q=@ud] q=""]
542− b=<1.tnv [tub=[p=[p=@ud q=@ud] q=""] <1.ktu [daf=@tD <414.fvk 101.jzo 1.ypj %164>]>]>
543− a=<1.fvg [tub=[p=[p=@ud q=@ud] q=""] <1.khu [[les=@ mos=@] <414.fvk 101.jzo 1.ypj %164>]>]>
544− v=<414.fvk 101.jzo 1.ypj %164>
545− ]
546− >
547− a
548− ... 450 lines omitted ...
620+> |-(;~(plug prn ;~(pose $ (easy ~))))
621+! rest-loop
622+! exit
623+
624+> |-(;~(plug prn ;~(pose (knee *tape |.(^$)) (easy ~))))
625+< 1.obo
626+ [ c=c=tub=[p=[p=@ud q=@ud] q=""]
627+ b
628+ < 1.bes
629+ [ c=tub=[p=[p=@ud q=@ud] q=""]
630+ b=<1.tnv [tub=[p=[p=@ud q=@ud] q=""] <1.ktu [daf=@tD <414.fvk 101.jzo 1.ypj %164>]>]>
631+ a=<1.fvg [tub=[p=[p=@ud q=@ud] q=""] <1.khu [[les=@ mos=@] <414.fvk 101.jzo 1.ypj %164>]>]>
632+ v=<414.fvk 101.jzo 1.ypj %164>
549633 ]
550634 >
551− > (scan "abcd" |-(;~(plug prn ;~(pose (knee *tape |.(^$)) (easy ~)))))
552− [~~a "bcd"]
635+ a
636+ ... 450 lines omitted ...
637+ ]
638+>
639+
640+> (scan "abcd" |-(;~(plug prn ;~(pose (knee *tape |.(^$)) (easy ~)))))
641+['a' "bcd"]
553642```
554643
555644---
@@ -558,48 +647,46 @@ A `++rule`.
558647
559648Match char
560649
561−Parser generator. Matches the next character if it is in a list of
562−characters.
650+Parser generator. Matches the next character if it is in a list of characters.
563651
564652#### Accepts
565653
566−`bud` is a list of `++char`
654+`bud` is a list of `char`
567655
568656#### Produces
569657
570−A `++rule`.
658+A `rule`.
571659
572660#### Source
573661
574662```hoon
575− ++ mask :: match char in set
576− ~/ %mask
577− |= bud/(list char)
578− ~/ %fun
579− |= tub/nail
580− ^- (like char)
581− ?~ q.tub
582− (fail tub)
583− ?. (lien bud |=(a/char =(i.q.tub a)))
584− (fail tub)
585− (next tub)
586− ::
663+++ mask
664+ ~/ %mask
665+ |= bud=(list char)
666+ ~/ %fun
667+ |= tub=nail
668+ ^- (like char)
669+ ?~ q.tub
670+ (fail tub)
671+ ?. (lien bud |=(a=char =(i.q.tub a)))
672+ (fail tub)
673+ (next tub)
587674```
588675
589676#### Examples
590677
591678```
592− > (scan "a" (mask "cba"))
593− ~~a
679+> (scan "a" (mask "cba"))
680+'a'
594681
595− > ((mask "abc") [[1 1] "abc"])
596− [p=[p=1 q=2] q=[~ [p=~~a q=[p=[p=1 q=2] q="bc"]]]]
682+> ((mask "abc") [[1 1] "abc"])
683+[p=[p=1 q=2] q=[~ [p='a' q=[p=[p=1 q=2] q="bc"]]]]
597684
598− > ((mask "abc") [[1 1] "bbc"])
599− [p=[p=1 q=2] q=[~ [p=~~b q=[p=[p=1 q=2] q="bc"]]]]
685+> ((mask "abc") [[1 1] "bbc"])
686+[p=[p=1 q=2] q=[~ [p='b' q=[p=[p=1 q=2] q="bc"]]]]
600687
601− > ((mask "abc") [[1 1] "dbc"])
602− [p=[p=1 q=1] q=~]
688+> ((mask "abc") [[1 1] "dbc"])
689+[p=[p=1 q=1] q=~]
603690```
604691
605692---
@@ -608,38 +695,37 @@ A `++rule`.
608695
609696Parse list with delimiter
610697
611−Parser modifier: Parse a list of matches using a delimiter `++rule`.
698+Parser modifier: Parse a list of matches using a delimiter `rule`.
612699
613700#### Accepts
614701
615−`bus` is a `++rule`.
702+`bus` is a `rule`.
616703
617−`fel` is a `++rule`.
704+`fel` is a `rule`.
618705
619706#### Produces
620707
621−A `++rule`.
708+A `rule`.
622709
623710#### Source
624711
625712```hoon
626− ++ more
627− |* {bus/rule fel/rule}
628− ;~(pose (most bus fel) (easy ~))
629− ::
713+++ more
714+ |* [bus=rule fel=rule]
715+ ;~(pose (most bus fel) (easy ~))
630716```
631717
632718#### Examples
633719
634720```
635− > (scan "" (more ace dem))
636− ~
721+> (scan "" (more ace dem))
722+~
637723
638− > (scan "40 20" (more ace dem))
639− [q=40 ~[q=20]]
724+> (scan "40 20" (more ace dem))
725+[40 [i=20 t=~]]
640726
641− > (scan "40 20 60 1 5" (more ace dem))
642− [q=40 ~[q=20 q=60 q=1 q=5]]
727+> (scan "40 20 60 1 5" (more ace dem))
728+[40 [i=20 t=~[60 1 5]]]
643729```
644730
645731---
@@ -648,39 +734,38 @@ A `++rule`.
648734
649735Parse list of at least one match
650736
651−Parser modifier: parse a `++list` of at least one match using a delimiter `++rule`.
737+Parser modifier: parse a `list` of at least one match using a delimiter `rule`.
652738
653739#### Accepts
654740
655−`bus` is a `++rule`.
741+`bus` is a `rule`.
656742
657−`fel` is a `++rule`.
743+`fel` is a `rule`.
658744
659745#### Produces
660746
661−A `++rule`.
747+A `rule`.
662748
663749#### Source
664750
665751```hoon
666− ++ most
667− |* {bus/rule fel/rule}
668− ;~(plug fel (star ;~(pfix bus fel)))
669− ::
752+++ most
753+ |* [bus=rule fel=rule]
754+ ;~(plug fel (star ;~(pfix bus fel)))
670755```
671756
672757#### Examples
673758
674759```
675− > (scan "40 20" (most ace dem))
676− [q=40 ~[q=20]]
760+> (scan "40 20" (most ace dem))
761+[40 [i=20 t=~]]
677762
678− > (scan "40 20 60 1 5" (most ace dem))
679− [q=40 ~[q=20 q=60 q=1 q=5]]
763+> (scan "40 20 60 1 5" (most ace dem))
764+[40 [i=20 t=~[60 1 5]]]
680765
681− > (scan "" (most ace dem))
682− ! {1 1}
683− ! exit
766+> (scan "" (most ace dem))
767+! {1 1}
768+! exit
684769```
685770
686771---
@@ -693,33 +778,76 @@ Consume any character, producing it as a result.
693778
694779#### Accepts
695780
696−`tub` is a `++nail`
781+`tub` is a `nail`
697782
698783#### Produces
699784
700−An `++edge`.
785+An `edge`.
701786
702787#### Source
703788
704789```hoon
705− ++ next :: consume a char
706− |= tub/nail
707− ^- (like char)
708− ?~ q.tub
709− (fail tub)
710− =+ zac=(lust i.q.tub p.tub)
711− [zac [~ i.q.tub [zac t.q.tub]]]
712− ::
790+++ next
791+ |= tub=nail
792+ ^- (like char)
793+ ?~ q.tub
794+ (fail tub)
795+ =+ zac=(lust i.q.tub p.tub)
796+ [zac [~ i.q.tub [zac t.q.tub]]]
713797```
714798
715799#### Examples
716800
717801```
718− > (next [[1 1] "ebc"])
719− [p=[p=1 q=2] q=[~ [p=~~e q=[p=[p=1 q=2] q="bc"]]]]
802+> (next [[1 1] "ebc"])
803+[p=[p=1 q=2] q=[~ [p='e' q=[p=[p=1 q=2] q="bc"]]]]
720804
721− > (next [[1 1] "john jumps jones"])
722− [p=[p=1 q=2] q=[~ [p=~~j q=[p=[p=1 q=2] q="ohn jumps jones"]]]]
805+> (next [[1 1] "john jumps jones"])
806+[p=[p=1 q=2] q=[~ [p='j' q=[p=[p=1 q=2] q="ohn jumps jones"]]]]
807+```
808+
809+---
810+
811+## `++perk`
812+
813+Parse cube fork
814+
815+Given `a`, a list of `@tas`, match any one in the list and produce it. Note the
816+list should not be a `list` type, but just a null-terminated cell like `~[%foo %bar %baz]`. The type produced will be a union of the items in the given list,
817+so you can use a `?-` expression on the output.
818+
819+#### Accepts
820+
821+`a` is a `(pole @tas)`.
822+
823+#### Produces
824+
825+A `rule`.
826+
827+#### Source
828+
829+```hoon
830+++ perk
831+ |* a=(pole @tas)
832+ ?~ a fail
833+ ;~ pose
834+ (cold -.a (jest -.a))
835+ $(a +.a)
836+ ==
837+```
838+
839+#### Examples
840+
841+```
842+> (scan "foo" (perk ~[%foo %bar]))
843+%foo
844+
845+> (scan "bar" (perk ~[%foo %bar]))
846+%bar
847+
848+> (scan "baz" (perk ~[%foo %bar]))
849+{1 3}
850+syntax error
723851```
724852
725853---
@@ -728,79 +856,112 @@ An `++edge`.
728856
729857List of at least one match.
730858
731−Parser modifier: parse `++list` of at least one match.
859+Parser modifier: parse `list` of at least one match.
732860
733861#### Accepts
734862
735−`fel` is a `++rule`.
863+`fel` is a `rule`.
736864
737865#### Produces
738866
739−A `++rule`.
867+A `rule`.
740868
741869#### Source
742870
743871```hoon
744− ++ plus |*(fel/rule ;~(plug fel (star fel)))
872+++ plus |*(fel=rule ;~(plug fel (star fel))) ::
745873```
746874
747875#### Examples
748876
749877```
750− > (scan ">>>>" (cook lent (plus gar)))
751− 4
878+> (scan ">>>>" (cook lent (plus gar)))
879+4
752880
753− > (scan "- - " (plus ;~(pose ace hep)))
754− [~~- " - "]
881+> (scan "- - " (plus ;~(pose ace hep)))
882+['-' [i=' ' t=~[' ' '-' ' ']]]
755883
756− > `tape`(scan "- - " (plus ;~(pose ace hep)))
757− "- - "
884+> `tape`(scan "- - " (plus ;~(pose ace hep)))
885+"- - "
758886
759− > `(pole ,@t)`(scan "- - " (plus ;~(pose ace hep)))
760− ['-' [' ' [' ' ['-' [' ' ~]]]]]
887+> `(pole ,@t)`(scan "- - " (plus ;~(pose ace hep)))
888+['-' [' ' [' ' ['-' [' ' ~]]]]]
889+```
890+
891+---
892+
893+## `++punt`
894+
895+Unitized parse
896+
897+Either successfully apply `rule` `a` and produce a `unit` of the result, or produce `~`.
898+
899+#### Accepts
900+
901+`a` is a `rule`.
902+
903+#### Produces
904+
905+A `rule`.
906+
907+#### Source
908+
909+```hoon
910+++ punt |*([a=rule] ;~(pose (stag ~ a) (easy ~)))
911+```
912+
913+#### Example
914+
915+```
916+> ((punt (jest 'foo')) 1^1 "foo")
917+[p=[p=1 q=4] q=[~ u=[p=[~ 'foo'] q=[p=[p=1 q=4] q=~]]]]
918+
919+> ((punt (jest 'foo')) 1^1 "bar")
920+[p=[p=1 q=1] q=[~ [p=~ q=[p=[p=1 q=1] q="bar"]]]]
761921```
762922
763923---
764924
765925## `++sear`
766926
767−Conditional `++cook`
927+Conditional `cook`
768928
769−Conditional `++cook`. Slams the result through a gate that produces
929+Conditional `cook`. Slams the result through a gate that produces
770930a unit; if that unit is empty, fail.
771931
772932#### Accepts
773933
774−`tub` is a `++nail`.
934+`pyq` is a gate that produces a `unit`.
935+
936+`sef` is a `rule`.
775937
776938#### Produces
777939
778−A `++rule`.
940+A `rule`.
779941
780942#### Source
781943
782944```hoon
783− ++ sear :: conditional cook
784− |* {pyq/$-(* (unit)) sef/rule}
785− |= tub/nail
786− =+ vex=(sef tub)
787− ?~ q.vex
788− vex
789− =+ gey=(pyq p.u.q.vex)
790− ?~ gey
791− [p=p.vex q=~]
792− [p=p.vex q=[~ u=[p=u.gey q=q.u.q.vex]]]
793− ::
945+++ sear
946+ |* [pyq=$-(* (unit)) sef=rule]
947+ |= tub=nail
948+ =+ vex=(sef tub)
949+ ?~ q.vex
950+ vex
951+ =+ gey=(pyq p.u.q.vex)
952+ ?~ gey
953+ [p=p.vex q=~]
954+ [p=p.vex q=[~ u=[p=u.gey q=q.u.q.vex]]]
794955```
795956
796957#### Examples
797958
798959```
799− > ((sear |=(a/* ?@(a (some a) ~)) (just `a`)) [[1 1] "abc"])
800− [p=[p=1 q=2] q=[~ u=[p=97 q=[p=[p=1 q=2] q="bc"]]]]
960+> ((sear |=(a=* ?@(a (some a) ~)) (just 'a')) [[1 1] "abc"])
961+[p=[p=1 q=2] q=[~ u=[p=97 q=[p=[p=1 q=2] q="bc"]]]]
801962
802− > ((sear |=(* ~) (just 'a')) [[1 1] "abc"])
803− [p=[p=1 q=2] q=~]
963+> ((sear |=(* ~) (just 'a')) [[1 1] "abc"])
964+[p=[p=1 q=2] q=~]
804965```
805966
806967---
@@ -809,7 +970,7 @@ A `++rule`.
809970
810971Char in range
811972
812−Match characters (`++char`) within a range.
973+Match characters (`char`) within a range.
813974
814975#### Accepts
815976
@@ -819,75 +980,73 @@ Match characters (`++char`) within a range.
819980
820981#### Produces
821982
822−A `++rule`.
983+A `rule`.
823984
824985#### Source
825986
826987```hoon
827− ++ shim :: match char in range
828− ~/ %shim
829− |= {les/@ mos/@}
830− ~/ %fun
831− |= tub/nail
832− ^- (like char)
833− ?~ q.tub
834− (fail tub)
835− ?. ?&((gte i.q.tub les) (lte i.q.tub mos))
836− (fail tub)
837− (next tub)
838− ::
988+++ shim
989+ ~/ %shim
990+ |= [les=@ mos=@]
991+ ~/ %fun
992+ |= tub=nail
993+ ^- (like char)
994+ ?~ q.tub
995+ (fail tub)
996+ ?. ?&((gte i.q.tub les) (lte i.q.tub mos))
997+ (fail tub)
998+ (next tub)
839999```
8401000
8411001#### Examples
8421002
8431003```
844− > ((shim 'a' 'z') [[1 1] "abc"])
845− [p=[p=1 q=2] q=[~ [p=~~a q=[p=[p=1 q=2] q="bc"]]]]
1004+> `tape`(rash 'abc' (plus (shim 'a' 'z')))
1005+"abc"
8461006
847− > ((shim 'a' 'Z') [[1 1] "abc"])
848− [p=[p=1 q=1] q=~]
849−
850− > ((shim 'a' 'Z') [[1 1] "Abc"])
851− [p=[p=1 q=2] q=[~ [p=~~~41. q=[p=[p=1 q=2] q="bc"]]]]
1007+> `tape`(rash 'ABC' (plus (shim 'a' 'z')))
1008+{1 1}
1009+syntax error
8521010```
8531011
8541012---
8551013
856−## `++slug` {#slug}
1014+## `++slug`
8571015
8581016Use gate to parse delimited list
8591017
860−Parser modifier: By composing with a gate, parse a delimited `++list` of
1018+Parser modifier: By composing with a gate, parse a delimited `list` of
8611019matches.
8621020
8631021#### Accepts
8641022
865−`bus` is a `++rule`.
1023+`raq` is a binary gate.
1024+
1025+`bus` is a `rule`.
8661026
867−`fel` is a `++rule`.
1027+`fel` is a `rule`.
8681028
8691029#### Produces
8701030
871−A `++rule`.
1031+A `rule`.
8721032
8731033#### Source
8741034
8751035```hoon
876− ++ slug
877− |* raq/_|*({a/* b/*} [a b])
878− |* {bus/rule fel/rule}
879− ;~((comp raq) fel (stir +<+.raq raq ;~(pfix bus fel)))
880− ::
1036+++ slug
1037+ |* raq=_=>(~ |*([a=* b=*] [a b]))
1038+ |* [bus=rule fel=rule]
1039+ ;~((comp raq) fel (stir +<+.raq raq ;~(pfix bus fel)))
8811040```
8821041
8831042#### Examples
8841043
8851044```
886− > (scan "20+5+110" ((slug add) lus dem))
887− 135
1045+> (scan "20+5+110" ((slug add) lus dem))
1046+135
8881047
889− > `@t`(scan "a b c" ((slug |=(a/[@ @t] (cat 3 a))) ace alp))
890− 'abc'
1048+> `@t`(scan "a b c" ((slug |=(a=[@t @t] (cat 3 a))) ace alp))
1049+'abc'
8911050```
8921051
8931052---
@@ -896,7 +1055,7 @@ A `++rule`.
8961055
8971056Add label
8981057
899−Add a label to an edge parsed by a rule.
1058+Add a label to an `edge` parsed by a `rule`.
9001059
9011060#### Accepts
9021061
@@ -906,34 +1065,27 @@ Add a label to an edge parsed by a rule.
9061065
9071066#### Produces
9081067
909−A `++rule`.
1068+A `rule`.
9101069
9111070#### Source
9121071
9131072```hoon
914− ++ stag :: add a label
915− ~/ %stag
916− |* {gob/* sef/rule}
917− ~/ %fun
918− |= tub/nail
919− =+ vex=(sef tub)
920− ?~ q.vex
921− vex
922− [p=p.vex q=[~ u=[p=[gob p.u.q.vex] q=q.u.q.vex]]]
923− ::
1073+++ stag
1074+ ~/ %stag
1075+ |* [gob=* sef=rule]
1076+ ~/ %fun
1077+ |= tub=nail
1078+ =+ vex=(sef tub)
1079+ ?~ q.vex
1080+ vex
1081+ [p=p.vex q=[~ u=[p=[gob p.u.q.vex] q=q.u.q.vex]]]
9241082```
9251083
9261084#### Examples
9271085
9281086```
929− > ((stag %foo (just 'a')) [[1 1] "abc"])
930− [p=[p=1 q=2] q=[~ u=[p=[%foo ~~a] q=[p=[p=1 q=2] q="bc"]]]]
931−
932− > ((stag "xyz" (jest 'abc')) [[1 1] "abc"])
933− [p=[p=1 q=4] q=[~ u=[p=["xyz" 'abc'] q=[p=[p=1 q=4] q=""]]]]
934−
935− > ((stag 10.000 (shim 0 100)) [[1 1] "abc"])
936− [p=[p=1 q=2] q=[~ u=[p=[10.000 ~~a] q=[p=[p=1 q=2] q="bc"]]]]
1087+> (rash 'abc' (stag %foo (jest 'abc')))
1088+[%foo 'abc']
9371089```
9381090
9391091---
@@ -942,41 +1094,45 @@ A `++rule`.
9421094
9431095List of matches
9441096
945−Parser modifier: parse `++list` of matches.
1097+Parser modifier: parse `list` of matches.
9461098
9471099#### Accepts
9481100
949−`fel` is a `++rule`.
1101+`fel` is a `rule`.
9501102
9511103#### Produces
9521104
1105+A `rule`.
1106+
1107+#### Source
1108+
9531109```hoon
954− ++ star :: 0 or more times
955− |* fel/rule
956− (stir `(list _(wonk *fel))`~ |*({a/* b/*} [a b]) fel)
1110+++ star
1111+ |* fel=rule
1112+ (stir `(list _(wonk *fel))`~ |*([a=* b=*] [a b]) fel)
9571113```
9581114
9591115#### Examples
9601116
9611117```
962− > (scan "aaaaa" (just 'a'))
963− ! {1 2}
964− ! 'syntax-error'
965− ! exit
1118+> (scan "aaaaa" (just 'a'))
1119+! {1 2}
1120+! 'syntax-error'
1121+! exit
9661122
967− > (scan "aaaaa" (star (just 'a')))
968− "aaaaa"
1123+> (scan "aaaaa" (star (just 'a')))
1124+"aaaaa"
9691125
970− > (scan "abcdef" (star (just 'a')))
971− ! {1 2}
972− ! 'syntax-error'
973− ! exit
1126+> (scan "abcdef" (star (just 'a')))
1127+! {1 2}
1128+! 'syntax-error'
1129+! exit
9741130
975− > (scan "abcabc" (star (jest 'abc')))
976− <|abc abc|>
1131+> (scan "abcabc" (star (jest 'abc')))
1132+<|abc abc|>
9771133
978− > (scan "john smith" (star (shim 0 200)))
979− "john smith"
1134+> (scan "john smith" (star (shim 0 200)))
1135+"john smith"
9801136```
9811137
9821138---
@@ -985,7 +1141,8 @@ Parser modifier: parse `++list` of matches.
9851141
9861142Add faces
9871143
988−Add faces `[p q]` to range-parser pairs in a list.
1144+Add faces `[p q]` to range-parser pairs in a list. Typically used in combination
1145+with [`++stew`](#stew).
9891146
9901147#### Accepts
9911148
@@ -993,97 +1150,114 @@ Add faces `[p q]` to range-parser pairs in a list.
9931150
9941151#### Produces
9951152
1153+A `(list [p=?(@ [@ @]) q=rule])`.
1154+
9961155#### Source
9971156
9981157```hoon
999− ++ stet
1000− |* leh/(list {?(@ {@ @}) rule})
1001− |-
1002− ?~ leh
1003− ~
1004− [i=[p=-.i.leh q=+.i.leh] t=$(leh t.leh)]
1005− ::
1158+++ stet
1159+ |* leh=(list [?(@ [@ @]) rule])
1160+ |-
1161+ ?~ leh
1162+ ~
1163+ [i=[p=-.i.leh q=+.i.leh] t=$(leh t.leh)]
10061164```
10071165
10081166#### Examples
10091167
10101168```
1011− > (stet (limo [[5 (just 'a')] [1 (jest 'abc')] [[1 1] (shim 0 200)]
1012− [[1 10] (cold %foo (just 'a'))]~]))
1013− ~[
1014− [p=5 q=<1.lrk [tub=[p=[p=@ud q=@ud] q=""] <1.nqy [daf=@tD <394.imz 97.kdz 1.xlc %164>]>]>]
1015− [p=1 q=<1.lrk [tub=[p=[p=@ud q=@ud] q=""] <1.nqy [daf=@tD <394.imz 97.kdz 1.xlc %164>]>]>]
1016− [p=[1 1] q=<1.lrk [tub=[p=[p=@ud q=@ud] q=""] <1.nqy [daf=@tD <394.imz 97.kdz 1.xlc %164>]>]>]
1017− [p=[1 10] q=<1.lrk [tub=[p=[p=@ud q=@ud] q=""] <1.nqy [daf=@tD <394.imz 97.kdz 1.xlc %164>]>]>]
1018− ]
1019− > [[[1 1] (just 'a')] [[2 1] (shim 0 200)] ~]
1020− [ [[1 1] <1.tnv [tub=[p=[p=@ud q=@ud] q=""] <1.ktu [daf=@tD <414.fvk 101.jzo 1.ypj %164>]>]>]
1021− [[2 1] <1.fvg [tub=[p=[p=@ud q=@ud] q=""] <1.khu [[les=@ mos=@] <414.fvk 101.jzo 1.ypj %164>]>]>]
1022− ~
1023− ]
1024− > (stet (limo [[[1 1] (just 'a')] [[2 1] (shim 0 200)] ~]))
1025− ~[
1026− [p=[1 1] q=<1.lrk [tub=[p=[p=@ud q=@ud] q=""] <1.nqy [daf=@tD <394.imz 97.kdz 1.xlc %164>]>]>]
1027− [p=[2 1] q=<1.lrk [tub=[p=[p=@ud q=@ud] q=""] <1.nqy [daf=@tD <394.imz 97.kdz 1.xlc %164>]>]>]
1028− ]
1169+> =rule %- stew
1170+ %- stet
1171+ %- limo
1172+ :~
1173+ [['a' 'z'] (cook |=(a=@ (sub a 32)) alp)]
1174+ [['A' 'Z'] (cook |=(a=@ (add a 32)) alp)]
1175+ ==
1176+
1177+> `tape`(rash 'fooBARbaz' (star rule))
1178+"FOObarBAZ"
10291179```
10301180
10311181---
10321182
10331183## `++stew`
10341184
1035−Switch by first
1185+Switch by first char
1186+
1187+Parser generator. From an associative `list` of characters or character
1188+ranges to `rule`s, construct a `map`, and parse `tape`s only
1189+with `rule`s associated with a range that the `tape`'s first character falls in.
1190+
1191+#### Accepts
1192+
1193+`leh` is a `(list [p=?(@ [@ @]) q=rule])`, where `p` is a `char` or `char` range.
1194+
1195+#### Produces
1196+
1197+A `rule`.
1198+
1199+#### Source
10361200
10371201```hoon
1038− ++ stew :: switch by first char
1039− ~/ %stew
1040− |* leh/(list {p/?(@ {@ @}) q/rule}) :: char+range keys
1041− =+ ^= wor :: range complete lth
1042− |= {ort/?(@ {@ @}) wan/?(@ {@ @})}
1043− ?@ ort
1044− ?@(wan (lth ort wan) (lth ort -.wan))
1045− ?@(wan (lth +.ort wan) (lth +.ort -.wan))
1046− =+ ^= hel :: build parser map
1047− =+ hel=`(tree _?>(?=(^ leh) i.leh))`~
1048− |- ^+ hel
1049− ?~ leh
1050− ~
1051− =+ yal=$(leh t.leh)
1052− |- ^+ hel
1053− ?~ yal
1054− [i.leh ~ ~]
1055− ?: (wor p.i.leh p.n.yal)
1056− =+ nuc=$(yal l.yal)
1057− ?> ?=(^ nuc)
1058− ?: (vor p.n.yal p.n.nuc)
1059− [n.yal nuc r.yal]
1060− [n.nuc l.nuc [n.yal r.nuc r.yal]]
1061− =+ nuc=$(yal r.yal)
1062− ?> ?=(^ nuc)
1063− ?: (vor p.n.yal p.n.nuc)
1064− [n.yal l.yal nuc]
1065− [n.nuc [n.yal l.yal l.nuc] r.nuc]
1066− ~% %fun ..^$ ~
1067− |= tub/nail
1068− ?~ q.tub
1069− (fail tub)
1070− |-
1071− ?~ hel
1072− (fail tub)
1073− ?: ?@ p.n.hel
1074− =(p.n.hel i.q.tub)
1075− ?&((gte i.q.tub -.p.n.hel) (lte i.q.tub +.p.n.hel))
1076− :: (q.n.hel [(lust i.q.tub p.tub) t.q.tub])
1077− (q.n.hel tub)
1078− ?: (wor i.q.tub p.n.hel)
1079− $(hel l.hel)
1080− $(hel r.hel)
1081− ::
1082−```
1083−
1084−Parser generator. From an associative `++list` of characters or character
1085−ranges to `++rule`s, construct a `++map`, and parse `++tape`s only
1086−with `++rules` associated with a range that the `++tape`'s first character falls in.
1202+++ stew :: switch by first char
1203+ ~/ %stew
1204+ |* leh=(list [p=?(@ [@ @]) q=rule]) :: char+range keys
1205+ =+ ^= wor :: range complete lth
1206+ |= [ort=?(@ [@ @]) wan=?(@ [@ @])]
1207+ ?@ ort
1208+ ?@(wan (lth ort wan) (lth ort -.wan))
1209+ ?@(wan (lth +.ort wan) (lth +.ort -.wan))
1210+ =+ ^= hel :: build parser map
1211+ =+ hel=`(tree _?>(?=(^ leh) i.leh))`~
1212+ |- ^+ hel
1213+ ?~ leh
1214+ ~
1215+ =+ yal=$(leh t.leh)
1216+ |- ^+ hel
1217+ ?~ yal
1218+ [i.leh ~ ~]
1219+ ?: (wor p.i.leh p.n.yal)
1220+ =+ nuc=$(yal l.yal)
1221+ ?> ?=(^ nuc)
1222+ ?: (mor p.n.yal p.n.nuc)
1223+ [n.yal nuc r.yal]
1224+ [n.nuc l.nuc [n.yal r.nuc r.yal]]
1225+ =+ nuc=$(yal r.yal)
1226+ ?> ?=(^ nuc)
1227+ ?: (mor p.n.yal p.n.nuc)
1228+ [n.yal l.yal nuc]
1229+ [n.nuc [n.yal l.yal l.nuc] r.nuc]
1230+ ~% %fun ..^$ ~
1231+ |= tub=nail
1232+ ?~ q.tub
1233+ (fail tub)
1234+ |-
1235+ ?~ hel
1236+ (fail tub)
1237+ ?: ?@ p.n.hel
1238+ =(p.n.hel i.q.tub)
1239+ ?&((gte i.q.tub -.p.n.hel) (lte i.q.tub +.p.n.hel))
1240+ :: (q.n.hel [(lust i.q.tub p.tub) t.q.tub])
1241+ (q.n.hel tub)
1242+ ?: (wor i.q.tub p.n.hel)
1243+ $(hel l.hel)
1244+ $(hel r.hel)
1245+```
1246+
1247+#### Examples
1248+
1249+```
1250+> =rule %- stew
1251+ %- stet
1252+ %- limo
1253+ :~
1254+ [['a' 'z'] (cook |=(a=@ (sub a 32)) alp)]
1255+ [['A' 'Z'] (cook |=(a=@ (add a 32)) alp)]
1256+ ==
1257+
1258+> `tape`(rash 'fooBARbaz' (star rule))
1259+"FOObarBAZ"
1260+```
10871261
10881262---
10891263
@@ -1091,7 +1265,7 @@ with `++rules` associated with a range that the `++tape`'s first character falls
10911265
10921266Parse repeatedly
10931267
1094−Parse with `++rule` as many times as possible, and fold over results with a
1268+Parse with `rule` as many times as possible, and fold over results with a
10951269binary gate.
10961270
10971271#### Accepts
@@ -1100,37 +1274,51 @@ binary gate.
11001274
11011275`raq` is a gate that takes two nouns and produces a cell.
11021276
1103−`fel` is a rule.
1277+`fel` is a `rule`.
11041278
11051279#### Produces
11061280
1107−A rule.
1281+A `rule`.
11081282
11091283#### Source
11101284
11111285```hoon
1112− ++ stir
1113− ~/ %stir
1114− |* {rud/* raq/_=>(~ |*({a/* b/*} [a b])) fel/rule}
1115− ~/ %fun
1116− |= tub/nail
1117− ^- (like _rud)
1118− =+ vex=(fel tub)
1119− ?~ q.vex
1120− [p.vex [~ rud tub]]
1121− =+ wag=$(tub q.u.q.vex)
1122− ?> ?=(^ q.wag)
1123− [(last p.vex p.wag) [~ (raq p.u.q.vex p.u.q.wag) q.u.q.wag]]
1286+++ stir
1287+ ~/ %stir
1288+ |* [rud=* raq=_=>(~ |*([a=* b=*] [a b])) fel=rule]
1289+ ~/ %fun
1290+ |= tub=nail
1291+ ^- (like _rud)
1292+ ::
1293+ :: lef: successful interim parse results (per .fel)
1294+ :: wag: initial accumulator (.rud in .tub at farthest success)
1295+ ::
1296+ =+ ^= [lef wag]
1297+ =| lef=(list _(fel tub))
1298+ |- ^- [_lef (pair hair [~ u=(pair _rud nail)])]
1299+ =+ vex=(fel tub)
1300+ ?~ q.vex
1301+ :- lef
1302+ [p.vex [~ rud tub]]
1303+ $(lef [vex lef], tub q.u.q.vex)
1304+ ::
1305+ :: fold .lef into .wag, combining results with .raq
1306+ ::
1307+ %+ roll lef
1308+ |= _[vex=(fel tub) wag=wag] :: q.vex is always (some)
1309+ ^+ wag
1310+ :- (last p.vex p.wag)
1311+ [~ (raq p.u.+.q.vex p.u.q.wag) q.u.q.wag]
11241312```
11251313
11261314#### Examples
11271315
11281316```
1129− > (scan "abc" (stir *@ add prn))
1130− 294
1317+> (scan "abc" (stir *@ add prn))
1318+294
11311319
1132− > (roll "abc" add)
1133− b=294
1320+> (roll "abc" add)
1321+294
11341322```
11351323
11361324---
@@ -1143,49 +1331,50 @@ Parse bounded number of times.
11431331
11441332#### Accepts
11451333
1146−`[les=@ mos=@]` is a cell of atoms indicating the bounds.
1334+`lig` is a cell of atoms (`[@ @]`) indicating the bounds.
11471335
1148−`fel` is a `++rule`.
1336+`fel` is a `rule`.
11491337
11501338#### Produces
11511339
1152−A `++rule`.
1340+A `rule`.
11531341
11541342#### Source
11551343
11561344```hoon
1157− ++ stun :: parse several times
1158− |* {lig/{@ @} fel/rule}
1159− |= tub/nail
1160− ^- (like (list _(wonk (fel))))
1161− ?: =(0 +.lig)
1162− [p.tub [~ ~ tub]]
1163− =+ vex=(fel tub)
1164− ?~ q.vex
1165− ?: =(0 -.lig)
1166− [p.vex [~ ~ tub]]
1167− vex
1168− =+ ^= wag %= $
1169− -.lig ?:(=(0 -.lig) 0 (dec -.lig))
1170− +.lig ?:(=(0 +.lig) 0 (dec +.lig))
1171− tub q.u.q.vex
1172− ==
1173− ?~ q.wag
1174− wag
1175− [p.wag [~ [p.u.q.vex p.u.q.wag] q.u.q.wag]]
1345+++ stun
1346+ ~/ %stun
1347+ |* [lig=[@ @] fel=rule]
1348+ |= tub=nail
1349+ ^- (like (list _(wonk (fel))))
1350+ ?: =(0 +.lig)
1351+ [p.tub [~ ~ tub]]
1352+ =+ vex=(fel tub)
1353+ ?~ q.vex
1354+ ?: =(0 -.lig)
1355+ [p.vex [~ ~ tub]]
1356+ vex
1357+ =+ ^= wag %= $
1358+ -.lig ?:(=(0 -.lig) 0 (dec -.lig))
1359+ +.lig ?:(=(0 +.lig) 0 (dec +.lig))
1360+ tub q.u.q.vex
1361+ ==
1362+ ?~ q.wag
1363+ wag
1364+ [p.wag [~ [p.u.q.vex p.u.q.wag] q.u.q.wag]]
11761365```
11771366
11781367#### Examples
11791368
11801369```
1181− > ((stun [5 10] prn) [1 1] "aquickbrownfoxran")
1182− [p=[p=1 q=11] q=[~ [p="aquickbrow" q=[p=[p=1 q=11] q="nfoxran"]]]]
1370+> ((stun [5 10] prn) [1 1] "aquickbrownfoxran")
1371+[p=[p=1 q=11] q=[~ [p="aquickbrow" q=[p=[p=1 q=11] q="nfoxran"]]]]
11831372
1184− > ((stun [5 10] prn) [1 1] "aquickbro")
1185− [p=[p=1 q=10] q=[~ [p="aquickbro" q=[p=[p=1 q=10] q=""]]]]
1373+> ((stun [5 10] prn) [1 1] "aquickbro")
1374+[p=[p=1 q=10] q=[~ [p="aquickbro" q=[p=[p=1 q=10] q=""]]]]
11861375
1187− > ((stun [5 10] prn) [1 1] "aqui")
1188− [p=[p=1 q=5] q=~]
1376+> ((stun [5 10] prn) [1 1] "aqui")
1377+[p=[p=1 q=5] q=~]
11891378```
11901379
11911380---
content/docs/hoon/reference/stdlib/table-of-contents.md+12−15
@@ -141,7 +141,6 @@ Can be navigated [alphabetically](#alphabetical) or [by section](#by-section).
141141<a class="tooltip" href='/docs/hoon/reference/stdlib/2h/#digin' title="Address of a in set"><code>++dig:in</code></a>
142142<a class="tooltip" href='/docs/hoon/reference/stdlib/4j/#dimag' title="Parse decimal number"><code>++dim:ag</code></a>
143143<a class="tooltip" href='/docs/hoon/reference/stdlib/3g/#dime' title="Auraatom pair"><code>+$dime</code></a>
144−<a class="tooltip" href='/docs/hoon/reference/stdlib/4c/#dinre' title="(Undocumented)"><code>++din:re</code></a>
145144<a class="tooltip" href='/docs/hoon/reference/stdlib/2d/#dis' title="Binary AND (atoms)"><code>++dis</code></a>
146145<a class="tooltip" href='/docs/hoon/reference/stdlib/4i/#dit' title="Decimal digit"><code>++dit</code></a>
147146<a class="tooltip" href='/docs/hoon/reference/stdlib/1a/#div' title="Divide"><code>++div</code></a>
@@ -213,7 +212,6 @@ Can be navigated [alphabetically](#alphabetical) or [by section](#by-section).
213212<a class="tooltip" href='/docs/hoon/reference/stdlib/3f/#fenob' title="Reverse +fe"><code>++fen:ob</code></a>
214213<a class="tooltip" href='/docs/hoon/reference/stdlib/2c/#fil' title="Fill bloqstream"><code>++fil</code></a>
215214<a class="tooltip" href='/docs/hoon/reference/stdlib/2b/#find' title="First index in list"><code>++find</code></a>
216−<a class="tooltip" href='/docs/hoon/reference/stdlib/4c/#fitre' title="Fit on one line test"><code>++fit:re</code></a>
217215<a class="tooltip" href='/docs/hoon/reference/stdlib/2q/#flag' title="Boolean (flag)"><code>+$flag</code></a>
218216<a class="tooltip" href='/docs/hoon/reference/stdlib/3b/#flifl' title="Flip sign"><code>++fli:fl</code></a>
219217<a class="tooltip" href='/docs/hoon/reference/stdlib/2a/#flit' title="Make filter"><code>++flit</code></a>
@@ -232,6 +230,7 @@ Can be navigated [alphabetically](#alphabetical) or [by section](#by-section).
232230<a class="tooltip" href='/docs/hoon/reference/stdlib/3a/#frasi' title="Divide (signed integer)"><code>++fra:si</code></a>
233231<a class="tooltip" href='/docs/hoon/reference/stdlib/4f/#full' title="Parse to end"><code>++full</code></a>
234232<a class="tooltip" href='/docs/hoon/reference/stdlib/4f/#funk' title="Add to tape"><code>++funk</code></a>
233+<a class="tooltip" href='/docs/hoon/reference/stdlib/4f/#fuss' title="Has A or B?"><code>++fuss</code></a>
235234<a class="tooltip" href='/docs/hoon/reference/stdlib/3f/#fyndob' title="Restore structure v3"><code>++fynd:ob</code></a>
236235
237236### g
@@ -304,6 +303,7 @@ Can be navigated [alphabetically](#alphabetical) or [by section](#by-section).
304303
305304<a class="tooltip" href='/docs/hoon/reference/stdlib/3b/#iblfl' title="Integer binary logarithm"><code>++ibl:fl</code></a>
306305<a class="tooltip" href='/docs/hoon/reference/stdlib/4f/#ifix' title="Infix"><code>++ifix</code></a>
306+<a class="tooltip" href='/docs/hoon/reference/stdlib/4f/#inde' title="Indentation block"><code>++inde</code></a>
307307<a class="tooltip" href='/docs/hoon/reference/stdlib/4a/#indpo' title="Parse suffix"><code>++ind:po</code></a>
308308<a class="tooltip" href='/docs/hoon/reference/stdlib/4a/#inspo' title="Parse prefix"><code>++ins:po</code></a>
309309<a class="tooltip" href='/docs/hoon/reference/stdlib/2i/#intby' title="Intersection (map)"><code>++int:by</code></a>
@@ -468,6 +468,7 @@ Can be navigated [alphabetically](#alphabetical) or [by section](#by-section).
468468<a class="tooltip" href='/docs/hoon/reference/stdlib/4h/#pel' title="Parse ( (pel)"><code>++pel</code></a>
469469<a class="tooltip" href='/docs/hoon/reference/stdlib/4h/#per' title="Parse ) (per)"><code>++per</code></a>
470470<a class="tooltip" href='/docs/hoon/reference/stdlib/4l/#perdso' title="Parses dime/tiple without standard prefixes"><code>++perd:so</code></a>
471+<a class="tooltip" href='/docs/hoon/reference/stdlib/4f/#perk' title="Parse cube fork"><code>++perk</code></a>
471472<a class="tooltip" href='/docs/hoon/reference/stdlib/4j/#pevab' title="Parse <=5 in base 32"><code>++pev:ab</code></a>
472473<a class="tooltip" href='/docs/hoon/reference/stdlib/4j/#pewab' title="Parse <= 5 in base 64"><code>++pew:ab</code></a>
473474<a class="tooltip" href='/docs/hoon/reference/stdlib/4e/#pfix' title="Discard first rule"><code>++pfix</code></a>
@@ -485,6 +486,7 @@ Can be navigated [alphabetically](#alphabetical) or [by section](#by-section).
485486<a class="tooltip" href='/docs/hoon/reference/stdlib/4i/#prn' title="Parse any printable character"><code>++prn</code></a>
486487<a class="tooltip" href='/docs/hoon/reference/stdlib/3a/#profo' title="Multiplies b and c modulo a"><code>++pro:fo</code></a>
487488<a class="tooltip" href='/docs/hoon/reference/stdlib/3a/#prosi' title="Multiply to signed integer"><code>++pro:si</code></a>
489+<a class="tooltip" href='/docs/hoon/reference/stdlib/4f/#punt' title="Unitized parse"><code>++punt</code></a>
488490<a class="tooltip" href='/docs/hoon/reference/stdlib/2i/#putby' title="Add keyvalue pair (map)"><code>++put:by</code></a>
489491<a class="tooltip" href='/docs/hoon/reference/stdlib/2h/#putin' title="Put b in a (set)"><code>++put:in</code></a>
490492<a class="tooltip" href='/docs/hoon/reference/stdlib/2j/#putju' title="Add keyset pair (jar)"><code>++put:ju</code></a>
@@ -528,7 +530,6 @@ Can be navigated [alphabetically](#alphabetical) or [by section](#by-section).
528530<a class="tooltip" href='/docs/hoon/reference/stdlib/2c/#rev' title="Reverse"><code>++rev</code></a>
529531<a class="tooltip" href='/docs/hoon/reference/stdlib/4b/#rfat' title="Print loobean"><code>++rf:at</code></a>
530532<a class="tooltip" href='/docs/hoon/reference/stdlib/2i/#ribby' title="Transform + product (map)"><code>++rib:by</code></a>
531−<a class="tooltip" href='/docs/hoon/reference/stdlib/4c/#rigre' title="Wrap tape in / (tank)"><code>++rig:re</code></a>
532533<a class="tooltip" href='/docs/hoon/reference/stdlib/2c/#rip' title="Disassemble"><code>++rip</code></a>
533534<a class="tooltip" href='/docs/hoon/reference/stdlib/4b/#rnat' title="Print null"><code>++rn:at</code></a>
534535<a class="tooltip" href='/docs/hoon/reference/stdlib/2c/#rolfe' title="Roll left"><code>++rol:fe</code></a>
@@ -600,11 +601,9 @@ Can be navigated [alphabetically](#alphabetical) or [by section](#by-section).
600601<a class="tooltip" href='/docs/hoon/reference/stdlib/3d/#shax' title="SHA256"><code>++shax</code></a>
601602<a class="tooltip" href='/docs/hoon/reference/stdlib/3d/#shay' title="SHA256 with length"><code>++shay</code></a>
602603<a class="tooltip" href='/docs/hoon/reference/stdlib/3d/#shaz' title="SHA512"><code>++shaz</code></a>
603−<a class="tooltip" href='/docs/hoon/reference/stdlib/4c/#shep' title="(Undocumented)"><code>++shep</code></a>
604604<a class="tooltip" href='/docs/hoon/reference/stdlib/3b/#shffl' title="Shift power"><code>++shf:fl</code></a>
605605<a class="tooltip" href='/docs/hoon/reference/stdlib/4f/#shim' title="Match character within range"><code>++shim</code></a>
606−<a class="tooltip" href='/docs/hoon/reference/stdlib/4c/#shop' title="(Undocumented)"><code>++shop</code></a>
607−<a class="tooltip" href='/docs/hoon/reference/stdlib/4c/#show' title="(Undocumented)"><code>++show</code></a>
606+<a class="tooltip" href='/docs/hoon/reference/stdlib/4c/#show' title="Pretty-printer (deprecated)"><code>++show</code></a>
608607<a class="tooltip" href='/docs/hoon/reference/stdlib/3a/#si' title="Signed integer"><code>++si</code></a>
609608<a class="tooltip" href='/docs/hoon/reference/stdlib/2m/#sinl' title="Construct set from nullterminated noun"><code>++si:nl</code></a>
610609<a class="tooltip" href='/docs/hoon/reference/stdlib/4j/#sibab' title="Parse binary digit"><code>++sib:ab</code></a>
@@ -785,11 +784,11 @@ Can be navigated [alphabetically](#alphabetical) or [by section](#by-section).
785784<a class="tooltip" href='/docs/hoon/reference/stdlib/4b/#wack' title="Knot escape"><code>++wack</code></a>
786785<a class="tooltip" href='/docs/hoon/reference/stdlib/2q/#wain' title="List of cords"><code>+$wain</code></a>
787786<a class="tooltip" href='/docs/hoon/reference/stdlib/2q/#wall' title="List of list of characters"><code>+$wall</code></a>
787+<a class="tooltip" href='/docs/hoon/reference/stdlib/4c/#wash' title="Render tank at width"><code>++wash</code></a>
788788<a class="tooltip" href='/docs/hoon/reference/stdlib/2b/#weld' title="Concatenate two lists"><code>++weld</code></a>
789789<a class="tooltip" href='/docs/hoon/reference/stdlib/2m/#weldnl' title="Concatenate nullterminated nouns"><code>++weld:nl</code></a>
790790<a class="tooltip" href='/docs/hoon/reference/stdlib/2b/#welp' title="Perfect concatenate (lists)"><code>++welp</code></a>
791791<a class="tooltip" href='/docs/hoon/reference/stdlib/4b/#wick' title="Knot unescape"><code>++wick</code></a>
792−<a class="tooltip" href='/docs/hoon/reference/stdlib/4c/#wigre' title="++win render tape"><code>++wig:re</code></a>
793792<a class="tooltip" href='/docs/hoon/reference/stdlib/4c/#winre' title="Render at indent"><code>++win:re</code></a>
794793<a class="tooltip" href='/docs/hoon/reference/stdlib/4o/#wing' title="Address in subject"><code>++wing</code></a>
795794<a class="tooltip" href='/docs/hoon/reference/stdlib/4j/#wizag' title="Parse base 64 number"><code>++wiz:ag</code></a>
@@ -1467,17 +1466,11 @@ Can be navigated [alphabetically](#alphabetical) or [by section](#by-section).
14671466
14681467### 4c: tank printer
14691468
1469+<a class="tooltip" href='/docs/hoon/reference/stdlib/4c/#wash' title="Render tank at width"><code>++wash</code></a>
14701470<a class="tooltip" href='/docs/hoon/reference/stdlib/4c/#re' title="Prettyprinting engine (tank)"><code>++re</code></a>
1471−<a class="tooltip" href='/docs/hoon/reference/stdlib/4c/#dinre' title="(Undocumented)"><code>++din:re</code></a>
1472−<a class="tooltip" href='/docs/hoon/reference/stdlib/4c/#fitre' title="Fit on one line test"><code>++fit:re</code></a>
14731471<a class="tooltip" href='/docs/hoon/reference/stdlib/4c/#ramre' title="Flatten tank to tape"><code>++ram:re</code></a>
1474−<a class="tooltip" href='/docs/hoon/reference/stdlib/4c/#rigre' title="Wrap tape in / (tank)"><code>++rig:re</code></a>
1475−<a class="tooltip" href='/docs/hoon/reference/stdlib/4c/#wigre' title="++win render tape"><code>++wig:re</code></a>
14761472<a class="tooltip" href='/docs/hoon/reference/stdlib/4c/#winre' title="Render at indent"><code>++win:re</code></a>
1477−
1478−<a class="tooltip" href='/docs/hoon/reference/stdlib/4c/#shep' title="(Undocumented)"><code>++shep</code></a>
1479−<a class="tooltip" href='/docs/hoon/reference/stdlib/4c/#shop' title="(Undocumented)"><code>++shop</code></a>
1480−<a class="tooltip" href='/docs/hoon/reference/stdlib/4c/#show' title="(Undocumented)"><code>++show</code></a>
1473+<a class="tooltip" href='/docs/hoon/reference/stdlib/4c/#show' title="Pretty-printer (deprecated)"><code>++show</code></a>
14811474
14821475### 4d: parsing (tracing)
14831476
@@ -1506,8 +1499,10 @@ Can be navigated [alphabetically](#alphabetical) or [by section](#by-section).
15061499<a class="tooltip" href='/docs/hoon/reference/stdlib/4f/#easy' title="Always parse"><code>++easy</code></a>
15071500<a class="tooltip" href='/docs/hoon/reference/stdlib/4f/#full' title="Parse to end"><code>++full</code></a>
15081501<a class="tooltip" href='/docs/hoon/reference/stdlib/4f/#funk' title="Add to tape"><code>++funk</code></a>
1502+<a class="tooltip" href='/docs/hoon/reference/stdlib/4f/#fuss' title="Has A or B?"><code>++fuss</code></a>
15091503<a class="tooltip" href='/docs/hoon/reference/stdlib/4f/#here' title="Placebased apply"><code>++here</code></a>
15101504<a class="tooltip" href='/docs/hoon/reference/stdlib/4f/#ifix' title="Infix"><code>++ifix</code></a>
1505+<a class="tooltip" href='/docs/hoon/reference/stdlib/4f/#inde' title="Indentation block"><code>++inde</code></a>
15111506<a class="tooltip" href='/docs/hoon/reference/stdlib/4f/#jest' title="Match a cord"><code>++jest</code></a>
15121507<a class="tooltip" href='/docs/hoon/reference/stdlib/4f/#just' title="Match a single character"><code>++just</code></a>
15131508<a class="tooltip" href='/docs/hoon/reference/stdlib/4f/#knee' title="Recursive parsers"><code>++knee</code></a>
@@ -1515,7 +1510,9 @@ Can be navigated [alphabetically](#alphabetical) or [by section](#by-section).
15151510<a class="tooltip" href='/docs/hoon/reference/stdlib/4f/#more' title="Parse list with delimiter"><code>++more</code></a>
15161511<a class="tooltip" href='/docs/hoon/reference/stdlib/4f/#most' title="Parse list of at least one match"><code>++most</code></a>
15171512<a class="tooltip" href='/docs/hoon/reference/stdlib/4f/#next' title="Consume character"><code>++next</code></a>
1513+<a class="tooltip" href='/docs/hoon/reference/stdlib/4f/#perk' title="Parse cube fork"><code>++perk</code></a>
15181514<a class="tooltip" href='/docs/hoon/reference/stdlib/4f/#plus' title="List of at least one match"><code>++plus</code></a>
1515+<a class="tooltip" href='/docs/hoon/reference/stdlib/4f/#punt' title="Unitized parse"><code>++punt</code></a>
15191516<a class="tooltip" href='/docs/hoon/reference/stdlib/4f/#sear' title="Conditional ++cook"><code>++sear</code></a>
15201517<a class="tooltip" href='/docs/hoon/reference/stdlib/4f/#shim' title="Match character within range"><code>++shim</code></a>
15211518<a class="tooltip" href='/docs/hoon/reference/stdlib/4f/#slug' title="Use gate to parse delimited list"><code>++slug</code></a>
lib/glossary.js+36−43
@@ -2221,13 +2221,6 @@ export const glossary = [
22212221 slug: "https://urbit.org/docs/reference/library/3g/#dime",
22222222 desc: "Used in the Hoon standard library.",
22232223 },
2224− {
2225− name: "(Undocumented)",
2226− symbol: "din:re",
2227− usage: "stdlib",
2228− slug: "https://urbit.org/docs/reference/library/4c/#dinre",
2229− desc: "Used in the Hoon standard library.",
2230− },
22312224 {
22322225 name: "Binary AND (atoms)",
22332226 symbol: "dis",
@@ -2690,13 +2683,6 @@ export const glossary = [
26902683 slug: "https://urbit.org/docs/reference/library/2b/#find",
26912684 desc: "Used in the Hoon standard library.",
26922685 },
2693− {
2694− name: "Fit on one line test",
2695− symbol: "fit:re",
2696− usage: "stdlib",
2697− slug: "https://urbit.org/docs/reference/library/4c/#fitre",
2698− desc: "Used in the Hoon standard library.",
2699− },
27002686 {
27012687 name: "Boolean (flag)",
27022688 symbol: "flag",
@@ -2823,6 +2809,13 @@ export const glossary = [
28232809 slug: "https://urbit.org/docs/reference/library/4f/#funk",
28242810 desc: "Used in the Hoon standard library.",
28252811 },
2812+ {
2813+ name: "Has A or B?",
2814+ symbol: "fuss",
2815+ usage: "stdlib",
2816+ slug: "https://urbit.org/docs/reference/library/4f/#fuss",
2817+ desc: "Used in the Hoon standard library.",
2818+ },
28262819 {
28272820 name: "New line or ''",
28282821 symbol: "gah",
@@ -3264,6 +3257,13 @@ export const glossary = [
32643257 slug: "https://urbit.org/docs/reference/library/2h/#in",
32653258 desc: "Used in the Hoon standard library.",
32663259 },
3260+ {
3261+ name: "Indentation block",
3262+ symbol: "inde",
3263+ usage: "stdlib",
3264+ slug: "https://urbit.org/docs/reference/library/4f/#inde",
3265+ desc: "Used in the Hoon standard library.",
3266+ },
32673267 {
32683268 name: "Parse suffix",
32693269 symbol: "ind:po",
@@ -4258,6 +4258,13 @@ export const glossary = [
42584258 slug: "https://urbit.org/docs/reference/library/4l/#perdso",
42594259 desc: "Used in the Hoon standard library.",
42604260 },
4261+ {
4262+ name: "Parse cube fork",
4263+ symbol: "perk",
4264+ usage: "stdlib",
4265+ slug: "https://urbit.org/docs/reference/library/4f/#perk",
4266+ desc: "Used in the Hoon standard library.",
4267+ },
42614268 {
42624269 name: "Parse <=5 in base 32",
42634270 symbol: "pev:ab",
@@ -4377,6 +4384,13 @@ export const glossary = [
43774384 slug: "https://urbit.org/docs/reference/library/3a/#prosi",
43784385 desc: "Used in the Hoon standard library.",
43794386 },
4387+ {
4388+ name: "Unitized parse",
4389+ symbol: "punt",
4390+ usage: "stdlib",
4391+ slug: "https://urbit.org/docs/reference/library/4f/#punt",
4392+ desc: "Used in the Hoon standard library.",
4393+ },
43804394 {
43814395 name: "Add key-value pair (map)",
43824396 symbol: "put:by",
@@ -4629,13 +4643,6 @@ export const glossary = [
46294643 slug: "https://urbit.org/docs/reference/library/2i/#ribby",
46304644 desc: "Used in the Hoon standard library.",
46314645 },
4632− {
4633− name: "Wrap tape in / (tank)",
4634− symbol: "rig:re",
4635− usage: "stdlib",
4636− slug: "https://urbit.org/docs/reference/library/4c/#rigre",
4637− desc: "Used in the Hoon standard library.",
4638− },
46394646 {
46404647 name: "Disassemble",
46414648 symbol: "rip",
@@ -5105,13 +5112,6 @@ export const glossary = [
51055112 slug: "https://urbit.org/docs/reference/library/3d/#shaz",
51065113 desc: "Used in the Hoon standard library.",
51075114 },
5108− {
5109− name: "(Undocumented)",
5110− symbol: "shep",
5111− usage: "stdlib",
5112− slug: "https://urbit.org/docs/reference/library/4c/#shep",
5113− desc: "Used in the Hoon standard library.",
5114− },
51155115 {
51165116 name: "Shift power",
51175117 symbol: "shf:fl",
@@ -5127,14 +5127,7 @@ export const glossary = [
51275127 desc: "Used in the Hoon standard library.",
51285128 },
51295129 {
5130− name: "(Undocumented)",
5131− symbol: "shop",
5132− usage: "stdlib",
5133− slug: "https://urbit.org/docs/reference/library/4c/#shop",
5134− desc: "Used in the Hoon standard library.",
5135− },
5136− {
5137− name: "(Undocumented)",
5130+ name: "Pretty-printer (deprecated)",
51385131 symbol: "show",
51395132 usage: "stdlib",
51405133 slug: "https://urbit.org/docs/reference/library/4c/#show",
@@ -6302,6 +6295,13 @@ export const glossary = [
63026295 slug: "https://urbit.org/docs/reference/library/2q/#wall",
63036296 desc: "Used in the Hoon standard library.",
63046297 },
6298+ {
6299+ name: "Render tank at width",
6300+ symbol: "wash",
6301+ usage: "stdlib",
6302+ slug: "https://urbit.org/docs/reference/library/4c/#wash",
6303+ desc: "Used in the Hoon standard library.",
6304+ },
63056305 {
63066306 name: "Concatenate two lists",
63076307 symbol: "weld",
@@ -6330,13 +6330,6 @@ export const glossary = [
63306330 slug: "https://urbit.org/docs/reference/library/4b/#wick",
63316331 desc: "Used in the Hoon standard library.",
63326332 },
6333− {
6334− name: "win - render tape",
6335− symbol: "wig:re",
6336− usage: "stdlib",
6337− slug: "https://urbit.org/docs/reference/library/4c/#wigre",
6338− desc: "Used in the Hoon standard library.",
6339− },
63406333 {
63416334 name: "Render at indent",
63426335 symbol: "win:re",