on 91ef98f help sign in
1292 lines 19 kB history raw
1+++
2title = "2b: List Logic"
3weight = 5
4template = "doc.html"
5+++
6### `++fand`
8All indices in `list`
10Produces the indices of all occurrences of `nedl` in `hstk` as a `list` of
11atoms.
13#### Accepts
15`nedl` is a list.
17`hstk` is a list.
19#### Produces
21A `list`.
23#### Source
25```
26 ++ fand
27 ~/ %fand
28 |= [nedl=(list) hstk=(list)]
29 =| i=@ud
30 =| fnd=(list @ud)
31 |- ^+ fnd
32 =+ [n=nedl h=hstk]
33 |-
34 ?: |(?=($~ n) ?=($~ h))
35 (flop fnd)
36 ?: =(i.n i.h)
37 ?~ t.n
38 ^$(i +(i), hstk +.hstk, fnd [i fnd])
39 $(n t.n, h t.h)
40 ^$(i +(i), hstk +.hstk)
41```
43#### Examples
45```
46 > (fand ~[3] ~[1 2 3])
47 ~[2]
49 > (fand ~[4] ~[1 2 3])
50 ~
52 > (fand ~['a'] "cbabab")
53 ~[2 4]
55 > (fand "ba" "cbabab")
56 ~[1 3]
57```
60---
61### `++find`
63First index in `list`
65Produces the index of the first occurrence of `nedl` in `hstk` as the `unit`
66of an atom.
68#### Accepts
70`nedl` is a list.
72`hstk` is a list.
74#### Produces
76The `unit` of an atom.
78#### Source
80```
81 ++ find
82 ~/ %find
83 |= [nedl=(list) hstk=(list)]
84 =| i=@ud
85 |- ^- (unit @ud)
86 =+ [n=nedl h=hstk]
87 |-
88 ?: |(?=($~ n) ?=($~ h))
89 ~
90 ?: =(i.n i.h)
91 ?~ t.n
92 `i
93 $(n t.n, h t.h)
94 ^$(i +(i), hstk +.hstk)
95```
97#### Examples
99```
100 > (find [3]~ ~[1 2 3])
101 [~ u=2]
103 > (find [4]~ ~[1 2 3])
104 ~
106 > (find ['c']~ "cbabab")
107 [~ u=0]
109 > (find "ab" "cbabab")
110 [~ u=1]
112 > (find "bab" "cbabab")
113 [~ u=2]
114```
116---
117### `++flop`
119Reverse
121Produces the `list` `a` in reverse order.
123#### Accepts
125`a` is a `list`.
127#### Produces
129A `list`.
131#### Source
133```
134 ++ flop
135 ~/ %flop
136 |* a=(list)
137 => .(a (homo a))
138 ^+ a
139 =+ b=`_a`~
140 |-
141 ?~ a b
142 $(a t.a, b [i.a b])
143```
146#### Examples
148```
149 > =a [1 2 3 ~]
150 > (flop a)
151 ~[3 2 1]
153 > (flop (flop a))
154 ~[1 2 3]
155```
157---
158### `++gulf`
160List from range
162Produces a `list` composed of each consecutive integer starting from `a` and
163ending with `b`. `a` and `b` are themselves included.
165#### Accepts
167`a` is an atom.
169`b` is an atom.
171#### Produces
173a `list`.
175#### Source
177```
178 ++ gulf
179 |= [a=@ b=@]
180 ^- (list @)
181 ?:(=(a +(b)) ~ [a $(a +(a))])
182```
184#### Examples
186```
187 > (gulf 1 6)
188 ~[1 2 3 4 5 6]
190 > `(list @t)`(gulf 99 106)
191 <|c d e f g h i j|>
192```
194---
195### `++homo`
197Homogenize
199Produces a `list` whose type is a fork of all the contained types in the
200list `a`. Used when you want to make all the types of the elements of a list the
201same.
203#### Accepts
205`a` is a `list`.
207#### Produces
209a `list`.
211#### Source
213```
214 ++ homo
215 |* a=(list)
216 ^+ =< $
217 |% +- $ ?:(*? ~ [i=(snag 0 a) t=$])
218 --
219 a
220```
222#### Examples
224```
225 > lyst
226 [i=1 t=[i=97 t=[i=2 t=[i=98 t=[i=[~ u=10] t=~]]]]]
228 > (homo lyst)
229 ~[1 97 2 98 [~ u=10]]
231 > =a (limo [1 2 3 ~])
232 > a
233 [i=1 t=[i=2 t=[i=3 t=~]]]
235 > (homo a)
236 ~[1 2 3]
237```
239---
241### `++join`
243Constructs a new `list`, placing `sep` between every element of `lit`.
245#### Accepts
247`sep` is a `noun`.
249`lit` is a `list`.
251#### Produces
253a `list`.
255#### Source
257```
258 ++ join
259 |* [sep=* lit=(list)]
260 =. sep `_?>(?=(^ lit) i.lit)`sep
261 ?~ lit ~
262 =| out=(list _?>(?=(^ lit) i.lit))
263 |- ^+ out
264 ?~ t.lit
265 (flop [i.lit out])
266 $(out [sep i.lit out], lit t.lit)
267```
269#### Examples
271```
272 > (join ' ' "hoon")
273 "h o o n"
275 > (join 0 `(list @)`~[1 2 3])
276 ~[1 0 2 0 3]
277```
279---
280### `++lent`
282List length
284Produces the length of any `list` `a` as an atom.
286#### Accepts
288`a` is a `list`.
290#### Produces
292an atom.
294#### Source
296```
297 ++ lent
298 ~/ %lent
299 |= a=(list)
300 ^- @
301 =+ b=0
302 |-
303 ?~ a b
304 $(a t.a, b +(b))
305```
307#### Examples
309```
310 > (lent [1 2 3 4 ~]))
311 4
313 > (lent [1 'a' 2 'b' (some 10) ~])
314 5
315```
318---
319### `++levy`
321Logical "and" on list
323Computes the Boolean logical "and" on the results of gate `b` applied to each individual element in `list` `a`.
325#### Accepts
327`a` is a list.
329`b` is a gate.
331#### Produces
333A boolean.
335#### Source
337```
338 ++ levy
339 ~/ %levy :: all of
340 |* [a=(list) b=$-(* ?)]
341 |- ^- ?
342 ?~ a &
343 ?. (b i.a) |
344 $(a t.a)
345```
347#### Examples
349```
350 > =a |=(a=@ (lte a 1))
351 > (levy `(list @)`[0 1 2 1 ~] a)
352 %.n
354 > =a |=(a=@ (lte a 3))
355 > (levy `(list @)`[0 1 2 1 ~] a)
356 %.y
357```
360---
362### `++lien`
364Logical "or" on list
366Computes the Boolean logical "or" on the results of applying `gate` `b` to
367every element of `++list` `a`.
369#### Accepts
371`a` is a list.
373`b` is a gate.
375#### Source
377```
378 ++ lien
379 ~/ %lien
380 |* [a=(list) b=$-(* ?)]
381 |- ^- ?
382 ?~ a |
383 ?: (b i.a) &
384 $(a t.a)
385```
387#### Examples
389```
390 > =a |=(a=@ (gte a 1))
391 > (lien `(list @)`[0 1 2 1 ~] a)
392 %.y
394 > =a |=(a=@ (gte a 3))
395 > (lien `(list @)`[0 1 2 1 ~]) a)
396 %.n
397```
400---
401### `++limo`
403List Constructor
405Turns a null-terminated tuple into a `list`.
407#### Accepts
409`a` is a null-terminated tuple.
411#### Produces
413A `++list`.
415#### Source
417```
418 ++ limo :: listify
419 |* a=*
420 ^+ =< $
421 |% +- $ ?~(a ~ ?:(_? i=-.a t=$ $(a +.a)))
422 --
423 a
424```
426#### Examples
428```
429 > (limo [1 2 3 ~])
430 [i=1 t=[i=2 t=[i=3 t=~]]]
431```
434---
435### `++murn`
437Maybe transform
439Passes each member of `list` `a` to gate `b`, which must produce a
440`unit`. Produces a new list with all the results that do not produce
441`~`.
443#### Accepts
445`a` is a list.
447`b` is a gate that produces a unit.
449#### Produces
451A unit.
453#### Source
455```
456 ++ murn :: maybe transform
457 ~/ %murn
458 |* [a=(list) b=$-(* (unit))]
459 |-
460 ?~ a ~
461 =+ c=(b i.a)
462 ?~ c
463 $(a t.a)
464 [i=u.c t=$(a t.a)]
465```
467#### Examples
469```
470 > =a |=(a=@ ?.((gte a 2) ~ (some (add a 10))))
471 > (murn `(list @)`[0 1 2 3 ~] a)
472 [i=12 t=[i=13 t=~]]
473```
476---
477### `++oust`
479Remove
481Removes elements from list `c` beginning at inclusive index `a`, removing `b`
482number of elements.
484#### Accepts
486`c` is a list.
488#### Produces
490A `++list`.
492#### Source
494```
495 ++ oust :: remove
496 ~/ %oust
497 |* [[a=@ b=@] c=(list)]
498 (weld (scag a c) (slag (add a b) c))
499```
501#### Examples
503```
504 > (oust [4 5] "good day, urbit!")
505 "good urbit!"
507 > (oust [2 2] `(list @)`[1 2 3 4 ~])
508 ~[1 2]
509```
512---
513### `++reap`
515Replicate
517Replicate: produces a `list` containing `a` copies of `b`.
519#### Accepts
521`a` is an atom.
523`b` is a noun.
525#### Produces
527A list.
529#### Source
531```
532 ++ reap :: replicate
533 ~/ %reap
534 |* [a=@ b=*]
535 |- ^- (list _b)
536 ?~ a ~
537 [b $(a (dec a))]
538```
540#### Examples
542```
543 > (reap 20 %a)
544 ~[%a %a %a %a %a %a %a %a %a %a %a %a %a %a %a %a %a %a %a %a]
546 > (reap 5 ~s1)
547 ~[~s1 ~s1 ~s1 ~s1 ~s1]
549 > `@dr`(roll (reap 5 ~s1) add)
550 ~s5
551```
554---
555### `++reel`
557Right fold
559Right fold: moves right to left across a `list` `a`, recursively slamming
560a binary gate `b` with an element from `a` and an accumulator, producing
561the final value of the accumulator.
563(To "slam" means to call a gate and give it a sample/samples. In this instance,
564`a` is the list of samples that are given to the gate b.)
566#### Accepts
568`a` is a list.
570`b` is a binary gate.
572#### Produces
574The accumulator, which is a noun.
576#### Source
578```
579 ++ reel
580 ~/ %reel
581 |* [a=(list) b=_|=([* *] +<+)]
582 |- ^+ +<+.b
583 ?~ a
584 +<+.b
585 (b i.a $(a t.a))
586```
588#### Examples
590```
591 > =sum =|([p=@ q=@] |.((add p q)))
592 > (reel (limo [1 2 3 4 5 ~]) sum)
593 15
595 > =a =|([p=@ q=@] |.((sub p q)))
596 > (reel (limo [6 3 1 ~]) a)
597 4
599 > (reel (limo [3 6 1 ~]) a)
600 ! subtract-underflow
601 ! exit
602```
605---
606### `++roll`
608Left fold
610Left fold: moves left to right across a list `a`, recursively slamming a
611binary gate `b` with an element from the `list` and an accumulator,
612producing the final value of the accumulator.
614(To "slam" means to call a gate and give it a sample/samples. In this instance,
615`a` is the list of samples that are given to the gate b.)
617#### Accepts
619`a` is a list.
621`b` is a binary gate.
623#### Produces
625The accumulator, which is a noun.
627#### Source
629```
630 ++ roll :: left fold
631 ~/ %roll
632 |* [a=(list) b=_|=([* *] +<+)]
633 |- ^+ +<+.b
634 ?~ a
635 +<+.b
636 $(a t.a, b b(+<+ (b i.a +<+.b)))
637```
639#### Examples
641```
642 > =sum =|([p=@ q=@] |.((add p q)))
643 > (roll (limo [1 2 3 4 5 ~]) sum)
644 q=15
646 > =a =|([p=@ q=@] |.((sub p q)))
647 > (roll (limo [6 3 1 ~]) a)
648 ! subtract-underflow
649 ! exit
651 > (roll (limo [1 3 6 ~]) a)
652 q=4
653```
656---
657### `++scag`
659Prefix
661Accepts an atom `a` and `list` `b`, producing the first `a` elements of
662the front of the list.
664#### Accepts
666`a` is an atom.
668`b` is a list.
670#### Produces
672A list of the same type as `b`.
674#### Source
676```
677 ++ scag :: prefix
678 ~/ %scag
679 |* [a=@ b=(list)]
680 |- ^+ b
681 ?: |(?=(~ b) =(0 a)) ~
682 [i.b $(b t.b, a (dec a))]
683```
685#### Examples
687```
688 > (scag 2 `(list @)`[1 2 3 4 ~])
689 [i=1 t=~[2]]
691 > (scag 10 `(list @)`[1 2 3 4 ~])
692 [i=1 t=~[2 3 4]]
693```
696---
697### `++skid`
699Separate
701Separates a `list` `a` into two lists - Those elements of `a` who produce
702true when slammed to gate `b` and those who produce `%.n`.
704(To "slam" means to call a gate and give it a sample/samples. In this instance,
705`a` is the list of samples that are given to the gate `b`.)
707#### Accepts
709`a` is a list.
711`b` is a gate that accepts one argument and produces a flag.
713#### Produces
715A cell of two lists.
717#### Source
719```
720 ++ skid :: separate
721 ~/ %skid
722 |* [a=(list) b=$-(* ?)]
723 |- ^+ [p=a q=a]
724 ?~ a [~ ~]
725 =+ c=$(a t.a)
726 ?:((b i.a) [[i.a p.c] q.c] [p.c [i.a q.c]])
727```
730#### Examples
732```
733 > =a |=(a=@ (gth a 1))
734 > (skid `(list @)`[0 1 2 3 ~]) a)
735 (skid `(list @)`[0 1 2 3 ~]) a)
736```
739---
740### `++skim`
742Suffix
744Cycles through the members of a list `a`, passing them to a gate `b` and
745producing a list of all of the members that produce `%.y`. Inverse of
746`skip`.
748#### Accepts
750`a` is a list.
752`b` is a gate that accepts one argument and produces a boolean.
754#### Produces
756A flag.
758#### Source
760```
761 ++ skim :: only
762 ~/ %skim
763 |* [a=(list) b=$-(* ?)]
764 |-
765 ^+ a
766 ?~ a ~
767 ?:((b i.a) [i.a $(a t.a)] $(a t.a))
768```
770#### Examples
772```
773 > =a |=(a=@ (gth a 1))
774 > (skim `(list @)`[0 1 2 3 ~] a)
775 [i=2 t=~[3]]
776```
778---
779### `++skip`
781Except
783Cycles through the members of `list` `a`, passing them to a gate `b`.
784Produces a list of all of the members that produce `%.n`. Inverse of
785`skim`.
787#### Accepts
789`a` is a list.
791`b` is a gate that accepts one argument and produces a flag.
793#### Produces
795A list of the same type as `a`.
797#### Source
799```
800 ++ skip :: except
801 ~/ %skip
802 |* [a=(list) b=$-(* ?)]
803 |-
804 ^+ a
805 ?~ a ~
806 ?:((b i.a) $(a t.a) [i.a $(a t.a)])
807```
809#### Examples
811```
812 > =a |=(a=@ (gth a 1))
813 > (skip `(l)`[0 1 2 3 ~]) a)
814 [i=0 t=[i=1 t=~]]
815```
818---
819### `++slag`
821Suffix
823Accepts an atom `a` and list `b`, producing the remaining elements from
824`b` starting at `a`.
826#### Accepts
828`a` is an atom.
830`b` is a list.
832#### Produces
834A list of the same type as `b`.
836#### Source
838```
839 ++ slag :: suffix
840 ~/ %slag
841 |* [a=@ b=(list)]
842 |- ^+ b
843 ?: =(0 a) b
844 ?~ b ~
845 $(b t.b, a (dec a))
846```
848#### Examples
850```
851 > (slag 2 (limo [1 2 3 4 ~]))
852 [i=3 t=[i=4 t=~]]
853 > (slag 1 (limo [1 2 3 4 ~]))
854 [i=2 t=[i=3 t=[i=4 t=~]]]
855```
858---
859### `++snag`
861Index
863Accepts an atom `a` and a `++list` `b`, producing the element at the index
864of `a`and failing if the list is null. Lists are 0-indexed.
866#### Accepts
868`a` is an atom.
870`b` is a list.
872#### Produces
874Produces an element of `b`, or crashes if no element exists at that index.
876#### Source
878```
879 ++ snag :: index
880 ~/ %snag
881 |* [a=@ b=(list)]
882 |-
883 ?~ b
884 ~|('snag-fail' !!)
885 ?: =(0 a) i.b
886 $(b t.b, a (dec a))
887```
889#### Examples
891```
892 > (snag 2 "asdf")
893 ~~d
894 > (snag 0 `(list @ud)`~[1 2 3 4])
895 1
896```
899---
900### `++snoc`
902Append
904Accepts a `++list` `a` and a noun `b`, producing the list of `b` appended to `a`.
906#### Accepts
908`a` is a list.
910`b` is a noun.
912#### Produces
914Produces a list of `b` appended to `a`.
916#### Source
918```
919 ++ snoc
920 |* [a/(list) b/*]
921 (weld a ^+(a [b]~))
922```
924#### Examples
926```
927 > `tape`(zing (snoc `(list tape)`~["a" "bc" "def"] "g"))
928 "abcdefg"
929 > (snoc `(list @ud)`~[1 2 3] 4)
930 ~[1 2 3 4]
931```
934---
935### `++sort`
937Quicksort
939Quicksort: accepts a `++list` `a` and a gate `b` which accepts two nouns and
940produces a flag. `++sort` then produces a list of the elements of `a`,
941sorted according to `b`.
943#### Accepts
945`a` is a list.
947`b` is a gate that accepts two nouns and produces a boolean.
949#### Produces
951A list
953#### Source
955```
956 ++ sort !. :: quicksort
957 ~/ %sort
958 |* [a=(list) b=$-([* *] ?)]
959 => .(a ^.(homo a))
960 |- ^+ a
961 ?~ a ~
962 %+ weld
963 $(a (skim t.a |=(c/_i.a (b c i.a))))
964 ^+ t.a
965 [i.a $(a (skim t.a |=(c/_i.a !(b c i.a))))]
966```
968#### Examples
970```
971 > =a =|([p/@ q/@] |.((gth p q)))
972 > (sort (limo [0 1 2 3 ~]) a)
973 ~[3 2 1 0]
974```
977---
978### `++spin`
980Gate to list, with state
982Accepts a `++list` `a`, a gate `b`, and some state `c`. Produces a list with
983the gate applied to each element of the original list. `b` is called with
984a tuple -- the head is an element of `a` and the tail is the state `c`, and
985should produce a tuple of the transformed element and the (potentially
986modified) state `c`.
988#### Accepts
990`a` is a `++list`.
992`b` is a gate.
994`c` is a noun.
996#### Produces
998A list.
1000#### Source
1002```
1003 ++ spin
1004 ~/ %spin
1005 |* [a=(list) b=* c=_|=(^ [** +<+])]
1006 => .(c `$-([_?>(?=(^ a) i.a) _b] [_-:(c) _b])`c)
1007 =/ acc=(list _-:(c)) ~
1008 |- ^- (pair _acc _b)
1009 ?~ a
1010 [(flop acc) b]
1011 =^ res b (c i.a b)
1012 $(acc [res acc], a t.a)
1013```
1015#### Examples
1017```
1018 > %^ spin (limo ~[4 5 6]) :: trivial example -- does nothing with the state
1019 |=([n=@ a=@] [n a])
1021 ~[4 5 6]
1023 > %^ spin (limo ~[4 5 6]) :: `p` as the index and `q` as the list element
1024 |=([n=@ a=@] [`(pair)`[a n] +(a)])
1026 ~[[p=0 q=4] [p=1 q=5] [p=2 q=6]]
1028 > %^ spin (reap 10 0) :: Create 10 random numbers less than `10`
1029 |=([n=@ rng=_og] (rads:rng 10))
1030 ~(. og eny)
1031 ~[5 5 9 4 1 7 9 9 9 6]
1032```
1034#### Discussion
1036`(~(rads og eny) 2)` creates a random number less than `2`, seeding the RNG
1037with entropy (`eny`). The head of the product is the random number, the tail
1038is the continuation of the RNG.
1042---
1043### `++spun`
1045Gate to list, with state
1047Accepts a `list` `a` and a gate `b`. `c` is internal state, initially
1048derived by **bunting** the tail of the sample of gate `b`, instead of
1049being passed in explicitly as in `++spin`. Produces a list with the
1050gate applied to each element of the original list. `b` is called with a tuple --
1051the head is an element of `a` and the tail is the state `c`, and should
1052produce a tuple of the transformed element and the (potentially modified)
1053state `c`.
1055#### Accepts
1057`a` is a `++list`.
1059`b` is a gate.
1061#### Produces
1063A list.
1065#### Source
1067```
1068 ++ spun
1069 ~/ %spun
1070 |* [a=(list) b=_|=(^ [** +<+])]
1071 p:(spin a +<+.b b)
1072```
1074#### Examples
1076```
1077 > %+ spun (limo ~[4 5 6]) :: `p` as the index and `q` as the list element
1078 |=([n=@ a=@] [`(pair)`[a n] +(a)])
1079 ~[[p=0 q=4] [p=1 q=5] [p=2 q=6]]
1081 > =l (limo ~[7 8 9])
1082 > %+ spun (limo ~[4 5 6]) :: joins two lists into a list of pairs
1083 |=([n=@ a=@] [`(pair)`[(snag a l) n] +(a)])
1084 ~[[p=7 q=4] [p=8 q=5] [p=9 q=6]]
1085```
1088---
1089### `++swag`
1091Infix
1093Similar to `substr` in Javascript: extracts a string infix, beginning at
1094inclusive index `a`, producing `b` number of characters.
1096#### Accepts
1098`a` is an atom.
1100`b` is an atom.
1102`c` is a list.
1104#### Produces
1106A list of the same type as `c`.
1108#### Source
1110```
1111 ++ swag
1112 |* [[a=@ b=@] c=(list)]
1113 (scag +<-> (slag +<-< c))
1114```
1116#### Examples
1118```
1119 > (swag [2 5] "roly poly")
1120 "ly po"
1122 > (swag [2 2] (limo [1 2 3 4 ~]))
1123 [i=3 t=[i=4 t=~]]
1124```
1127---
1128### `++turn`
1130Gate to list
1132Accepts a `++list` `a` and a gate `b`. Produces a list with the gate applied
1133to each element of the original list.
1135#### Accepts
1137`a` is a list.
1139`b` is a gate.
1141#### Produces
1143A list.
1145#### Source
1147```
1148 ++ turn
1149 ~/ %turn
1150 |* [a=(list) b=gate]
1151 |-
1152 ?~ a ~
1153 [i=(b i.a) t=$(a t.a)]
1154```
1156#### Examples
1158```
1159 > (turn (limo [104 111 111 110 ~]) @t)
1160 <|h o o n|>
1162 > =a |=(a=@ (add a 4))
1163 > (turn (limo [1 2 3 4 ~]) a)
1164 ~[5 6 7 8]
1165```
1167#### Discussion
1169`turn` is Hoon's version of 'map' in Haskell.
1171---
1172### `++weld`
1174Concatenate
1176Concatenate two `++list`s `a` and `b`.
1178#### Accepts
1180`a` and `b` are lists.
1182#### Source
1184```
1185 ++ weld
1186 ~/ %weld
1187 |* [a=(list) b=(list)]
1188 => .(a ^.(homo a), b ^.(homo b))
1189 |- ^+ b
1190 ?~ a b
1191 [i.a $(a t.a)]
1192```
1194#### Examples
1196```
1197 > (weld "urb" "it")
1198 ~[~~u ~~r ~~b ~~i ~~t]
1200 > (weld (limo [1 2 ~]) (limo [3 4 ~]))
1201 ~[1 2 3 4]
1202```
1205---
1206### `++welp`
1208Perfect weld
1210Concatenate two `++list`s `a` and `b` without losing their type information
1211to homogenization.
1213#### Accepts
1215`a` is a list.
1217`b` is a list.
1219#### Produces
1221A list.
1223#### Source
1225```
1226 ++ welp
1227 =| [* *]
1228 |%
1229 +- $
1230 ?~ +<-
1231 +<-(. +<+)
1232 +<-(+ $(+<- +<->))
1233 --
1234```
1236#### Examples
1238```
1239 > (welp "foo" "bar")
1240 "foobar"
1242 > (welp ~[60 61 62] ~[%a %b %c])
1243 [60 61 62 %a %b %c ~]
1245 > ? (welp ~[60 61 62] ~[%a %b %c])
1246 {@ud @ud @ud $a $b $c $~}
1247 [60 61 62 %a %b %c ~]
1249 > (welp [sa+1 so+2 ~] si=3)
1250 [[%sa 1] [%so 2] si=3]
1251```
1254---
1255### `++zing`
1257Turns a `++list` of lists into a single list by promoting the elements of
1258each sublist into the higher.
1260#### Accepts
1262A list of lists.
1264#### Produces
1266A list.
1268#### Source
1270```
1271 ++ zing
1272 =| *
1273 |%
1274 +- $
1275 ?~ +<
1276 +<
1277 (welp +<- $(+< +<+))
1278 --
1279```
1282#### Examples
1284```
1285 > (zing (limo [(limo ['a' 'b' 'c' ~]) (limo ['e' 'f' 'g' ~]) (limo ['h' 'i' 'j' ~]) ~]))
1286 ~['a' 'b' 'c' 'e' 'f' 'g' 'h' 'i' 'j']
1288 > (zing (limo [(limo [1 'a' 2 'b' ~]) (limo [3 'c' 4 'd' ~]) ~]))
1289 ~[1 97 2 98 3 99 4 100]
1290```
1292---