on master help sign in
update stdlib 2b and 2c sections

- add +bake +rear +snip +sew + glossary.js & table of contents entries - update source code - various other updates

commit69c5dc8333c754b54400782c9551fbf8898fc241 authortinnus-napbus <admin@tinnus-napbus.xyz> dateSun 19 Sep 2021, 00:37 (5 years ago) parented1cff8
4 files changed+1349−1042
content/docs/hoon/reference/stdlib/2b.md+601−405 content/docs/hoon/reference/stdlib/2c.md+713−637 content/docs/hoon/reference/stdlib/table-of-contents.md+7 lib/glossary.js+28
content/docs/hoon/reference/stdlib/2b.md+601−405
@@ -4,6 +4,52 @@ weight = 5
44template = "doc.html"
55+++
66
7+### `++bake`
8+
9+**Note:** This function isn't specifically a list function but is included in section 2b of the standard library so is documented here for completeness.
10+
11+Convert wet gate `f` to a dry gate by specifying argument mold `a`.
12+
13+`+bake` is a wet gate that takes a wet gate and produces a dry gate.
14+
15+#### Accepts
16+
17+`f` is a `gate`.
18+
19+`a` is a `mold`.
20+
21+#### Produces
22+
23+A dry `gate` whose sample type is `a`.
24+
25+#### Source
26+
27+```hoon
28+++ bake
29+ |* [f=gate a=mold]
30+ |= arg=a
31+ (f arg)
32+```
33+
34+#### Examples
35+
36+```
37+> =wet-gate |*(a=* [a a])
38+> (wet-gate 42)
39+[42 42]
40+> (wet-gate ['foo' 'bar'])
41+[['foo' 'bar'] 'foo' 'bar']
42+> =dry-gate (bake wet-gate @ud)
43+> (dry-gate 42)
44+[42 42]
45+> (dry-gate ['foo' 'bar'])
46+-need.@ud
47+-have.[@t @t]
48+nest-fail
49+```
50+
51+---
52+
753### `++fand`
854
955All indices in `list`
@@ -24,41 +70,47 @@ A `list`.
2470#### Source
2571
2672```hoon
27− ++ fand
28− ~/ %fand
29− |= [nedl=(list) hstk=(list)]
30− =| i=@ud
31− =| fnd=(list @ud)
32− |- ^+ fnd
33− =+ [n=nedl h=hstk]
34− |-
35− ?: |(?=($~ n) ?=($~ h))
36− (flop fnd)
37− ?: =(i.n i.h)
38− ?~ t.n
39− ^$(i +(i), hstk +.hstk, fnd [i fnd])
40− $(n t.n, h t.h)
41− ^$(i +(i), hstk +.hstk)
73+++ fand
74+ ~/ %fand
75+ |= [nedl=(list) hstk=(list)]
76+ =| i=@ud
77+ =| fnd=(list @ud)
78+ |- ^+ fnd
79+ =+ [n=nedl h=hstk]
80+ |-
81+ ?: |(?=(~ n) ?=(~ h))
82+ (flop fnd)
83+ ?: =(i.n i.h)
84+ ?~ t.n
85+ ^$(i +(i), hstk +.hstk, fnd [i fnd])
86+ $(n t.n, h t.h)
87+ ^$(i +(i), hstk +.hstk)
4288```
4389
4490#### Examples
4591
4692```
47− > (fand ~[3] ~[1 2 3])
48− ~[2]
49−
50− > (fand ~[4] ~[1 2 3])
51− ~
93+> (fand ~[3] ~[1 2 3])
94+~[2]
95+```
5296
53− > (fand ~['a'] "cbabab")
54− ~[2 4]
97+```
98+> (fand ~[4] ~[1 2 3])
99+~
100+```
55101
56− > (fand "ba" "cbabab")
57− ~[1 3]
102+```
103+> (fand ~['a'] "cbabab")
104+~[2 4]
58105```
59106
107+```
108+> (fand "ba" "cbabab")
109+~[1 3]
110+```
60111
61112---
113+
62114### `++find`
63115
64116First index in `list`
@@ -79,42 +131,51 @@ The `unit` of an atom.
79131#### Source
80132
81133```hoon
82− ++ find
83− ~/ %find
84− |= [nedl=(list) hstk=(list)]
85− =| i=@ud
86− |- ^- (unit @ud)
87− =+ [n=nedl h=hstk]
88− |-
89− ?: |(?=($~ n) ?=($~ h))
90− ~
91− ?: =(i.n i.h)
92− ?~ t.n
93− `i
94− $(n t.n, h t.h)
95− ^$(i +(i), hstk +.hstk)
134+++ find
135+ ~/ %find
136+ |= [nedl=(list) hstk=(list)]
137+ =| i=@ud
138+ |- ^- (unit @ud)
139+ =+ [n=nedl h=hstk]
140+ |-
141+ ?: |(?=(~ n) ?=(~ h))
142+ ~
143+ ?: =(i.n i.h)
144+ ?~ t.n
145+ `i
146+ $(n t.n, h t.h)
147+ ^$(i +(i), hstk +.hstk)
96148```
97149
98150#### Examples
99151
100152```
101− > (find [3]~ ~[1 2 3])
102− [~ u=2]
153+> (find [3]~ ~[1 2 3])
154+[~ u=2]
155+```
103156
104− > (find [4]~ ~[1 2 3])
105− ~
157+```
158+> (find [4]~ ~[1 2 3])
159+~
160+```
106161
107− > (find ['c']~ "cbabab")
108− [~ u=0]
162+```
163+> (find ['c']~ "cbabab")
164+[~ u=0]
165+```
109166
110− > (find "ab" "cbabab")
111− [~ u=1]
167+```
168+> (find "ab" "cbabab")
169+[~ u=1]
170+```
112171
113− > (find "bab" "cbabab")
114− [~ u=2]
172+```
173+> (find "bab" "cbabab")
174+[~ u=2]
115175```
116176
117177---
178+
118179### `++flop`
119180
120181Reverse
@@ -132,30 +193,32 @@ A `list`.
132193#### Source
133194
134195```hoon
135− ++ flop
136− ~/ %flop
137− |* a=(list)
138− => .(a (homo a))
139− ^+ a
140− =+ b=`_a`~
141− |-
142− ?~ a b
143− $(a t.a, b [i.a b])
196+++ flop
197+ ~/ %flop
198+ |* a=(list)
199+ => .(a (homo a))
200+ ^+ a
201+ =+ b=`_a`~
202+ |-
203+ ?~ a b
204+ $(a t.a, b [i.a b])
144205```
145206
146−
147207#### Examples
148208
149209```
150− > =a [1 2 3 ~]
151− > (flop a)
152− ~[3 2 1]
210+> =a [1 2 3 ~]
211+> (flop a)
212+~[3 2 1]
213+```
153214
154− > (flop (flop a))
155− ~[1 2 3]
215+```
216+> (flop (flop a))
217+~[1 2 3]
156218```
157219
158220---
221+
159222### `++gulf`
160223
161224List from range
@@ -176,23 +239,27 @@ a `list`.
176239#### Source
177240
178241```hoon
179− ++ gulf
180− |= [a=@ b=@]
181− ^- (list @)
182− ?:(=(a +(b)) ~ [a $(a +(a))])
242+++ gulf
243+ |= [a=@ b=@]
244+ ?> (lte a b)
245+ |- ^- (list @)
246+ ?:(=(a +(b)) ~ [a $(a +(a))])
183247```
184248
185249#### Examples
186250
187251```
188− > (gulf 1 6)
189− ~[1 2 3 4 5 6]
252+> (gulf 1 6)
253+~[1 2 3 4 5 6]
254+```
190255
191− > `(list @t)`(gulf 99 106)
192− <|c d e f g h i j|>
256+```
257+> `(list @t)`(gulf 99 106)
258+<|c d e f g h i j|>
193259```
194260
195261---
262+
196263### `++homo`
197264
198265Homogenize
@@ -212,7 +279,7 @@ a `list`.
212279#### Source
213280
214281```hoon
215−++ homo :: homogenize
282+++ homo
216283 |* a=(list)
217284 ^+ =< $
218285 |@ ++ $ ?:(*? ~ [i=(snag 0 a) t=$])
@@ -223,18 +290,55 @@ a `list`.
223290#### Examples
224291
225292```
226− > lyst
227− [i=1 t=[i=97 t=[i=2 t=[i=98 t=[i=[~ u=10] t=~]]]]]
293+> lyst
294+[i=1 t=[i=97 t=[i=2 t=[i=98 t=[i=[~ u=10] t=~]]]]]
295+> (homo lyst)
296+~[1 97 2 98 [~ u=10]]
297+```
298+
299+```
300+> =a (limo [1 2 3 ~])
301+> a
302+[i=1 t=[i=2 t=[i=3 t=~]]]
303+> (homo a)
304+~[1 2 3]
305+```
228306
229− > (homo lyst)
230− ~[1 97 2 98 [~ u=10]]
307+---
231308
232− > =a (limo [1 2 3 ~])
233− > a
234− [i=1 t=[i=2 t=[i=3 t=~]]]
309+### `++into`
310+
311+Insert item at index
312+
313+Accepts a `list` `a`, an atom `b`, and a noun `c`, producing the list of `a` with the item `c` inserted at index `b`.
314+
315+#### Accepts
316+
317+`a` is a list.
318+
319+`b` is a atom.
320+
321+`c` is a noun.
322+
323+#### Produces
324+
325+the list of `a` with the item `c` inserted at index `b`.
326+
327+#### Source
328+
329+```hoon
330+++ into
331+ ~/ %into
332+ |* [a=(list) b=@ c=*]
333+ ^+ a
334+ (weld (scag b a) [c (slag b a)])
335+```
336+
337+#### Examples
235338
236− > (homo a)
237− ~[1 2 3]
339+```
340+> (into (limo ~[2 3 4]) 1 11)
341+~[2 11 3 4]
238342```
239343
240344---
@@ -256,28 +360,31 @@ a `list`.
256360#### Source
257361
258362```hoon
259− ++ join
260− |* [sep=* lit=(list)]
261− =. sep `_?>(?=(^ lit) i.lit)`sep
262− ?~ lit ~
263− =| out=(list _?>(?=(^ lit) i.lit))
264− |- ^+ out
265− ?~ t.lit
266− (flop [i.lit out])
267− $(out [sep i.lit out], lit t.lit)
363+++ join
364+ |* [sep=* lit=(list)]
365+ =. sep `_?>(?=(^ lit) i.lit)`sep
366+ ?~ lit ~
367+ =| out=(list _?>(?=(^ lit) i.lit))
368+ |- ^+ out
369+ ?~ t.lit
370+ (flop [i.lit out])
371+ $(out [sep i.lit out], lit t.lit)
268372```
269373
270374#### Examples
271375
272376```
273− > (join ' ' "hoon")
274− "h o o n"
377+> (join ' ' "hoon")
378+"h o o n"
379+```
275380
276− > (join 0 `(list @)`~[1 2 3])
277− ~[1 0 2 0 3]
381+```
382+> (join 0 `(list @)`~[1 2 3])
383+~[1 0 2 0 3]
278384```
279385
280386---
387+
281388### `++lent`
282389
283390List length
@@ -295,28 +402,30 @@ an atom.
295402#### Source
296403
297404```hoon
298− ++ lent
299− ~/ %lent
300− |= a=(list)
301− ^- @
302− =+ b=0
303− |-
304− ?~ a b
305− $(a t.a, b +(b))
405+++ lent
406+ ~/ %lent
407+ |= a=(list)
408+ ^- @
409+ =+ b=0
410+ |-
411+ ?~ a b
412+ $(a t.a, b +(b))
306413```
307414
308415#### Examples
309416
310417```
311− > (lent [1 2 3 4 ~]))
312− 4
313−
314− > (lent [1 'a' 2 'b' (some 10) ~])
315− 5
418+> (lent [1 2 3 4 ~]))
419+4
316420```
317421
422+```
423+> (lent [1 'a' 2 'b' (some 10) ~])
424+5
425+```
318426
319427---
428+
320429### `++levy`
321430
322431Logical "and" on list
@@ -336,27 +445,28 @@ A boolean.
336445#### Source
337446
338447```hoon
339− ++ levy
340− ~/ %levy :: all of
341− |* [a=(list) b=$-(* ?)]
342− |- ^- ?
343− ?~ a &
344− ?. (b i.a) |
345− $(a t.a)
448+++ levy
449+ ~/ %levy
450+ |* [a=(list) b=$-(* ?)]
451+ |- ^- ?
452+ ?~ a &
453+ ?. (b i.a) |
454+ $(a t.a)
346455```
347456
348457#### Examples
349458
350459```
351− > =a |=(a=@ (lte a 1))
352− > (levy `(list @)`[0 1 2 1 ~] a)
353− %.n
354−
355− > =a |=(a=@ (lte a 3))
356− > (levy `(list @)`[0 1 2 1 ~] a)
357− %.y
460+> =a |=(a=@ (lte a 1))
461+> (levy `(list @)`[0 1 2 1 ~] a)
462+%.n
358463```
359464
465+```
466+> =a |=(a=@ (lte a 3))
467+> (levy `(list @)`[0 1 2 1 ~] a)
468+%.y
469+```
360470
361471---
362472
@@ -376,29 +486,31 @@ every element of `++list` `a`.
376486#### Source
377487
378488```hoon
379− ++ lien
380− ~/ %lien
381− |* [a=(list) b=$-(* ?)]
382− |- ^- ?
383− ?~ a |
384− ?: (b i.a) &
385− $(a t.a)
489+++ lien
490+ ~/ %lien
491+ |* [a=(list) b=$-(* ?)]
492+ |- ^- ?
493+ ?~ a |
494+ ?: (b i.a) &
495+ $(a t.a)
386496```
387497
388498#### Examples
389499
390500```
391− > =a |=(a=@ (gte a 1))
392− > (lien `(list @)`[0 1 2 1 ~] a)
393− %.y
394−
395− > =a |=(a=@ (gte a 3))
396− > (lien `(list @)`[0 1 2 1 ~]) a)
397− %.n
501+> =a |=(a=@ (gte a 1))
502+> (lien `(list @)`[0 1 2 1 ~] a)
503+%.y
398504```
399505
506+```
507+> =a |=(a=@ (gte a 3))
508+> (lien `(list @)`[0 1 2 1 ~]) a)
509+%.n
510+```
400511
401512---
513+
402514### `++limo`
403515
404516List Constructor
@@ -416,7 +528,7 @@ A `++list`.
416528#### Source
417529
418530```hoon
419−++ limo :: listify
531+++ limo
420532 |* a=*
421533 ^+ =< $
422534 |@ ++ $ ?~(a ~ ?:(*? [i=-.a t=$] $(a +.a)))
@@ -427,18 +539,18 @@ A `++list`.
427539#### Examples
428540
429541```
430− > (limo [1 2 3 ~])
431− [i=1 t=[i=2 t=[i=3 t=~]]]
542+> (limo [1 2 3 ~])
543+[i=1 t=[i=2 t=[i=3 t=~]]]
432544```
433545
434−
435546---
547+
436548### `++murn`
437549
438550Maybe transform
439551
440552Passes each member of `list` `a` to gate `b`, which must produce a
441−`unit`. Produces a new list with all the results that do not produce
553+`unit`. Produces a new list with all the results that do not produce
442554`~`.
443555
444556#### Accepts
@@ -454,27 +566,27 @@ A unit.
454566#### Source
455567
456568```hoon
457− ++ murn :: maybe transform
458− ~/ %murn
459− |* [a=(list) b=$-(* (unit))]
460− |-
461− ?~ a ~
462− =+ c=(b i.a)
463− ?~ c
464− $(a t.a)
465− [i=u.c t=$(a t.a)]
569+++ murn
570+ ~/ %murn
571+ |* [a=(list) b=$-(* (unit))]
572+ => .(a (homo a))
573+ |- ^- (list _?>(?=(^ a) (need (b i.a))))
574+ ?~ a ~
575+ =/ c (b i.a)
576+ ?~ c $(a t.a)
577+ [+.c $(a t.a)]
466578```
467579
468580#### Examples
469581
470582```
471− > =a |=(a=@ ?.((gte a 2) ~ (some (add a 10))))
472− > (murn `(list @)`[0 1 2 3 ~] a)
473− [i=12 t=[i=13 t=~]]
583+> =a |=(a=@ ?.((gte a 2) ~ (some (add a 10))))
584+> (murn `(list @)`[0 1 2 3 ~] a)
585+[i=12 t=[i=13 t=~]]
474586```
475587
476−
477588---
589+
478590### `++oust`
479591
480592Remove
@@ -493,24 +605,26 @@ A `++list`.
493605#### Source
494606
495607```hoon
496− ++ oust :: remove
497− ~/ %oust
498− |* [[a=@ b=@] c=(list)]
499− (weld (scag a c) (slag (add a b) c))
608+++ oust
609+ ~/ %oust
610+ |* [[a=@ b=@] c=(list)]
611+ (weld (scag +<-< c) (slag (add +<-< +<->) c))
500612```
501613
502614#### Examples
503615
504616```
505− > (oust [4 5] "good day, urbit!")
506− "good urbit!"
507−
508− > (oust [2 2] `(list @)`[1 2 3 4 ~])
509− ~[1 2]
617+> (oust [4 5] "good day, urbit!")
618+"good urbit!"
510619```
511620
621+```
622+> (oust [2 2] `(list @)`[1 2 3 4 ~])
623+~[1 2]
624+```
512625
513626---
627+
514628### `++reap`
515629
516630Replicate
@@ -530,29 +644,70 @@ A list.
530644#### Source
531645
532646```hoon
533− ++ reap :: replicate
534− ~/ %reap
535− |* [a=@ b=*]
536− |- ^- (list _b)
537− ?~ a ~
538− [b $(a (dec a))]
647+++ reap
648+ ~/ %reap
649+ |* [a=@ b=*]
650+ |- ^- (list _b)
651+ ?~ a ~
652+ [b $(a (dec a))]
539653```
540654
541655#### Examples
542656
543657```
544− > (reap 20 %a)
545− ~[%a %a %a %a %a %a %a %a %a %a %a %a %a %a %a %a %a %a %a %a]
658+> (reap 20 %a)
659+~[%a %a %a %a %a %a %a %a %a %a %a %a %a %a %a %a %a %a %a %a]
660+```
546661
547− > (reap 5 ~s1)
548− ~[~s1 ~s1 ~s1 ~s1 ~s1]
662+```
663+> (reap 5 ~s1)
664+~[~s1 ~s1 ~s1 ~s1 ~s1]
665+> `@dr`(roll (reap 5 ~s1) add)
666+~s5
667+```
668+
669+---
549670
550− > `@dr`(roll (reap 5 ~s1) add)
551− ~s5
671+### `++rear`
672+
673+Last item of list
674+
675+Produces the last item in list `a`, crashing if `a` is null.
676+
677+#### Accepts
678+
679+`a` is a `list`.
680+
681+#### Produces
682+
683+The type of the last element in `a`.
684+
685+#### Source
686+
687+```hoon
688+++ rear
689+ ~/ %rear
690+ |* a=(list)
691+ ^- _?>(?=(^ a) i.a)
692+ ?> ?=(^ a)
693+ ?: =(~ t.a) i.a
694+ $(a t.a)
552695```
553696
697+#### Examples
698+
699+```
700+> (rear ~[1 2 3])
701+3
702+```
703+
704+```
705+> (rear ~)
706+dojo: hoon expression failed
707+```
554708
555709---
710+
556711### `++reel`
557712
558713Right fold
@@ -582,30 +737,31 @@ The accumulator, which is a noun.
582737#### Source
583738
584739```hoon
585− ++ reel
586− ~/ %reel
587− |* [a=(list) b=_|=([* *] +<+)]
588− |- ^+ +<+.b
589− ?~ a
590− +<+.b
591− (b i.a $(a t.a))
740+++ reel
741+ ~/ %reel
742+ |* [a=(list) b=_=>(~ |=([* *] +<+))]
743+ |- ^+ ,.+<+.b
744+ ?~ a
745+ +<+.b
746+ (b i.a $(a t.a))
592747```
593748
594749#### Examples
595750
596751```
597− > (reel `(list @)`[1 2 3 4 5 ~] add)
598− 15
752+> (reel `(list @)`[1 2 3 4 5 ~] add)
753+15
599754
600− > (reel `(list @)`[6 3 1 ~] sub)
601− 4
755+> (reel `(list @)`[6 3 1 ~] sub)
756+4
602757
603− > (reel `(list @)`[3 6 1 ~] sub)
604− ! subtract-underflow
605− ! exit
758+> (reel `(list @)`[3 6 1 ~] sub)
759+! subtract-underflow
760+! exit
606761```
607762
608763`+mul`'s default sample is 1, so calling `+reel` with `+mul` yields the expected behavior:
764+
609765```
610766> *mul
6117671
@@ -613,21 +769,24 @@ The accumulator, which is a noun.
613769> (reel `(list @)`~[1 2 3 4] mul)
61477024
615771```
772+
616773However, if you build a gate that uses `+mul` like so, the sample defaults to 0
617774since that is the bunt of `@`:
775+
618776```
619777> (reel `(list @)`~[1 2 3 4] |=([a=@ b=@] (mul a b)))
6207780
621779```
780+
622781We can fix this with `|:`:
782+
623783```
624784> (reel `(list @)`~[1 2 3 4] |:([a=1 b=1] (mul a b)))
62578524
626786```
627787
628−
629−
630788---
789+
631790### `++roll`
632791
633792Left fold
@@ -657,13 +816,13 @@ The accumulator, which is a noun.
657816#### Source
658817
659818```hoon
660− ++ roll :: left fold
661− ~/ %roll
662− |* [a=(list) b=_|=([* *] +<+)]
663− |- ^+ +<+.b
664− ?~ a
665− +<+.b
666− $(a t.a, b b(+<+ (b i.a +<+.b)))
819+++ roll
820+ ~/ %roll
821+ |* [a=(list) b=_=>(~ |=([* *] +<+))]
822+ |- ^+ ,.+<+.b
823+ ?~ a
824+ +<+.b
825+ $(a t.a, b b(+<+ (b i.a +<+.b)))
667826```
668827
669828#### Examples
@@ -681,6 +840,7 @@ q=4
681840```
682841
683842`+mul`'s default sample is 1, so calling `+roll` with `+mul` yields the expected behavior:
843+
684844```
685845> *mul
6868461
@@ -688,20 +848,24 @@ q=4
688848> (roll `(list @)`~[1 2 3 4] mul)
68984924
690850```
851+
691852However, if you build a gate that uses `+mul` like so, the sample defaults to 0
692853since that is the bunt of `@`:
854+
693855```
694856> (roll `(list @)`~[1 2 3 4] |=([a=@ b=@] (mul a b)))
6958570
696858```
859+
697860We can fix this with `|:`:
861+
698862```
699863> (roll `(list @)`~[1 2 3 4] |:([a=1 b=1] (mul a b)))
70086424
701865```
702866
703−
704867---
868+
705869### `++scag`
706870
707871Prefix
@@ -722,26 +886,28 @@ A list of the same type as `b`.
722886#### Source
723887
724888```hoon
725− ++ scag :: prefix
726− ~/ %scag
727− |* [a=@ b=(list)]
728− |- ^+ b
729− ?: |(?=(~ b) =(0 a)) ~
730− [i.b $(b t.b, a (dec a))]
889+++ scag
890+ ~/ %scag
891+ |* [a=@ b=(list)]
892+ |- ^+ b
893+ ?: |(?=(~ b) =(0 a)) ~
894+ [i.b $(b t.b, a (dec a))]
731895```
732896
733897#### Examples
734898
735899```
736− > (scag 2 `(list @)`[1 2 3 4 ~])
737− [i=1 t=~[2]]
738−
739− > (scag 10 `(list @)`[1 2 3 4 ~])
740− [i=1 t=~[2 3 4]]
900+> (scag 2 `(list @)`[1 2 3 4 ~])
901+[i=1 t=~[2]]
741902```
742903
904+```
905+> (scag 10 `(list @)`[1 2 3 4 ~])
906+[i=1 t=~[2 3 4]]
907+```
743908
744909---
910+
745911### `++skid`
746912
747913Separate
@@ -765,26 +931,25 @@ A cell of two lists.
765931#### Source
766932
767933```hoon
768− ++ skid :: separate
769− ~/ %skid
770− |* [a=(list) b=$-(* ?)]
771− |- ^+ [p=a q=a]
772− ?~ a [~ ~]
773− =+ c=$(a t.a)
774− ?:((b i.a) [[i.a p.c] q.c] [p.c [i.a q.c]])
934+++ skid
935+ ~/ %skid
936+ |* [a=(list) b=$-(* ?)]
937+ |- ^+ [p=a q=a]
938+ ?~ a [~ ~]
939+ =+ c=$(a t.a)
940+ ?:((b i.a) [[i.a p.c] q.c] [p.c [i.a q.c]])
775941```
776942
777−
778943#### Examples
779944
780945```
781− > =a |=(a=@ (gth a 1))
782− > (skid `(list @)`[0 1 2 3 ~] a)
783− [p=[i=2 t=~[3]] q=[i=0 t=~[1]]]
946+> =a |=(a=@ (gth a 1))
947+> (skid `(list @)`[0 1 2 3 ~] a)
948+[p=[i=2 t=~[3]] q=[i=0 t=~[1]]]
784949```
785950
786−
787951---
952+
788953### `++skim`
789954
790955Suffix
@@ -806,24 +971,25 @@ A list.
806971#### Source
807972
808973```hoon
809− ++ skim :: only
810− ~/ %skim
811− |* [a=(list) b=$-(* ?)]
812− |-
813− ^+ a
814− ?~ a ~
815− ?:((b i.a) [i.a $(a t.a)] $(a t.a))
974+++ skim
975+ ~/ %skim
976+ |* [a=(list) b=$-(* ?)]
977+ |-
978+ ^+ a
979+ ?~ a ~
980+ ?:((b i.a) [i.a $(a t.a)] $(a t.a))
816981```
817982
818983#### Examples
819984
820985```
821− > =a |=(a=@ (gth a 1))
822− > (skim `(list @)`[0 1 2 3 ~] a)
823− [i=2 t=~[3]]
986+> =a |=(a=@ (gth a 1))
987+> (skim `(list @)`[0 1 2 3 ~] a)
988+[i=2 t=~[3]]
824989```
825990
826991---
992+
827993### `++skip`
828994
829995Except
@@ -845,25 +1011,25 @@ A list of the same type as `a`.
8451011#### Source
8461012
8471013```hoon
848− ++ skip :: except
849− ~/ %skip
850− |* [a=(list) b=$-(* ?)]
851− |-
852− ^+ a
853− ?~ a ~
854− ?:((b i.a) $(a t.a) [i.a $(a t.a)])
1014+++ skip
1015+ ~/ %skip
1016+ |* [a=(list) b=$-(* ?)]
1017+ |-
1018+ ^+ a
1019+ ?~ a ~
1020+ ?:((b i.a) $(a t.a) [i.a $(a t.a)])
8551021```
8561022
8571023#### Examples
8581024
8591025```
860− > =a |=(a=@ (gth a 1))
861− > (skip `(l)`[0 1 2 3 ~]) a)
862− [i=0 t=[i=1 t=~]]
1026+> =a |=(a=@ (gth a 1))
1027+> (skip `(l)`[0 1 2 3 ~]) a)
1028+[i=0 t=[i=1 t=~]]
8631029```
8641030
865−
8661031---
1032+
8671033### `++slag`
8681034
8691035Suffix
@@ -884,26 +1050,26 @@ A list of the same type as `b`.
8841050#### Source
8851051
8861052```hoon
887− ++ slag :: suffix
888− ~/ %slag
889− |* [a=@ b=(list)]
890− |- ^+ b
891− ?: =(0 a) b
892− ?~ b ~
893− $(b t.b, a (dec a))
1053+++ slag
1054+ ~/ %slag
1055+ |* [a=@ b=(list)]
1056+ |- ^+ b
1057+ ?: =(0 a) b
1058+ ?~ b ~
1059+ $(b t.b, a (dec a))
8941060```
8951061
8961062#### Examples
8971063
8981064```
899− > (slag 2 (limo [1 2 3 4 ~]))
900− [i=3 t=[i=4 t=~]]
901− > (slag 1 (limo [1 2 3 4 ~]))
902− [i=2 t=[i=3 t=[i=4 t=~]]]
1065+> (slag 2 (limo [1 2 3 4 ~]))
1066+[i=3 t=[i=4 t=~]]
1067+> (slag 1 (limo [1 2 3 4 ~]))
1068+[i=2 t=[i=3 t=[i=4 t=~]]]
9031069```
9041070
905−
9061071---
1072+
9071073### `++snag`
9081074
9091075Index
@@ -924,133 +1090,143 @@ Produces an element of `b`, or crashes if no element exists at that index.
9241090#### Source
9251091
9261092```hoon
927− ++ snag :: index
928− ~/ %snag
929− |* [a=@ b=(list)]
930− |-
931− ?~ b
932− ~|('snag-fail' !!)
933− ?: =(0 a) i.b
934− $(b t.b, a (dec a))
1093+++ snag
1094+ ~/ %snag
1095+ |* [a=@ b=(list)]
1096+ |- ^+ ?>(?=(^ b) i.b)
1097+ ?~ b
1098+ ~_ leaf+"snag-fail"
1099+ !!
1100+ ?: =(0 a) i.b
1101+ $(b t.b, a (dec a))
9351102```
9361103
9371104#### Examples
9381105
9391106```
940− > (snag 2 "asdf")
941− ~~d
942− > (snag 0 `(list @ud)`~[1 2 3 4])
943− 1
1107+> (snag 2 "asdf")
1108+'d'
9441109```
9451110
1111+```
1112+> (snag 0 `(list @ud)`~[1 2 3 4])
1113+1
1114+```
9461115
9471116---
948−### `++snoc`
9491117
950−Append
1118+### `++snap`
9511119
952−Accepts a `++list` `a` and a noun `b`, producing the list of `b` appended to `a`.
1120+Replace item at index
1121+
1122+Accepts a `list` `a`, an atom `b`, and a noun `c`, producing the list of `a` with the item at index `b` replaced with `c`.
9531123
9541124#### Accepts
9551125
9561126`a` is a list.
9571127
958−`b` is a noun.
1128+`b` is a atom.
1129+
1130+`c` is a noun.
9591131
9601132#### Produces
9611133
962−Produces a list of `b` appended to `a`.
1134+the list of `a` with the item at index `b` replaced with `c`.
9631135
9641136#### Source
9651137
9661138```hoon
967− ++ snoc
968− |* [a/(list) b/*]
969− (weld a ^+(a [b]~))
1139+++ snap
1140+ ~/ %snap
1141+ |* [a=(list) b=@ c=*]
1142+ ^+ a
1143+ (weld (scag b a) [c (slag +(b) a)])
9701144```
9711145
9721146#### Examples
9731147
9741148```
975− > `tape`(zing (snoc `(list tape)`~["a" "bc" "def"] "g"))
976− "abcdefg"
977− > (snoc `(list @ud)`~[1 2 3] 4)
978− ~[1 2 3 4]
1149+> (snap (limo ~[2 3 4]) 1 11)
1150+~[2 11 4]
9791151```
9801152
9811153---
982−### `++snap`
983−
984−Replace item at index
9851154
986−Accepts a `list` `a`, an atom `b`, and a noun `c`, producing the list of `a` with the item at index `b` replaced with `c`.
987−
988−#### Accepts
1155+### `++snip`
9891156
990−`a` is a list.
1157+Drop tail off list
9911158
992−`b` is a atom.
1159+Removes the last element from list `a`.
9931160
994−`c` is a noun.
1161+#### Accepts
9951162
1163+`a` is a `list`.
9961164
9971165#### Produces
9981166
999−the list of `a` with the item at index `b` replaced with `c`.
1167+A `list`.
10001168
10011169#### Source
10021170
10031171```hoon
1004− ++ snap
1005− |* [a/(list) b/@ c/*]
1006− ^+ a
1007− (weld (scag b a) [c (slag +(b) a)])
1172+++ snip
1173+ ~/ %snip
1174+ |* a=(list)
1175+ ^+ a
1176+ ?~ a ~
1177+ ?: =(~ t.a) ~
1178+ [i.a $(a t.a)]
10081179```
10091180
10101181#### Examples
10111182
10121183```
1013− > (snap (limo ~[2 3 4]) 1 11)
1014− ~[2 11 4]
1184+> `tape`(snip "foobar")
1185+"fooba"
1186+```
1187+
1188+```
1189+> (snip ~)
1190+~
10151191```
10161192
10171193---
1018−### `++into`
10191194
1020−Insert item at index
1195+### `++snoc`
10211196
1022−Accepts a `list` `a`, an atom `b`, and a noun `c`, producing the list of `a` with the item `c` inserted at index `b`.
1197+Append
1198+
1199+Accepts a `++list` `a` and a noun `b`, producing the list of `b` appended to `a`.
10231200
10241201#### Accepts
10251202
10261203`a` is a list.
10271204
1028−`b` is a atom.
1029−
1030−`c` is a noun.
1031−
1205+`b` is a noun.
10321206
10331207#### Produces
10341208
1035−the list of `a` with the item `c` inserted at index `b`.
1209+Produces a list of `b` appended to `a`.
10361210
10371211#### Source
10381212
10391213```hoon
1040− ++ into
1041− |* [a/(list) b/@ c/*]
1042− ^+ a
1043− (weld (scag b a) [c (slag b a)])
1214+++ snoc
1215+ |* [a=(list) b=*]
1216+ (weld a ^+(a [b]~))
10441217```
10451218
10461219#### Examples
10471220
10481221```
1049− > (into (limo ~[2 3 4]) 1 11)
1050− ~[2 11 3 4]
1222+> `tape`(zing (snoc `(list tape)`~["a" "bc" "def"] "g"))
1223+"abcdefg"
1224+> (snoc `(list @ud)`~[1 2 3] 4)
1225+~[1 2 3 4]
10511226```
10521227
10531228---
1229+
10541230### `++sort`
10551231
10561232Quicksort
@@ -1072,27 +1248,28 @@ A list
10721248#### Source
10731249
10741250```hoon
1075− ++ sort !. :: quicksort
1076− ~/ %sort
1077− |* [a=(list) b=$-([* *] ?)]
1078− => .(a ^.(homo a))
1079− |- ^+ a
1080− ?~ a ~
1081− %+ weld
1082− $(a (skim t.a |=(c/_i.a (b c i.a))))
1083− ^+ t.a
1084− [i.a $(a (skim t.a |=(c/_i.a !(b c i.a))))]
1251+++ sort !.
1252+ ~/ %sort
1253+ |* [a=(list) b=$-([* *] ?)]
1254+ => .(a ^.(homo a))
1255+ |- ^+ a
1256+ ?~ a ~
1257+ =+ s=(skid t.a |:(c=i.a (b c i.a)))
1258+ %+ weld
1259+ $(a p.s)
1260+ ^+ t.a
1261+ [i.a $(a q.s)]
10851262```
10861263
10871264#### Examples
10881265
10891266```
1090− > (sort `(list @)`[0 1 2 3 ~] gth)
1091− ~[3 2 1 0]
1267+> (sort `(list @)`[0 1 2 3 ~] gth)
1268+~[3 2 1 0]
10921269```
10931270
1094−
10951271---
1272+
10961273### `++spin` {#spin}
10971274
10981275Gate to list, with state
@@ -1118,35 +1295,39 @@ A pair of a list and a noun.
11181295#### Source
11191296
11201297```hoon
1121− ++ spin
1122− ~/ %spin
1123− |* [a=(list) b=* c=_|=(^ [** +<+])]
1124− => .(c `$-([_?>(?=(^ a) i.a) _b] [_-:(c) _b])`c)
1125− =/ acc=(list _-:(c)) ~
1126− |- ^- (pair _acc _b)
1127− ?~ a
1128− [(flop acc) b]
1129− =^ res b (c i.a b)
1130− $(acc [res acc], a t.a)
1298+++ spin
1299+ ~/ %spin
1300+ |* [a=(list) b=* c=_|=(^ [** +<+])]
1301+ => .(c `$-([_?>(?=(^ a) i.a) _b] [_-:(c) _b])`c)
1302+ =/ acc=(list _-:(c)) ~
1303+ |- ^- (pair _acc _b)
1304+ ?~ a
1305+ [(flop acc) b]
1306+ =^ res b (c i.a b)
1307+ $(acc [res acc], a t.a)
11311308```
11321309
11331310#### Examples
11341311
11351312```
1136− > %^ spin (limo ~[4 5 6]) :: Trivial example -- does nothing with the state
1137− 0
1138− |=([n=@ a=@] [n a])
1139− [p=~[4 5 6] q=0]
1313+> %^ spin (limo ~[4 5 6]) :: Trivial example -- does nothing with the state
1314+ 0
1315+ |=([n=@ a=@] [n a])
1316+[p=~[4 5 6] q=0]
1317+```
11401318
1141− > %^ spin (limo ~[4 5 6]) :: Form a pair with `p` as the index and `q` as the list element
1142− 0
1143− |=([n=@ a=@] [`(pair)`[a n] +(a)])
1144− [p=~[[p=0 q=4] [p=1 q=5] [p=2 q=6]] q=3]
1319+```
1320+> %^ spin (limo ~[4 5 6]) :: Form a pair with `p` as the index and `q` as the list element
1321+ 0
1322+ |=([n=@ a=@] [`(pair)`[a n] +(a)])
1323+[p=~[[p=0 q=4] [p=1 q=5] [p=2 q=6]] q=3]
1324+```
11451325
1146− > %^ spin (reap 10 0) :: Create 10 random numbers less than `10`
1147− ~(. og eny)
1148− |=([n=@ rng=_og] (rads:rng 10))
1149− [p=~[7 8 6 0 1 5 4 7 9 3] q=<4.rvi {a/@uvJ <51.qyl 129.pdd 41.mac 1.ane $141>}>]
1326+```
1327+> %^ spin (reap 10 0) :: Create 10 random numbers less than `10`
1328+ ~(. og eny)
1329+ |=([n=@ rng=_og] (rads:rng 10))
1330+[p=~[7 8 6 0 1 5 4 7 9 3] q=<4.rvi {a/@uvJ <51.qyl 129.pdd 41.mac 1.ane $141>}>]
11501331```
11511332
11521333#### Discussion
@@ -1155,9 +1336,8 @@ A pair of a list and a noun.
11551336with entropy (`eny`). The head of the product is the random number, the tail
11561337is the continuation of the RNG.
11571338
1158−
1159−
11601339---
1340+
11611341### `++spun` {#spun}
11621342
11631343Gate to list, with state
@@ -1183,27 +1363,29 @@ A list.
11831363#### Source
11841364
11851365```hoon
1186− ++ spun
1187− ~/ %spun
1188− |* [a=(list) b=_|=(^ [** +<+])]
1189− p:(spin a +<+.b b)
1366+++ spun
1367+ ~/ %spun
1368+ |* [a=(list) b=_|=(^ [** +<+])]
1369+ p:(spin a +<+.b b)
11901370```
11911371
11921372#### Examples
11931373
11941374```
1195− > %+ spun (limo ~[4 5 6]) :: `p` as the index and `q` as the list element
1196− |=([n=@ a=@] [`(pair)`[a n] +(a)])
1197− ~[[p=0 q=4] [p=1 q=5] [p=2 q=6]]
1198−
1199− > =l (limo ~[7 8 9])
1200− > %+ spun (limo ~[4 5 6]) :: joins two lists into a list of pairs
1201− |=([n=@ a=@] [`(pair)`[(snag a l) n] +(a)])
1202− ~[[p=7 q=4] [p=8 q=5] [p=9 q=6]]
1375+> %+ spun (limo ~[4 5 6]) :: `p` as the index and `q` as the list element
1376+ |=([n=@ a=@] [`(pair)`[a n] +(a)])
1377+~[[p=0 q=4] [p=1 q=5] [p=2 q=6]]
12031378```
12041379
1380+```
1381+> =l (limo ~[7 8 9])
1382+> %+ spun (limo ~[4 5 6]) :: joins two lists into a list of pairs
1383+ |=([n=@ a=@] [`(pair)`[(snag a l) n] +(a)])
1384+~[[p=7 q=4] [p=8 q=5] [p=9 q=6]]
1385+```
12051386
12061387---
1388+
12071389### `++swag`
12081390
12091391Infix
@@ -1226,23 +1408,25 @@ A list of the same type as `c`.
12261408#### Source
12271409
12281410```hoon
1229− ++ swag
1230− |* [[a=@ b=@] c=(list)]
1231− (scag +<-> (slag +<-< c))
1411+++ swag
1412+ |* [[a=@ b=@] c=(list)]
1413+ (scag +<-> (slag +<-< c))
12321414```
12331415
12341416#### Examples
12351417
12361418```
1237− > (swag [2 5] "roly poly")
1238− "ly po"
1239−
1240− > (swag [2 2] (limo [1 2 3 4 ~]))
1241− [i=3 t=[i=4 t=~]]
1419+> (swag [2 5] "roly poly")
1420+"ly po"
12421421```
12431422
1423+```
1424+> (swag [2 2] (limo [1 2 3 4 ~]))
1425+[i=3 t=[i=4 t=~]]
1426+```
12441427
12451428---
1429+
12461430### `++turn`
12471431
12481432Gate to list
@@ -1263,23 +1447,27 @@ A list.
12631447#### Source
12641448
12651449```hoon
1266− ++ turn
1267− ~/ %turn
1268− |* [a=(list) b=gate]
1269− |-
1270− ?~ a ~
1271− [i=(b i.a) t=$(a t.a)]
1450+++ turn
1451+ ~/ %turn
1452+ |* [a=(list) b=gate]
1453+ => .(a (homo a))
1454+ ^- (list _?>(?=(^ a) (b i.a)))
1455+ |-
1456+ ?~ a ~
1457+ [i=(b i.a) t=$(a t.a)]
12721458```
12731459
12741460#### Examples
12751461
12761462```
1277− > (turn (limo [104 111 111 110 ~]) @t)
1278− <|h o o n|>
1463+> (turn (limo [104 111 111 110 ~]) @t)
1464+<|h o o n|>
1465+```
12791466
1280− > =a |=(a=@ (add a 4))
1281− > (turn (limo [1 2 3 4 ~]) a)
1282− ~[5 6 7 8]
1467+```
1468+> =a |=(a=@ (add a 4))
1469+> (turn (limo [1 2 3 4 ~]) a)
1470+~[5 6 7 8]
12831471```
12841472
12851473#### Discussion
@@ -1287,6 +1475,7 @@ A list.
12871475`turn` is Hoon's version of 'map' in Haskell.
12881476
12891477---
1478+
12901479### `++weld`
12911480
12921481Concatenate
@@ -1300,27 +1489,29 @@ Concatenate two `++list`s `a` and `b`.
13001489#### Source
13011490
13021491```hoon
1303− ++ weld
1304− ~/ %weld
1305− |* [a=(list) b=(list)]
1306− => .(a ^.(homo a), b ^.(homo b))
1307− |- ^+ b
1308− ?~ a b
1309− [i.a $(a t.a)]
1492+++ weld
1493+ ~/ %weld
1494+ |* [a=(list) b=(list)]
1495+ => .(a ^.(homo a), b ^.(homo b))
1496+ |- ^+ b
1497+ ?~ a b
1498+ [i.a $(a t.a)]
13101499```
13111500
13121501#### Examples
13131502
13141503```
1315− > (weld "urb" "it")
1316− "urbit"
1317−
1318− > (weld (limo [1 2 ~]) (limo [3 4 ~]))
1319− ~[1 2 3 4]
1504+> (weld "urb" "it")
1505+"urbit"
13201506```
13211507
1508+```
1509+> (weld (limo [1 2 ~]) (limo [3 4 ~]))
1510+~[1 2 3 4]
1511+```
13221512
13231513---
1514+
13241515### `++welp`
13251516
13261517Perfect weld
@@ -1341,7 +1532,7 @@ A list.
13411532#### Source
13421533
13431534```hoon
1344−++ welp :: faceless weld
1535+++ welp
13451536 ~/ %welp
13461537 =| [* *]
13471538 |@
@@ -1355,22 +1546,26 @@ A list.
13551546#### Examples
13561547
13571548```
1358− > (welp "foo" "bar")
1359− "foobar"
1360−
1361− > (welp ~[60 61 62] ~[%a %b %c])
1362− [60 61 62 %a %b %c ~]
1549+> (welp "foo" "bar")
1550+"foobar"
1551+```
13631552
1364− > ? (welp ~[60 61 62] ~[%a %b %c])
1365− {@ud @ud @ud $a $b $c $~}
1366− [60 61 62 %a %b %c ~]
1553+```
1554+> (welp ~[60 61 62] ~[%a %b %c])
1555+[60 61 62 %a %b %c ~]
13671556
1368− > (welp [sa+1 so+2 ~] si=3)
1369− [[%sa 1] [%so 2] si=3]
1557+> ? (welp ~[60 61 62] ~[%a %b %c])
1558+ {@ud @ud @ud $a $b $c $~}
1559+[60 61 62 %a %b %c ~]
13701560```
13711561
1562+```
1563+> (welp [sa+1 so+2 ~] si=3)
1564+[[%sa 1] [%so 2] si=3]
1565+```
13721566
13731567---
1568+
13741569### `++zing`
13751570
13761571Turns a `++list` of lists into a single list by promoting the elements of
@@ -1387,7 +1582,7 @@ A list.
13871582#### Source
13881583
13891584```hoon
1390−++ zing :: promote
1585+++ zing
13911586 ~/ %zing
13921587 =| *
13931588 |@
@@ -1398,15 +1593,16 @@ A list.
13981593 --
13991594```
14001595
1401−
14021596#### Examples
14031597
14041598```
1405− > (zing (limo [(limo ['a' 'b' 'c' ~]) (limo ['e' 'f' 'g' ~]) (limo ['h' 'i' 'j' ~]) ~]))
1406− ~['a' 'b' 'c' 'e' 'f' 'g' 'h' 'i' 'j']
1599+> (zing (limo [(limo ['a' 'b' 'c' ~]) (limo ['e' 'f' 'g' ~]) (limo ['h' 'i' 'j' ~]) ~]))
1600+~['a' 'b' 'c' 'e' 'f' 'g' 'h' 'i' 'j']
1601+```
14071602
1408− > (zing (limo [(limo [1 'a' 2 'b' ~]) (limo [3 'c' 4 'd' ~]) ~]))
1409− ~[1 97 2 98 3 99 4 100]
1603+```
1604+> (zing (limo [(limo [1 'a' 2 'b' ~]) (limo [3 'c' 4 'd' ~]) ~]))
1605+~[1 97 2 98 3 99 4 100]
14101606```
14111607
14121608---
content/docs/hoon/reference/stdlib/2c.md+713−637
@@ -4,15 +4,15 @@ weight = 6
44template = "doc.html"
55+++
66
7−### `++bex`
7+## `++bex`
88
99Binary exponent
1010
11−Computes the result of `2^a`, producing an atom.
11+Computes the result of `2^a`, where `a` is a block size (see [$bloq](/docs/hoon/reference/stdlib/1c#bloq)), producing an atom.
1212
1313#### Accepts
1414
15−`a` is an atom.
15+`a` is an `bloq`.
1616
1717#### Produces
1818
@@ -21,30 +21,34 @@ An atom.
2121#### Source
2222
2323```hoon
24− ++ bex
25− ~/ %bex
26− |= a=@
27− ^- @
28− ?: =(0 a) 1
29− (mul 2 $(a (dec a)))
24+++ bex
25+ ~/ %bex
26+ |= a=bloq
27+ ^- @
28+ ?: =(0 a) 1
29+ (mul 2 $(a (dec a)))
3030```
3131
3232#### Examples
3333
3434```
35− > (bex 4)
36− 16
35+> (bex 4)
36+16
37+```
3738
38− > (bex (add 19 1))
39− 1.048.576
39+```
40+> (bex (add 19 1))
41+1.048.576
42+```
4043
41− > (bex 0)
42− 1
44+```
45+> (bex 0)
46+1
4347```
4448
4549---
4650
47−### `++can`
51+## `++can`
4852
4953Assemble
5054
@@ -54,9 +58,12 @@ value.
5458
5559#### Accepts
5660
57−`a` is a block size (see [`++bloq`](/docs/hoon/reference/stdlib/1c)).
61+`a` is a block size (see [`$bloq`](/docs/hoon/reference/stdlib/1c#bloq)).
5862
59−`b` is a `list` of length-value pairs, `p` and `q`.
63+`b` is a `list` of length-value pairs, `p` and `q`:
64+
65+- `p` is a [step](/docs/hoon/reference/stdlib/1c/#step).
66+- `q` is a `@`.
6067
6168#### Produces
6269
@@ -65,45 +72,59 @@ An atom.
6572#### Source
6673
6774```hoon
68− ++ can
69− ~/ %can
70− |= [a=bloq b=(list [p=@ q=@])]
71− ^- @
72− ?~ b 0
73− (add (end a p.i.b q.i.b) (lsh a p.i.b $(b t.b)))
75+++ can
76+ ~/ %can
77+ |= [a=bloq b=(list [p=step q=@])]
78+ ^- @
79+ ?~ b 0
80+ (add (end [a p.i.b] q.i.b) (lsh [a p.i.b] $(b t.b)))
7481```
7582
7683#### Examples
7784
7885```
79− > `@ub`21 :: @ub is the binary aura
80− 0b1.0101
86+> `@ub`21 :: @ub is the binary aura
87+0b1.0101
88+```
8189
82− > `@ub`(can 3 ~[[1 21]])
83− 0b1.0101
90+```
91+> `@ub`(can 3 ~[[1 21]])
92+0b1.0101
93+```
8494
85− > `@ub`(can 3 ~[[1 1]])
86− 0b1
95+```
96+> `@ub`(can 3 ~[[1 1]])
97+0b1
98+```
8799
88− > `@ub`(can 0 ~[[1 255]])
89− 0b1
100+```
101+> `@ub`(can 0 ~[[1 255]])
102+0b1
103+```
90104
91− > `@ux`(can 3 [3 0xc1] [1 0xa] ~) :: @ux is the hexadecimal aura
92− 0xa00.00c1
105+```
106+> `@ux`(can 3 [3 0xc1] [1 0xa] ~) :: @ux is the hexadecimal aura
107+0xa00.00c1
108+```
93109
94− > `@ux`(can 3 [3 0xc1] [1 0xa] [1 0x23] ~)
95− 0x23.0a00.00c1
110+```
111+> `@ux`(can 3 [3 0xc1] [1 0xa] [1 0x23] ~)
112+0x23.0a00.00c1
113+```
96114
97− > `@ux`(can 4 [3 0xc1] [1 0xa] [1 0x23] ~)
98− 0x23.000a.0000.0000.00c1
115+```
116+> `@ux`(can 4 [3 0xc1] [1 0xa] [1 0x23] ~)
117+0x23.000a.0000.0000.00c1
118+```
99119
100− > `@ux`(can 3 ~[[1 'a'] [2 'bc']])
101− 0x63.6261
120+```
121+> `@ux`(can 3 ~[[1 'a'] [2 'bc']])
122+0x63.6261
102123```
103124
104125---
105126
106−### `++cat`
127+## `++cat`
107128
108129Concatenate
109130
@@ -112,7 +133,7 @@ atom.
112133
113134#### Accepts
114135
115−`a` is a block size (see [`++bloq`](/docs/hoon/reference/stdlib/1c)).
136+`a` is a block size (see [`$bloq`](/docs/hoon/reference/stdlib/1c#bloq)).
116137
117138`b` is an atom.
118139
@@ -125,49 +146,43 @@ An atom.
125146#### Source
126147
127148```hoon
128− ++ cat
129− ~/ %cat
130− |= [a=bloq b=@ c=@]
131− (add (lsh a (met a b) c) b)
149+++ cat
150+ ~/ %cat
151+ |= [a=bloq b=@ c=@]
152+ (add (lsh [a (met a b)] c) b)
132153```
133154
134155#### Examples
135156
136157```
137− > `@ub`(cat 3 1 0) :: @ub is the binary aura
138− 0b1
139−
140− > `@ub`(cat 0 1 1)
141− 0b11
142−
143− > `@ub`(cat 0 2 1)
144− 0b110
145−
146− > `@ub`(cat 2 1 1)
147− 0b1.0001
148−
149− > `@ub`256
150− 0b1.0000.0000
151−
152− > `@ub`255
153− 0b1111.1111
154−
155− > `@ub`(cat 3 256 255)
156− 0b1111.1111.0000.0001.0000.0000
157−
158− > `@ub`(cat 2 256 255)
159− 0b1111.1111.0001.0000.0000
160−
161− > (cat 3 256 255)
162− 16.711.936
158+> `@ub`(cat 3 1 0) :: @ub is the binary aura
159+0b1
160+> `@ub`(cat 0 1 1)
161+0b11
162+> `@ub`(cat 0 2 1)
163+0b110
164+> `@ub`(cat 2 1 1)
165+0b1.0001
166+```
163167
164− > (cat 2 256 255)
165− 1.044.736
168+```
169+> `@ub`256
170+0b1.0000.0000
171+> `@ub`255
172+0b1111.1111
173+> `@ub`(cat 3 256 255)
174+0b1111.1111.0000.0001.0000.0000
175+> `@ub`(cat 2 256 255)
176+0b1111.1111.0001.0000.0000
177+> (cat 3 256 255)
178+16.711.936
179+> (cat 2 256 255)
180+1.044.736
166181```
167182
168183---
169184
170−### `++cut`
185+## `++cut`
171186
172187Slice
173188
@@ -176,11 +191,12 @@ Slices `c` blocks of size `a` that are positioned `b` blocks from the end of
176191
177192#### Accepts
178193
179−`a` is a block size (see [`++bloq`](/docs/hoon/reference/stdlib/1c)).
194+`a` is a block size (see [`$bloq`](/docs/hoon/reference/stdlib/1c)).
180195
181−`b` is an atom.
196+`[b c]` where:
182197
183−`c` is an atom.
198+- `b` is a [step](/docs/hoon/reference/stdlib/1c#step).
199+- `c` is a [step](/docs/hoon/reference/stdlib/1c#step).
184200
185201`d` is an atom.
186202
@@ -191,43 +207,42 @@ An atom.
191207#### Source
192208
193209```hoon
194− ++ cut
195− ~/ %cut
196− |= [a=bloq [b=@u c=@u] d=@]
197− (end a c (rsh a b d))
210+++ cut
211+ ~/ %cut
212+ |= [a=bloq [b=step c=step] d=@]
213+ (end [a c] (rsh [a b] d))
198214```
199215
200216#### Examples
201217
202218```
203− > (cut 0 [1 1] 2)
204− 1
205−
206− > (cut 0 [2 1] 4)
207− 1
208−
209− > `@t`(cut 3 [0 3] 'abcdefgh')
210− 'abc'
211−
212− > `@t`(cut 3 [1 3] 'abcdefgh') :: @t is the cord aura
213− 'bcd'
214−
215− > `@ub`(cut 0 [0 3] 0b1111.0000.1101) :: @ub is the binary aura
216− 0b101
217−
218− > `@ub`(cut 0 [0 6] 0b1111.0000.1101)
219− 0b1101
219+> (cut 0 [1 1] 2)
220+1
221+> (cut 0 [2 1] 4)
222+1
223+```
220224
221− > `@ub`(cut 0 [4 6] 0b1111.0000.1101)
222− 0b11.0000
225+```
226+> `@t`(cut 3 [0 3] 'abcdefgh') :: @t is the cord aura
227+'abc'
228+> `@t`(cut 3 [1 3] 'abcdefgh')
229+'bcd'
230+```
223231
224− > `@ub`(cut 0 [3 6] 0b1111.0000.1101)
225− 0b10.0001
232+```
233+> `@ub`(cut 0 [0 3] 0b1111.0000.1101) :: @ub is the binary aura
234+0b101
235+> `@ub`(cut 0 [0 6] 0b1111.0000.1101)
236+0b1101
237+> `@ub`(cut 0 [4 6] 0b1111.0000.1101)
238+0b11.0000
239+> `@ub`(cut 0 [3 6] 0b1111.0000.1101)
240+0b10.0001
226241```
227242
228243---
229244
230−### `++end`
245+## `++end`
231246
232247Tail
233248
@@ -235,8 +250,8 @@ Produces an atom by taking the last `step` blocks of size `bloq` from `b`.
235250
236251#### Accepts
237252
238−`a` is an atom slice specifier (see [`++bite`](/docs/hoon/reference/stdlib/1c#bite)),
239−which is a block size (see [`++bloq`](/docs/hoon/reference/stdlib/1c#bloq))
253+`a` is an atom slice specifier (see [`$bite`](/docs/hoon/reference/stdlib/1c#bite)),
254+which is a block size (see [`$bloq`](/docs/hoon/reference/stdlib/1c#bloq))
240255with optional block count.
241256
242257`b` is an atom.
@@ -248,56 +263,51 @@ An atom.
248263#### Source
249264
250265```hoon
251− ++ end
252− ~/ %end
253− |= [a=bite b=@]
254− =/ [=bloq =step] ?^(a a [a *step])
255− (mod b (bex (mul (bex bloq) step)))
266+++ end
267+ ~/ %end
268+ |= [a=bite b=@]
269+ =/ [=bloq =step] ?^(a a [a *step])
270+ (mod b (bex (mul (bex bloq) step)))
256271```
257272
258273#### Examples
259274
260275```
261− > (end [2 2] 255)
262− 255
263−
264− > (end [3 1] 255)
265− 255
266−
267− > (end 3 255)
268− 255
269−
270− > (end 3 256)
271− 0
272−
273− > `@ub`12 :: @ub is the binary aura
274− 0b1100
275−
276− > `@ub`(end [0 3] 12)
277− 0b100
278−
279− > (end [0 3] 12)
280− 4
281−
282− > `@ub`(end [1 3] 12)
283− 0b1100
284−
285− > (end [1 3] 12)
286− 12
287−
288− > `@ux`'abc' :: @ux is the hexademical aura
289− 0x63.6261
276+> (end [2 2] 255)
277+255
278+> (end [3 1] 255)
279+255
280+> (end 3 255)
281+255
282+> (end 3 256)
283+0
284+```
290285
291− > `@ux`(end [3 2] 'abc')
292− 0x6261
286+```
287+> `@ub`12 :: @ub is the binary aura
288+0b1100
289+> `@ub`(end [0 3] 12)
290+0b100
291+> (end [0 3] 12)
292+4
293+> `@ub`(end [1 3] 12)
294+0b1100
295+> (end [1 3] 12)
296+12
297+```
293298
294− > `@t`(end [3 2] 'abc') :: @t is the cord aura
295− 'ab'
299+```
300+> `@ux`'abc' :: @ux is the hexademical aura
301+0x63.6261
302+> `@ux`(end [3 2] 'abc')
303+0x6261
304+> `@t`(end [3 2] 'abc') :: @t is the cord aura
305+'ab'
296306```
297307
298308---
299309
300−### `++fil`
310+## `++fil`
301311
302312Fill bloqstream
303313
@@ -305,9 +315,9 @@ Produces an atom by repeating `c` for `b` blocks of size `a`.
305315
306316#### Accepts
307317
308−`a` is a block size (see [`++bloq`](/docs/hoon/reference/stdlib/1c)).
318+`a` is a block size (see [`$bloq`](/docs/hoon/reference/stdlib/1c#bloq)).
309319
310−`b` is an atom.
320+`b` is a [step](/docs/hoon/reference/stdlib/1c#step).
311321
312322`c` is an atom.
313323
@@ -318,38 +328,48 @@ An atom.
318328#### Source
319329
320330```hoon
321− ++ fil
322− |= [a=bloq b=@u c=@]
323− =+ n=0
324− =+ d=c
325− |- ^- @
326− ?: =(n b)
327− (rsh a 1 d)
328− $(d (add c (lsh a 1 d)), n +(n))
331+++ fil
332+ ~/ %fil
333+ |= [a=bloq b=step c=@]
334+ =| n=@ud
335+ =. c (end a c)
336+ =/ d c
337+ |- ^- @
338+ ?: =(n b)
339+ (rsh a d)
340+ $(d (add c (lsh a d)), n +(n))
329341```
330342
331343#### Examples
332344
333345```
334− > `@t`(fil 3 5 %a) :: @t is the cord (string) aura
335− 'aaaaa'
346+> `@t`(fil 3 5 %a) :: @t is the cord (string) aura
347+'aaaaa'
348+```
336349
337− > `@t`(fil 5 10 %ceeb)
338− 'ceebceebceebceebceebceebceebceebceebceeb'
350+```
351+> `@t`(fil 5 10 %ceeb)
352+'ceebceebceebceebceebceebceebceebceebceeb'
353+```
339354
340− > `@t`(fil 4 10 %eced)
341− 'ʇʇʇʇʇʇʇʇʇʇed'
355+```
356+> `@t`(fil 4 10 'eced')
357+'ecececececececececec'
358+```
342359
343− > `@tas`(fil 4 10 %bf) :: @tas is the term aura
344− %bfbfbfbfbfbfbfbfbfbf
360+```
361+> `@tas`(fil 4 10 %bf) :: @tas is the term aura
362+%bfbfbfbfbfbfbfbfbfbf
363+```
345364
346− > `@ub`(fil 2 6 1) :: @ub is the binary aura
347− 0b1.0001.0001.0001.0001.0001
365+```
366+> `@ub`(fil 2 6 1) :: @ub is the binary aura
367+0b1.0001.0001.0001.0001.0001
348368```
349369
350370---
351371
352−### `++lsh`
372+## `++lsh`
353373
354374Left-shift
355375
@@ -357,8 +377,8 @@ Produces an atom by left-shifting `b` by `step` blocks of size `bloq`.
357377
358378#### Accepts
359379
360−`a` is an atom slice specifier (see [`++bite`](/docs/hoon/reference/stdlib/1c#bite)),
361−which is a block size (see [`++bloq`](/docs/hoon/reference/stdlib/1c#bloq))
380+`a` is an atom slice specifier (see [`$bite`](/docs/hoon/reference/stdlib/1c#bite)),
381+which is a block size (see [`$bloq`](/docs/hoon/reference/stdlib/1c#bloq))
362382with optional block count.
363383
364384`b` is an atom.
@@ -370,41 +390,38 @@ An atom.
370390#### Source
371391
372392```hoon
373− ++ lsh
374− ~/ %lsh
375− |= [a=bite b=@]
376− =/ [=bloq =step] ?^(a a [a *step])
377− (mul b (bex (mul (bex bloq) step)))
393+++ lsh
394+ ~/ %lsh
395+ |= [a=bite b=@]
396+ =/ [=bloq =step] ?^(a a [a *step])
397+ (mul b (bex (mul (bex bloq) step)))
378398```
379399
380400#### Examples
381401
382402```
383− > `@ub`1 :: @ub is the binary aura
384− 0b1
385−
386− > `@ub`(lsh [0 1] 1)
387− 0b10
388−
389− > (lsh [0 1] 1)
390− 2
391−
392− > (lsh 0 1)
393− 2
394−
395− > `@ub`255
396− 0b1111.1111
397−
398− > `@ub`(lsh [3 1] 255)
399− 0b1111.1111.0000.0000
403+> `@ub`1 :: @ub is the binary aura
404+0b1
405+> `@ub`(lsh [0 1] 1)
406+0b10
407+> (lsh [0 1] 1)
408+2
409+> (lsh 0 1)
410+2
411+```
400412
401− > (lsh [3 1] 255)
402− 65.280
413+```
414+> `@ub`255
415+0b1111.1111
416+> `@ub`(lsh [3 1] 255)
417+0b1111.1111.0000.0000
418+> (lsh [3 1] 255)
419+65.280
403420```
404421
405422---
406423
407−### `++met`
424+## `++met`
408425
409426Measure
410427
@@ -412,45 +429,47 @@ Computes the number of blocks of size `a` in `b`, producing an atom.
412429
413430#### Accepts
414431
415−`a` is a block size (see [`++bloq`](/docs/hoon/reference/stdlib/1c)).
432+`a` is a block size (see [`$bloq`](/docs/hoon/reference/stdlib/1c/bloq)).
416433
417434`b` is an atom.
418435
419436#### Source
420437
421438```hoon
422− ++ met
423− ~/ %met
424− |= [a=bloq b=@]
425− ^- @
426− =+ c=0
427− |-
428− ?: =(0 b) c
429− $(b (rsh a 1 b), c +(c))
439+++ met
440+ ~/ %met
441+ |= [a=bloq b=@]
442+ ^- @
443+ =+ c=0
444+ |-
445+ ?: =(0 b) c
446+ $(b (rsh a b), c +(c))
430447```
431448
432449#### Examples
433450
434451```
435− > (met 0 1)
436− 1
437−
438− > (met 0 2)
439− 2
440−
441− > (met 3 255)
442− 1
452+> (met 0 1)
453+1
454+> (met 0 2)
455+2
456+```
443457
444− > (met 3 256)
445− 2
458+```
459+> (met 3 255)
460+1
461+> (met 3 256)
462+2
463+```
446464
447− > (met 3 'abcde')
448− 5
465+```
466+> (met 3 'abcde')
467+5
449468```
450469
451470---
452471
453−### `++rap`
472+## `++rap`
454473
455474Assemble non-zero
456475
@@ -469,41 +488,39 @@ An atom.
469488#### Source
470489
471490```hoon
472− ++ rap
473− ~/ %rap
474− |= [a=bloq b=(list @)]
475− ^- @
476− =+ ~
477− ?~ b 0
478− (cat a i.b $(b t.b))
491+++ rap
492+ ~/ %rap
493+ |= [a=bloq b=(list @)]
494+ ^- @
495+ ?~ b 0
496+ (cat a i.b $(b t.b))
479497```
480498
481499#### Examples
482500
483501```
484− > `@ub`(rap 2 [1 2 3 4 ~]) :: @ub is the binary aura
485− 0b100.0011.0010.0001
486−
487− > `@ub`(rap 1 [1 2 3 4 ~])
488− 0b1.0011.1001
489−
490− > (rap 0 [0 0 0 ~])
491− 0
492−
493− > (rap 0 [1 0 1 ~])
494− 3
495−
496− > `@ub`3
497− 0b11
498−
499− > (rap 0 [0 1 0 0 1 2 ~])
500− 11
502+> `@ub`(rap 2 [1 2 3 4 ~]) :: @ub is the binary aura
503+0b100.0011.0010.0001
504+> `@ub`(rap 1 [1 2 3 4 ~])
505+0b1.0011.1001
506+```
501507
502− > (rap 0 [1 1 2 ~])
503− 11
508+```
509+> (rap 0 [0 0 0 ~])
510+0
511+> (rap 0 [1 0 1 ~])
512+3
513+```
504514
505− > `@ub`11
506− 0b1011
515+```
516+> `@ub`3
517+0b11
518+> (rap 0 [0 1 0 0 1 2 ~])
519+11
520+> (rap 0 [1 1 2 ~])
521+11
522+> `@ub`11
523+0b1011
507524```
508525
509526#### Discussion
@@ -512,7 +529,7 @@ Any element of the value `0` is not included in concatenation.
512529
513530---
514531
515−### `++rep`
532+## `++rep`
516533
517534Assemble single
518535
@@ -533,63 +550,69 @@ An atom.
533550#### Source
534551
535552```hoon
536− ++ rep
537− ~/ %rep
538− |= [a=bite b=(list @)]
539− =/ [=bloq =step] ?^(a a [a *step])
540− =| i=@ud
541− |- ^- @
542− ?~ b 0
543− %+ add $(i +(i), b t.b)
544− (lsh [bloq (mul step i)] (end [bloq step] i.b))
553+++ rep
554+ ~/ %rep
555+ |= [a=bite b=(list @)]
556+ =/ [=bloq =step] ?^(a a [a *step])
557+ =| i=@ud
558+ |- ^- @
559+ ?~ b 0
560+ %+ add $(i +(i), b t.b)
561+ (lsh [bloq (mul step i)] (end [bloq step] i.b))
545562```
546563
547564#### Examples
548565
549566```
550− > `@ub`(rep 2 [1 2 3 4 ~]) :: @ub is the binary aura
551− 0b100.0011.0010.0001
552−
553− > (rep 0 [0 0 1 ~])
554− 4
555−
556− > (rep 0 [0 0 0 1 ~])
557− 8
558−
559− > `@ub`(rep 0 [0 0 0 1 ~])
560− 0b1000
561−
562− > `@ub`8
563− 0b1000
564−
565− > `@ub`(rep 0 [1 0 1 0 ~])
566− 0b101
567−
568− > `@ub`(rep 0 [1 2 3 4 ~])
569− 0b101
567+> `@ub`(rep 2 [1 2 3 4 ~]) :: @ub is the binary aura
568+0b100.0011.0010.0001
569+```
570570
571− > (rep 0 [0 1 0 1 ~])
572− 10
571+```
572+> (rep 0 [0 0 1 ~])
573+4
574+> (rep 0 [0 0 0 1 ~])
575+8
576+```
573577
574− > (rep 0 [1 0 1 0 1 ~])
575− 21
578+```
579+> `@ub`(rep 0 [0 0 0 1 ~])
580+0b1000
581+> `@ub`8
582+0b1000
583+```
576584
577− > `@ub`21
578− 0b10.1010
585+```
586+> `@ub`(rep 0 [1 0 1 0 ~])
587+0b101
588+> `@ub`(rep 0 [1 2 3 4 ~])
589+0b101
590+```
579591
580− > `@ub`(rep 3 [12 166 8 34 ~])
581− 0b10.0010.0000.1000.1010.0110.0000.1100
592+```
593+> (rep 0 [0 1 0 1 ~])
594+10
595+> (rep 0 [1 0 1 0 1 ~])
596+21
597+> `@ub`21
598+0b10.1010
599+```
582600
583− > `*`"abcd"
584− [97 98 99 100 0]
601+```
602+> `@ub`(rep 3 [12 166 8 34 ~])
603+0b10.0010.0000.1000.1010.0110.0000.1100
604+```
585605
586− > `@t`(rep 3 "abcd") :: @t is the text aura
587− 'abcd'
606+```
607+> `*`"abcd"
608+[97 98 99 100 0]
609+> `@t`(rep 3 "abcd") :: @t is the text aura
610+'abcd'
588611```
589612
590613---
591614
592−### `++rev`
615+## `++rev`
593616
594617Reverses block order, accounting for leading zeroes.
595618
@@ -630,35 +653,30 @@ An atom.
630653
631654```
632655> =a 0b1111.0000.1111.1010.0011
633−
634656> `@ub`(rev 0 20 a)
6356570b1100.0101.1111.0000.1111
636−
637658> `@ub`(rev 0 12 a)
6386590b1100.0101.1111
639−
640660> `@ub`(rev 2 5 a)
6416610b11.1010.1111.0000.1111
642−
643662> `@ub`(rev 2 4 a)
6446630b11.1010.1111.0000
645−
646664> `@ub`(rev 2 6 a)
6476650b11.1010.1111.0000.1111.0000
666+```
648667
668+```
649669> (rev 1 10 1.000)
650670179.200
651−
652671> (rev 2 5 1.000)
653672582.400
654−
655673> (rev 1 5 1.000)
656674175
657675```
658676
659677---
660678
661−### `++rip`
679+## `++rip`
662680
663681Disassemble
664682
@@ -679,51 +697,51 @@ A list of atoms.
679697#### Source
680698
681699```hoon
682− ++ rip
683− ~/ %rip
684− |= [a=bite b=@]
685− ^- (list @)
686− ?: =(0 b) ~
687− [(end a b) $(b (rsh a b))]
700+++ rip
701+ ~/ %rip
702+ |= [a=bite b=@]
703+ ^- (list @)
704+ ?: =(0 b) ~
705+ [(end a b) $(b (rsh a b))]
688706```
689707
690708#### Examples
691709
692710```
693− > `@ub`155 :: @ub is the binary aura
694− 0b1001.1011
695−
696− > (rip 0 155)
697− ~[1 1 0 1 1 0 0 1]
698−
699− > (rip 2 155)
700− ~[11 9]
701−
702− > (rip 0 11)
703− ~[1 1 0 1]
704−
705− > (rip 1 155)
706− ~[3 2 1 2]
707−
708− > `@ub`256
709− 0b1.0000.0000
710−
711− > (rip 0 256)
712− ~[0 0 0 0 0 0 0 0 1]
711+> `@ub`155 :: @ub is the binary aura
712+0b1001.1011
713+> (rip 0 155)
714+~[1 1 0 1 1 0 0 1]
715+> (rip 2 155)
716+~[11 9]
717+```
713718
714− > (rip 2 256)
715− ~[0 0 1]
719+```
720+> (rip 0 11)
721+~[1 1 0 1]
722+> (rip 1 155)
723+~[3 2 1 2]
724+```
716725
717− > (rip 3 256)
718− ~[0 1]
726+```
727+> `@ub`256
728+0b1.0000.0000
729+> (rip 0 256)
730+~[0 0 0 0 0 0 0 0 1]
731+> (rip 2 256)
732+~[0 0 1]
733+> (rip 3 256)
734+~[0 1]
735+```
719736
720− > `tape`(rip 3 'abcd')
721− "abcd"
737+```
738+> `tape`(rip 3 'abcd')
739+"abcd"
722740```
723741
724742---
725743
726−### `++rsh`
744+## `++rsh`
727745
728746Right-shift
729747
@@ -744,56 +762,51 @@ An atom.
744762#### Source
745763
746764```hoon
747− ++ rsh
748− ~/ %rsh
749− |= [a=bite b=@]
750− =/ [=bloq =step] ?^(a a [a *step])
751− (div b (bex (mul (bex bloq) step)))
765+++ rsh
766+ ~/ %rsh
767+ |= [a=bite b=@]
768+ =/ [=bloq =step] ?^(a a [a *step])
769+ (div b (bex (mul (bex bloq) step)))
752770```
753771
754772#### Examples
755773
756774```
757− > `@ub`145 :: @ub is the binary aura
758− 0b1001.0001
759−
760− > `@ub`(rsh [1 1] 145)
761− 0b10.0100
762−
763− > (rsh [1 1] 145)
764− 36
765−
766− > (rsh 1 145)
767− 36
768−
769− > `@ub`(rsh [2 1] 145)
770− 0b1001
771−
772− > (rsh [2 1] 145)
773− 9
774−
775− > `@ub`10
776− 0b1010
777−
778− > `@ub`(rsh [0 1] 10)
779− 0b101
780−
781− > (rsh [0 1] 10)
782− 5
783−
784− > `@ux`'abc'
785− 0x63.6261
775+> `@ub`145 :: @ub is the binary aura
776+0b1001.0001
777+> `@ub`(rsh [1 1] 145)
778+0b10.0100
779+> (rsh [1 1] 145)
780+36
781+> (rsh 1 145)
782+36
783+> `@ub`(rsh [2 1] 145)
784+0b1001
785+> (rsh [2 1] 145)
786+9
787+```
786788
787− > `@t`(rsh [3 1] 'abc')
788− 'bc'
789+```
790+> `@ub`10
791+0b1010
792+> `@ub`(rsh [0 1] 10)
793+0b101
794+> (rsh [0 1] 10)
795+5
796+```
789797
790− > `@ux`(rsh [3 1] 'abc')
791− 0x6362
798+```
799+> `@ux`'abc'
800+0x63.6261
801+> `@t`(rsh [3 1] 'abc')
802+'bc'
803+> `@ux`(rsh [3 1] 'abc')
804+0x6362
792805```
793806
794807---
795808
796−### `++run`
809+## `++run`
797810
798811`++turn` into atom.
799812
@@ -817,25 +830,24 @@ An atom.
817830#### Source
818831
819832```hoon
820− ++ run
821− ~/ %run
822− |= [a=bite b=@ c=$-(@ @)]
823− (rep a (turn (rip a b) c))
833+++ run
834+ ~/ %run
835+ |= [a=bite b=@ c=$-(@ @)]
836+ (rep a (turn (rip a b) c))
824837```
825838
826839#### Examples
827840
828841```
829− > `@ux`65.535 :: @ux is the hexadecimal aura
842+ > `@ux`65.535 :: @ux is the hexadecimal aura
830843 0xffff
831−
832− > `@ux`(run 2 65.535 dec) :: dec is the decrement gate
844+ > `@ux`(run 2 65.535 dec) :: dec is the decrement gate
833845 0xeeee
834846```
835847
836848---
837849
838−### `++rut`
850+## `++rut`
839851
840852`++turn` into list.
841853
@@ -859,25 +871,80 @@ A list.
859871#### Source
860872
861873```hoon
862− ++ rut
863− ~/ %rut
864− |* [a=bite b=@ c=$-(@ *)]
865− (turn (rip a b) c)
874+++ rut
875+ ~/ %rut
876+ |* [a=bite b=@ c=$-(@ *)]
877+ (turn (rip a b) c)
866878```
867879
868880#### Examples
869881
870882```
871− > `@ux`65.535 :: @ux is the hexadecimal aura
872− 0xffff
883+> `@ux`65.535 :: @ux is the hexadecimal aura
884+0xffff
885+> `(list @ux)`(rut 2 65.535 dec) :: dec is the decrement gate
886+~[0xe 0xe 0xe 0xe]
887+```
888+
889+---
890+
891+## `++sew`
892+
893+Stitch one atom into another
894+
895+Replace `c` blocks of size `a` at offset `b` of atom `e` with `c` blocks of size `a` from atom `d`.
896+
897+That is, take `(end [a c] d)` from `d` and overwrite the `(cut a [b c] e)` part of `e`.
898+
899+Or in simpler terms, take from the start of `d` and replace some part of `e` with it.
900+
901+#### Accepts
873902
874− > `(list @ux)`(rut 2 65.535 dec) :: dec is the decrement gate
875− ~[0xe 0xe 0xe 0xe]
903+`a` is a [$bloq](/docs/hoon/reference/stdlib/1c#bite) (block size).
904+
905+`[b c d]` where:
906+
907+- `b` is a [step](/docs/hoon/reference/stdlib/1c#step) specifying the number of `bloq`s to offset.
908+- `b` is a [step](/docs/hoon/reference/stdlib/1c#step) specifying the number of `bloq`s to replace.
909+- `d` is the donor atom.
910+
911+`e` is the recipient atom.
912+
913+#### Produces
914+
915+An atom.
916+
917+#### Source
918+
919+```hoon
920+++ sew
921+ ~/ %sew
922+ |= [a=bloq [b=step c=step d=@] e=@]
923+ ^- @
924+ %+ add
925+ (can a b^e c^d ~)
926+ =/ f [a (add b c)]
927+ (lsh f (rsh f e))
928+```
929+
930+#### Examples
931+
932+```
933+> `@t`(sew 3 [0 0 'XXXX'] 'OOOO')
934+'OOOO'
935+> `@t`(sew 3 [0 1 'XXXX'] 'OOOO')
936+'XOOO'
937+> `@t`(sew 3 [2 1 'XXXX'] 'OOOO')
938+'OOXO'
939+> `@t`(sew 3 [2 2 'XXXX'] 'OOOO')
940+'OOXX'
941+> `@t`(sew 3 [0 4 'XXXX'] 'OOOO')
942+'XXXX'
876943```
877944
878945---
879946
880−### `++swp`
947+## `++swp`
881948
882949Reverse block order
883950
@@ -886,7 +953,7 @@ reversing the block order of `b` using block size `a`.
886953
887954#### Accepts
888955
889−`a` is a block size (see [`++bloq`](/docs/hoon/reference/stdlib/1c)).
956+`a` is a block size (see [`$bloq`](/docs/hoon/reference/stdlib/1c#bloq)).
890957
891958`b` is an atom.
892959
@@ -897,31 +964,33 @@ An atom
897964#### Source
898965
899966```hoon
900− ++ swp |=([a=bloq b=@] (rep a (flop (rip a b))))
967+++ swp
968+ ~/ %swp
969+ |= [a=bloq b=@]
970+ (rep a (flop (rip a b)))
901971```
902972
903973#### Examples
904974
905975```
906− > `@ub`24 :: @ub is the binary aura
907− 0b1.1000
908−
909− > (swp 0 24)
910− 3
911−
912− > `@ub`3
913− 0b11
914−
915− > (swp 0 0)
916− 0
976+> `@ub`24 :: @ub is the binary aura
977+0b1.1000
978+> (swp 0 24)
979+3
980+> `@ub`3
981+0b11
982+```
917983
918− > (swp 0 128)
919− 1
984+```
985+> (swp 0 0)
986+0
987+> (swp 0 128)
988+1
920989```
921990
922991---
923992
924−### `++xeb`
993+## `++xeb`
925994
926995Binary logarithm
927996
@@ -938,38 +1007,48 @@ An atom.
9381007#### Source
9391008
9401009```hoon
941− ++ xeb
942− ~/ %xeb
943− |= a=@
944− ^- @
945− (met 0 a)
1010+++ xeb
1011+ ~/ %xeb
1012+ |= a=@
1013+ ^- @
1014+ (met 0 a)
9461015```
9471016
9481017#### Examples
9491018
9501019```
951− > (xeb 31)
952− 5
1020+> (xeb 31)
1021+5
1022+```
9531023
954− > (xeb 32)
955− 6
1024+```
1025+> (xeb 32)
1026+6
1027+```
9561028
957− > (xeb 49)
958− 6
1029+```
1030+> (xeb 49)
1031+6
1032+```
9591033
960− > (xeb 0)
961− 0
1034+```
1035+> (xeb 0)
1036+0
1037+```
9621038
963− > (xeb 1)
964− 1
1039+```
1040+> (xeb 1)
1041+1
1042+```
9651043
966− > (xeb 2)
967− 2
1044+```
1045+> (xeb 2)
1046+2
9681047```
9691048
9701049---
9711050
972−### `++fe`
1051+## `++fe`
9731052
9741053Modulo bloq
9751054
@@ -994,7 +1073,7 @@ representation.
9941073
9951074#### Accepts
9961075
997−`a` is a `bloq`.
1076+`a` is a `bloq` (and is the sample of the parent core).
9981077
9991078`b` is an atom.
10001079
@@ -1002,40 +1081,40 @@ representation.
10021081
10031082#### Produces
10041083
1005−A `@s`
1084+A `@s`.
10061085
10071086#### Source
10081087
10091088```hoon
1010− ++ dif |=([b=@ c=@] (sit (sub (add out (sit b)) (sit c))))
1089+ ++ dif
1090+ |=([b=@ c=@] (sit (sub (add out (sit b)) (sit c))))
10111091```
10121092
10131093#### Examples
10141094
10151095```
1016− > (~(dif fe 3) 63 64)
1017− 255
1018−
1019− > (~(dif fe 3) 5 10)
1020− 251
1021−
1022− > (~(dif fe 3) 0 1)
1023− 255
1024−
1025− > (~(dif fe 0) 9 10)
1026− 1
1027−
1028− > (~(dif fe 0) 9 11)
1029− 0
1030−
1031− > (~(dif fe 0) 9 12)
1032− 1
1096+> (~(dif fe 3) 63 64)
1097+255
1098+> (~(dif fe 3) 5 10)
1099+251
1100+> (~(dif fe 3) 0 1)
1101+255
1102+```
10331103
1034− > (~(dif fe 2) 9 12)
1035− 13
1104+```
1105+> (~(dif fe 0) 9 10)
1106+1
1107+> (~(dif fe 0) 9 11)
1108+0
1109+> (~(dif fe 0) 9 12)
1110+1
1111+```
10361112
1037− > (~(dif fe 2) 63 64)
1038− 15
1113+```
1114+> (~(dif fe 2) 9 12)
1115+13
1116+> (~(dif fe 2) 63 64)
1117+15
10391118```
10401119
10411120---
@@ -1048,7 +1127,9 @@ Inverts the order of the modular field.
10481127
10491128#### Accepts
10501129
1051−`b` is a `bloq`. (see [`++bloq`](/docs/hoon/reference/stdlib/1c))
1130+`a` is a `bloq` (and is the sample of the parent core).
1131+
1132+`b` is a `bloq`. (see [`$bloq`](/docs/hoon/reference/stdlib/1c#bloq))
10521133
10531134#### Produces
10541135
@@ -1057,29 +1138,30 @@ An atom.
10571138#### Source
10581139
10591140```hoon
1060− ++ inv |=(b=@ (sub (dec out) (sit b)))
1141+++ inv |=(b=@ (sub (dec out) (sit b)))
10611142```
10621143
10631144#### Examples
10641145
10651146```
1066− > (~(inv fe 3) 255)
1067− 0
1068−
1069− > (~(inv fe 3) 256)
1070− 255
1071−
1072− > (~(inv fe 3) 0)
1073− 255
1074−
1075− > (~(inv fe 3) 1)
1076− 254
1147+> (~(inv fe 3) 255)
1148+0
1149+> (~(inv fe 3) 256)
1150+255
1151+```
10771152
1078− > (~(inv fe 3) 2)
1079− 253
1153+```
1154+> (~(inv fe 3) 0)
1155+255
1156+> (~(inv fe 3) 1)
1157+254
1158+> (~(inv fe 3) 2)
1159+253
1160+```
10801161
1081− > (~(inv fe 3) 55)
1082− 200
1162+```
1163+> (~(inv fe 3) 55)
1164+200
10831165```
10841166
10851167---
@@ -1092,7 +1174,9 @@ Reverses bytes within a block.
10921174
10931175#### Accepts
10941176
1095−`b` is a `bloq`. (see [`++bloq`](/docs/hoon/reference/stdlib/1c))
1177+`a` is a `bloq` (and the sample of the parent core).
1178+
1179+`b` is a `bloq`. (see [`$bloq`](/docs/hoon/reference/stdlib/1c#bloq))
10961180
10971181#### Produces
10981182
@@ -1101,75 +1185,66 @@ An atom.
11011185#### Source
11021186
11031187```hoon
1104− ++ net |= b=@ ^- @
1105− => .(b (sit b))
1106− ?: (lte a 3)
1107− b
1108− =+ c=(dec a)
1109− %+ con
1110− (lsh c 1 $(a c, b (cut c [0 1] b)))
1111− $(a c, b (cut c [1 1] b))
1188+++ net |= b=@ ^- @
1189+ => .(b (sit b))
1190+ ?: (lte a 3)
1191+ b
1192+ =+ c=(dec a)
1193+ %+ con
1194+ (lsh c $(a c, b (cut c [0 1] b)))
1195+ $(a c, b (cut c [1 1] b))
11121196```
11131197
11141198#### Examples
11151199
11161200```
1117− > (~(net fe 3) 64)
1118− 64
1119−
1120− > (~(net fe 3) 128)
1121− 128
1122−
1123− > (~(net fe 3) 255)
1124− 255
1125−
1126− > (~(net fe 3) 256)
1127− 0
1128−
1129− > (~(net fe 3) 257)
1130− 1
1131−
1132− > (~(net fe 3) 500)
1133− 244
1134−
1135− > (~(net fe 3) 511)
1136− 255
1137−
1138− > (~(net fe 3) 512)
1139− 0
1140−
1141− > (~(net fe 3) 513)
1142− 1
1143−
1144− > (~(net fe 3) 0)
1145− 0
1146−
1147− > (~(net fe 3) 1)
1148− 1
1149−
1150− > (~(net fe 0) 1)
1151− 1
1152−
1153− > (~(net fe 0) 2)
1154− 0
1155−
1156− > (~(net fe 0) 3)
1157− 1
1158−
1159− > (~(net fe 6) 1)
1160− 72.057.594.037.927.936
1161−
1162− > (~(net fe 6) 2)
1163− 144.115.188.075.855.872
1201+> (~(net fe 3) 64)
1202+64
1203+> (~(net fe 3) 128)
1204+128
1205+> (~(net fe 3) 255)
1206+255
1207+> (~(net fe 3) 256)
1208+0
1209+> (~(net fe 3) 257)
1210+1
1211+```
11641212
1165− > (~(net fe 6) 3)
1166− 216.172.782.113.783.808
1213+```
1214+> (~(net fe 3) 500)
1215+244
1216+> (~(net fe 3) 511)
1217+255
1218+> (~(net fe 3) 512)
1219+0
1220+> (~(net fe 3) 513)
1221+1
1222+```
11671223
1168− > (~(net fe 6) 4)
1169− 288.230.376.151.711.744
1224+```
1225+> (~(net fe 3) 0)
1226+0
1227+> (~(net fe 3) 1)
1228+1
1229+> (~(net fe 0) 1)
1230+1
1231+> (~(net fe 0) 2)
1232+0
1233+> (~(net fe 0) 3)
1234+1
1235+```
11701236
1171− > (~(net fe 6) 5)
1172− 360.287.970.189.639.680
1237+```
1238+> (~(net fe 6) 1)
1239+72.057.594.037.927.936
1240+> (~(net fe 6) 2)
1241+144.115.188.075.855.872
1242+> (~(net fe 6) 3)
1243+216.172.782.113.783.808
1244+> (~(net fe 6) 4)
1245+288.230.376.151.711.744
1246+> (~(net fe 6) 5)
1247+360.287.970.189.639.680
11731248```
11741249
11751250---
@@ -1182,7 +1257,7 @@ Produces the maximum integer value that the current block can store; `2^a^a`.
11821257
11831258#### Accepts
11841259
1185−`a` is a `bloq`.
1260+`a` is a `bloq` (and is the sample of the parent core).
11861261
11871262#### Produces
11881263
@@ -1191,35 +1266,33 @@ An atom.
11911266#### Source
11921267
11931268```hoon
1194− ++ out (bex (bex a))
1269+++ out (bex (bex a))
11951270```
11961271
11971272#### Examples
11981273
11991274```
1200− > ~(out fe 0)
1201− 2
1202−
1203− > ~(out fe 1)
1204− 4
1205−
1206− > ~(out fe 2)
1207− 16
1208−
1209− > ~(out fe 3)
1210− 256
1211−
1212− > ~(out fe 4)
1213− 65.536
1275+> ~(out fe 0)
1276+2
1277+> ~(out fe 1)
1278+4
1279+> ~(out fe 2)
1280+16
1281+> ~(out fe 3)
1282+256
1283+> ~(out fe 4)
1284+65.536
1285+```
12141286
1215− > ~(out fe 10)
1216− \/179.769.313.486.231.590.772.930.519.078.902.473.361.797.697.894.230.657.273\/
1217− .430.081.157.732.675.805.500.963.132.708.477.322.407.536.021.120.113.879.87
1218− 1.393.357.658.789.768.814.416.622.492.847.430.639.474.124.377.767.893.424.8
1219− 65.485.276.302.219.601.246.094.119.453.082.952.085.005.768.838.150.682.342.
1220− 462.881.473.913.110.540.827.237.163.350.510.684.586.298.239.947.245.938.479
1221− .716.304.835.356.329.624.224.137.216
1222− \/ \/
1287+```
1288+> ~(out fe 10)
1289+\/179.769.313.486.231.590.772.930.519.078.902.473.361.797.697.894.230.657.273\/
1290+ .430.081.157.732.675.805.500.963.132.708.477.322.407.536.021.120.113.879.87
1291+ 1.393.357.658.789.768.814.416.622.492.847.430.639.474.124.377.767.893.424.8
1292+ 65.485.276.302.219.601.246.094.119.453.082.952.085.005.768.838.150.682.342.
1293+ 462.881.473.913.110.540.827.237.163.350.510.684.586.298.239.947.245.938.479
1294+ .716.304.835.356.329.624.224.137.216
1295+\/ \/
12231296```
12241297
12251298---
@@ -1232,7 +1305,7 @@ Rolls `d` to the left by `c` `b`-sized blocks.
12321305
12331306#### Accepts
12341307
1235−`a` is a `bloq`.
1308+`a` is a `bloq` (and is the sample of the parent core).
12361309
12371310`b` is a `bloq`.
12381311
@@ -1247,30 +1320,32 @@ An atom.
12471320#### Source
12481321
12491322```hoon
1250− ++ rol |= [b=bloq c=@ d=@] ^- @
1251− =+ e=(sit d)
1252− =+ f=(bex (sub a b))
1253− =+ g=(mod c f)
1254− (sit (con (lsh b g e) (rsh b (sub f g) e)))
1323+++ rol |= [b=bloq c=@ d=@] ^- @
1324+ =+ e=(sit d)
1325+ =+ f=(bex (sub a b))
1326+ =+ g=(mod c f)
1327+ (sit (con (lsh [b g] e) (rsh [b (sub f g)] e)))
12551328```
12561329
12571330#### Examples
12581331
12591332```
1260− > `@ux`(~(rol fe 6) 4 3 0xabac.dedf.1213)
1261− 0x1213.0000.abac.dedf
1333+> `@ux`(~(rol fe 6) 4 3 0xabac.dedf.1213)
1334+0x1213.0000.abac.dedf
12621335
1263− > `@ux`(~(rol fe 6) 4 2 0xabac.dedf.1213)
1264− 0xdedf.1213.0000.abac
1336+> `@ux`(~(rol fe 6) 4 2 0xabac.dedf.1213)
1337+0xdedf.1213.0000.abac
1338+```
12651339
1266− > `@t`(~(rol fe 5) 3 1 'dfgh')
1267− 'hdfg'
1340+```
1341+> `@t`(~(rol fe 5) 3 1 'dfgh')
1342+'hdfg'
12681343
1269− > `@t`(~(rol fe 5) 3 2 'dfgh')
1270− 'ghdf'
1344+> `@t`(~(rol fe 5) 3 2 'dfgh')
1345+'ghdf'
12711346
1272− > `@t`(~(rol fe 5) 3 0 'dfgh')
1273− 'dfgh'
1347+> `@t`(~(rol fe 5) 3 0 'dfgh')
1348+'dfgh'
12741349```
12751350
12761351---
@@ -1283,7 +1358,7 @@ Rolls `d` to the right by `c` `b`-sized blocks.
12831358
12841359#### Accepts
12851360
1286−`a` is a `bloq`.
1361+`a` is a `bloq` (and is the sample of the parent core).
12871362
12881363`b` is a `bloq`.
12891364
@@ -1298,49 +1373,53 @@ An atom.
12981373#### Source
12991374
13001375```hoon
1301− ++ ror |= [b=bloq c=@ d=@] ^- @
1302− =+ e=(sit d)
1303− =+ f=(bex (sub a b))
1304− =+ g=(mod c f)
1305− (sit (con (rsh b g e) (lsh b (sub f g) e)))
1376+++ ror |= [b=bloq c=@ d=@] ^- @
1377+ =+ e=(sit d)
1378+ =+ f=(bex (sub a b))
1379+ =+ g=(mod c f)
1380+ (sit (con (rsh [b g] e) (lsh [b (sub f g)] e)))
13061381```
13071382
13081383#### Examples
13091384
13101385```
1311− > `@ux`(~(ror fe 6) 4 1 0xabac.dedf.1213)
1312− 0x1213.0000.abac.dedf
1386+> `@ux`(~(ror fe 6) 4 1 0xabac.dedf.1213)
1387+0x1213.0000.abac.dedf
13131388
1314− > `@ux`(~(ror fe 6) 3 5 0xabac.dedf.1213)
1315− 0xacde.df12.1300.00ab
1389+> `@ux`(~(ror fe 6) 3 5 0xabac.dedf.1213)
1390+0xacde.df12.1300.00ab
13161391
1317− > `@ux`(~(ror fe 6) 3 3 0xabac.dedf.1213)
1318− 0xdf12.1300.00ab.acde
1392+> `@ux`(~(ror fe 6) 3 3 0xabac.dedf.1213)
1393+0xdf12.1300.00ab.acde
1394+```
13191395
1320− > `@t`(~(rol fe 5) 3 0 'hijk')
1321− 'hijk'
1396+```
1397+> `@t`(~(rol fe 5) 3 0 'hijk')
1398+'hijk'
13221399
1323− > `@t`(~(rol fe 5) 3 1 'hijk')
1324− 'khij'
1400+> `@t`(~(rol fe 5) 3 1 'hijk')
1401+'khij'
13251402
1326− > `@t`(~(rol fe 5) 3 2 'hijk')
1327− 'jkhi'
1403+> `@t`(~(rol fe 5) 3 2 'hijk')
1404+'jkhi'
13281405```
13291406
13301407---
13311408
1332−### `++sit:fe`
1409+### `++sum:fe`
13331410
1334−Enforce modulo
1411+Sum
13351412
1336−Produces an atom in the current modular block representation.
1413+Sums two numbers in this modular field.
13371414
13381415#### Accepts
13391416
1340−`a` is a `bloq`.
1417+`a` is a `bloq` (and is the sample of the parent core).
13411418
13421419`b` is an atom.
13431420
1421+`c` is an atom.
1422+
13441423#### Produces
13451424
13461425An atom.
@@ -1348,62 +1427,51 @@ An atom.
13481427#### Source
13491428
13501429```hoon
1351− ++ sit |=(b=@ (end a 1 b))
1430+++ sum |=([b=@ c=@] (sit (add b c)))
13521431```
13531432
13541433#### Examples
13551434
13561435```
1357− > (~(sit fe 3) 255)
1358− 255
1359−
1360− > (~(sit fe 3) 256)
1361− 0
1362−
1363− > (~(sit fe 3) 257)
1364− 1
1365−
1366− > (~(sit fe 2) 257)
1367− 1
1368−
1369− > (~(sit fe 2) 10.000)
1370− 0
1371−
1372− > (~(sit fe 2) 100)
1373− 4
1374−
1375− > (~(sit fe 2) 19)
1376− 3
1377−
1378− > (~(sit fe 2) 17)
1379− 1
1436+> (~(sum fe 3) 10 250)
1437+4
1438+```
13801439
1381− > (~(sit fe 0) 17)
1382− 1
1440+```
1441+> (~(sum fe 0) 0 1)
1442+1
1443+> (~(sum fe 0) 0 2)
1444+0
1445+```
13831446
1384− > (~(sit fe 0) 0)
1385− 0
1447+```
1448+> (~(sum fe 2) 14 2)
1449+0
1450+> (~(sum fe 2) 14 3)
1451+1
1452+```
13861453
1387− > (~(sit fe 0) 1)
1388− 1
1454+```
1455+> (~(sum fe 4) 10.000 256)
1456+10.256
1457+> (~(sum fe 4) 10.000 100.000)
1458+44.464
13891459```
13901460
13911461---
13921462
1393−### `++sum:fe`
1463+### `++sit:fe`
13941464
1395−Sum
1465+Enforce modulo
13961466
1397−Sums two numbers in this modular field.
1467+Produces an atom in the current modular block representation.
13981468
13991469#### Accepts
14001470
1401−`a` is a `bloq`.
1471+`a` is a `bloq` (and is the sample of the parent core).
14021472
14031473`b` is an atom.
14041474
1405−`c` is an atom.
1406−
14071475#### Produces
14081476
14091477An atom.
@@ -1411,32 +1479,40 @@ An atom.
14111479#### Source
14121480
14131481```hoon
1414− ++ sum |=([b=@ c=@] (sit (add b c)))
1482+++ sit |=(b=@ (end a b))
14151483```
14161484
14171485#### Examples
14181486
14191487```
1420− > (~(sum fe 3) 10 250)
1421− 4
1422−
1423− > (~(sum fe 0) 0 1)
1424− 1
1425−
1426− > (~(sum fe 0) 0 2)
1427− 0
1428−
1429− > (~(sum fe 2) 14 2)
1430− 0
1431−
1432− > (~(sum fe 2) 14 3)
1433− 1
1488+> (~(sit fe 3) 255)
1489+255
1490+> (~(sit fe 3) 256)
1491+0
1492+> (~(sit fe 3) 257)
1493+1
1494+```
14341495
1435− > (~(sum fe 4) 10.000 256)
1436− 10.256
1496+```
1497+> (~(sit fe 2) 257)
1498+1
1499+> (~(sit fe 2) 10.000)
1500+0
1501+> (~(sit fe 2) 100)
1502+4
1503+> (~(sit fe 2) 19)
1504+3
1505+> (~(sit fe 2) 17)
1506+1
1507+```
14371508
1438− > (~(sum fe 4) 10.000 100.000)
1439− 44.464
1509+```
1510+> (~(sit fe 0) 17)
1511+1
1512+> (~(sit fe 0) 0)
1513+0
1514+> (~(sit fe 0) 1)
1515+1
14401516```
14411517
14421518---
content/docs/hoon/reference/stdlib/table-of-contents.md+7
@@ -44,6 +44,7 @@ Can be navigated [alphabetically](#alphabetical) or [by section](#by-section).
4444
4545### b
4646
47+<a class="tooltip" href='/docs/hoon/reference/stdlib/2b/#bake' title="Convert wet gate to dry gate"><code>++bake</code></a>
4748<a class="tooltip" href='/docs/hoon/reference/stdlib/2k/#balto' title="Balance queue"><code>++bal:to</code></a>
4849<a class="tooltip" href='/docs/hoon/reference/stdlib/4h/#bar' title="Parse | (bar)"><code>++bar</code></a>
4950<a class="tooltip" href='/docs/hoon/reference/stdlib/4h/#bas' title="Parse \ (bas)"><code>++bas</code></a>
@@ -498,6 +499,7 @@ Can be navigated [alphabetically](#alphabetical) or [by section](#by-section).
498499<a class="tooltip" href='/docs/hoon/reference/stdlib/3d/#rawog' title="Random bits"><code>++raw:og</code></a>
499500<a class="tooltip" href='/docs/hoon/reference/stdlib/3d/#rawsog' title="Random bits continuation"><code>++raws:og</code></a>
500501<a class="tooltip" href='/docs/hoon/reference/stdlib/4c/#re' title="Prettyprinting engine (tank)"><code>++re</code></a>
502+<a class="tooltip" href='/docs/hoon/reference/stdlib/2b/#rear' title="Last item in list"><code>++rear</code></a>
501503<a class="tooltip" href='/docs/hoon/reference/stdlib/4k/#rearco' title="Prepend and render atom as tape"><code>++rear:co</code></a>
502504<a class="tooltip" href='/docs/hoon/reference/stdlib/2b/#reap' title="Replicate (list)"><code>++reap</code></a>
503505<a class="tooltip" href='/docs/hoon/reference/stdlib/2b/#reel' title="Right fold (list)"><code>++reel</code></a>
@@ -570,6 +572,7 @@ Can be navigated [alphabetically](#alphabetical) or [by section](#by-section).
570572<a class="tooltip" href='/docs/hoon/reference/stdlib/4h/#ser' title="Parse ] (ser)"><code>++ser</code></a>
571573<a class="tooltip" href='/docs/hoon/reference/stdlib/2o/#set' title="Mold generator (set)"><code>++set</code></a>
572574<a class="tooltip" href='/docs/hoon/reference/stdlib/4j/#sevab' title="Parse nonzero base 32 digit"><code>++sev:ab</code></a>
575+<a class="tooltip" href='/docs/hoon/reference/stdlib/2c/#sew' title="Stitch one atom into another"><code>++sew</code></a>
573576<a class="tooltip" href='/docs/hoon/reference/stdlib/4j/#sewab' title="Parse nonzero base 64 digit"><code>++sew:ab</code></a>
574577<a class="tooltip" href='/docs/hoon/reference/stdlib/4j/#sexab' title="Parse nonzero hexadecimal digit"><code>++sex:ab</code></a>
575578<a class="tooltip" href='/docs/hoon/reference/stdlib/4e/#sfix' title="Discard second rule"><code>++sfix</code></a>
@@ -618,6 +621,7 @@ Can be navigated [alphabetically](#alphabetical) or [by section](#by-section).
618621<a class="tooltip" href='/docs/hoon/reference/stdlib/4m/#smyt' title="Render path as tank"><code>++smyt</code></a>
619622<a class="tooltip" href='/docs/hoon/reference/stdlib/2b/#snag' title="Produce element at specific index (list)"><code>++snag</code></a>
620623<a class="tooltip" href='/docs/hoon/reference/stdlib/2m/#snagnl' title="Produce element from list at specific nullterminated noun"><code>++snag:nl</code></a>
624+<a class="tooltip" href='/docs/hoon/reference/stdlib/2b/#snip' title="Drop tail off list"><code>++snip</code></a>
621625<a class="tooltip" href='/docs/hoon/reference/stdlib/2b/#snoc' title="Append noun to list"><code>++snoc</code></a>
622626<a class="tooltip" href='/docs/hoon/reference/stdlib/4l/#so' title="Coin parser engine"><code>++so</code></a>
623627<a class="tooltip" href='/docs/hoon/reference/stdlib/2n/#soft' title="Maybe remold"><code>++soft</code></a>
@@ -873,6 +877,7 @@ Can be navigated [alphabetically](#alphabetical) or [by section](#by-section).
873877
874878### 2b: list logic
875879
880+<a class="tooltip" href='/docs/hoon/reference/stdlib/2b/#bake' title="Convert wet gate to dry gate"><code>++bake</code></a>
876881<a class="tooltip" href='/docs/hoon/reference/stdlib/2b/#fand' title="All indices in list"><code>++fand</code></a>
877882<a class="tooltip" href='/docs/hoon/reference/stdlib/2b/#find' title="First index in list"><code>++find</code></a>
878883<a class="tooltip" href='/docs/hoon/reference/stdlib/2b/#flop' title="Reverse list"><code>++flop</code></a>
@@ -894,6 +899,7 @@ Can be navigated [alphabetically](#alphabetical) or [by section](#by-section).
894899<a class="tooltip" href='/docs/hoon/reference/stdlib/2b/#skip' title="Produce list of elements failing boolean gate"><code>++skip</code></a>
895900<a class="tooltip" href='/docs/hoon/reference/stdlib/2b/#slag' title="Produce all elements from index in list"><code>++slag</code></a>
896901<a class="tooltip" href='/docs/hoon/reference/stdlib/2b/#snag' title="Produce element at specific index (list)"><code>++snag</code></a>
902+<a class="tooltip" href='/docs/hoon/reference/stdlib/2b/#snip' title="Drop tail off list"><code>++snip</code></a>
897903<a class="tooltip" href='/docs/hoon/reference/stdlib/2b/#snoc' title="Append noun to list"><code>++snoc</code></a>
898904<a class="tooltip" href='/docs/hoon/reference/stdlib/2b/#sort' title="Quicksort (list)"><code>++sort</code></a>
899905<a class="tooltip" href='/docs/hoon/reference/stdlib/2b/#spin' title="Gate to list (with state)"><code>++spin</code></a>
@@ -929,6 +935,7 @@ Can be navigated [alphabetically](#alphabetical) or [by section](#by-section).
929935<a class="tooltip" href='/docs/hoon/reference/stdlib/2c/#rip' title="Disassemble"><code>++rip</code></a>
930936<a class="tooltip" href='/docs/hoon/reference/stdlib/2c/#rev' title="Reverse"><code>++rev</code></a>
931937<a class="tooltip" href='/docs/hoon/reference/stdlib/2c/#rsh' title="Rightshift"><code>++rsh</code></a>
938+<a class="tooltip" href='/docs/hoon/reference/stdlib/2c/#sew' title="Stitch one atom into another"><code>++sew</code></a>
932939<a class="tooltip" href='/docs/hoon/reference/stdlib/2c/#swp' title="Reverse block order"><code>++swp</code></a>
933940<a class="tooltip" href='/docs/hoon/reference/stdlib/2c/#xeb' title="Binary logarithm"><code>++xeb</code></a>
934941
lib/glossary.js+28
@@ -1577,6 +1577,13 @@ export const glossary = [
15771577 slug: "https://urbit.org/docs/reference/library/4o/#axis",
15781578 desc: "Used in the Hoon standard library.",
15791579 },
1580+ {
1581+ name: "Convert wet gate to dry gate",
1582+ symbol: "bake",
1583+ usage: "stdlib",
1584+ slug: "https://urbit.org/docs/reference/library/2b/#bake",
1585+ desc: "Used in the Hoon standard library.",
1586+ },
15801587 {
15811588 name: "Balance queue",
15821589 symbol: "bal:to",
@@ -4433,6 +4440,13 @@ export const glossary = [
44334440 slug: "https://urbit.org/docs/reference/library/4c/#re",
44344441 desc: "Used in the Hoon standard library.",
44354442 },
4443+ {
4444+ name: "Last item in list",
4445+ symbol: "rear",
4446+ usage: "stdlib",
4447+ slug: "https://urbit.org/docs/reference/library/2b/#rear",
4448+ desc: "Used in the Hoon standard library.",
4449+ },
44364450 {
44374451 name: "Prepend and render atom as tape",
44384452 symbol: "rear:co",
@@ -4902,6 +4916,13 @@ export const glossary = [
49024916 slug: "https://urbit.org/docs/reference/library/4j/#sev-ab",
49034917 desc: "Used in the Hoon standard library.",
49044918 },
4919+ {
4920+ name: "Stitch one atom into another",
4921+ symbol: "sew",
4922+ usage: "stdlib",
4923+ slug: "https://urbit.org/docs/reference/library/2c/#sew",
4924+ desc: "Used in the Hoon standard library.",
4925+ },
49054926 {
49064927 name: "Parse non-zero base 64 digit",
49074928 symbol: "sew:ab",
@@ -5238,6 +5259,13 @@ export const glossary = [
52385259 slug: "https://urbit.org/docs/reference/library/2m/#snag-nl",
52395260 desc: "Used in the Hoon standard library.",
52405261 },
5262+ {
5263+ name: "Drop tail off list",
5264+ symbol: "snip",
5265+ usage: "stdlib",
5266+ slug: "https://urbit.org/docs/reference/library/2b/#snip",
5267+ desc: "Used in the Hoon standard library.",
5268+ },
52415269 {
52425270 name: "Append noun to list",
52435271 symbol: "snoc",