2title = "4b: Text Processing"
21 ?: ?& (gte (met 3 a) 2)
26 ?& ?|(=('-' vis) ?&((gte vis 'a') (lte vis 'z')))
42 ++ rf `tape`[?-(a $& '&', $| '|', * !!) ~]
51 ++ rn `tape`[?>(=(0 a) '~') ~]
59 ++ rt `tape`['\'' (weld (mesc (trip a)) `tape`['\'' ~])]
75 ++ rtam `tape`['%' (trip a)]
83 ++ rub `tape`['0' 'b' (rum 2 ~ |=(b/@ (add '0' b)))]
91 ++ rud (rum 10 ~ |=(b/@ (add '0' b)))
100 |= {b/@ c/tape d/$-(@ @)}
108 =+ f=&(!=(0 e) =(0 (mod e ?:(=(10 b) 3 4))))
111 c [(d (mod a b)) ?:(f [?:(=(10 b) ',' '-') c] c)]
129 $(a (rsh 5 1 a), b (sub b 4))
130 `tape`['-' '-' $(a (end 5 1 a), b 4)]
139 (weld (trip (tod:po c)) (trip (tos:po (mix c d))))
142 (weld ^$(a c, b (met 3 c)) `tape`['-' $(a (mix c d), b 2)])
163 ?:((lth b 26) (add 65 b) ?:((lth b 52) (add 71 b) (sub b 4)))
172 ++ rux `tape`['0' 'x' (rum 16 ~ |=(b/@ (add b ?:((lth b 10) 48 87))))]
174 :::::::::::::::::::::::::::::::::::::::::::::::::::::: ::
188Produce the case insensitive (all lowercase) `++cord` of a `++tape`.
204 (turn vib |=(a/@ ?.(&((gte a 'A') (lte a 'Z')) a (add 32 a))))
211 7.309.170.810.699.673.450
213 > `cord`(cass "john doe")
216 > (cass "abc, 123, !@#")
217 2.792.832.775.110.938.439.066.079.945.313
219 > `cord`(cass "abc, 123, !@#")
228Produce a `++cord` from a `++tape`.
241 ++ crip |=(a=tape `@t`(rap 3 a)) :: tape to cord
250 > (crip "abc 123 !@#")
262Turn all occurances of lowercase letters in any `++tape` into uppercase
263letters, as a `++cord`.
280 (turn vib |=(a=@ ?.(&((gte a 'a') (lte a 'z')) a (sub a 32))))
289 > (cuss "abc ABC 123 !@#")
295 > (cuss "AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsQqRrVvWwXxYyZz")
296 'AABBCCDDEEFFGGHHIIJJKKLLMMNNOOPPQQRRSSQQRRVVWWXXYYZZ'
304Escape special characters, used in `++show`.
317 ++ mesc :: ctrl code escape
323 ['\\' '\\' $(vib t.vib)]
324 ?: ?|((gth i.vib 126) (lth i.vib 32) =(`@`39 i.vib))
325 ['\\' (welp ~(rux at i.vib) '/' $(vib t.vib))]
337 "as\0x27/sa\0xc3/\0x9f/"
346Add `a` repetitions of character `b` to the head of `++tape` `c`.
350`a` and `b` are atoms.
361 ++ runt :: prepend repeatedly
362 |= [[a/@ b/@] c/tape]
373 > (runt [2 '/'] "ham")
385Soft-cast validity by odor.
389`a` is a `++span` (`@ta`).
400 ++ sand :: atom sanity
403 ?.(((sane a) b) ~ [~ b])
410 > `(unit @ta)`((sand %ta) 'sym-som')
412 > `(unit @ta)`((sand %ta) 'err!')
422Check validity by odor. Produces a gate.
426`a` is a `++span` (`@ta`).
437 ++ sane :: atom sanity
442 =+ [inx=0 len=(met 3 b)]
446 =+ cur=(cut 3 [inx 1] b)
447 ?& ?| &((gte cur 'a') (lte cur 'z'))
448 &(=('-' cur) !=(0 inx) !=(len inx))
449 &(&((gte cur '0') (lte cur '9')) !=(0 inx))
456 =+ cur=(cut 3 [inx 1] b)
457 ?& ?| &((gte cur 'a') (lte cur 'z'))
458 &((gte cur '0') (lte cur '9'))
459 |(=('-' cur) =('~' cur) =('_' cur) =('.' cur))
466 ?: &((lth cur 32) !=(10 cur)) |
468 ?& |(=(1 len) =+(i=1 |-(|(=(i len) &((gte (cut 3 [i 1] b) 128) $(i +(i)))))))
479 > ((sane %tas) 'lam')
481 > ((sane %tas) 'more ace')
491Produces the number of utf8 bytes.
509 ?> |((gte b 32) =(10 b))
510 ?:((lte b 127) 1 ?:((lte b 223) 2 ?:((lte b 239) 3 4)))
528Split first `a` characters off `++tape` `b`.
538A cell of `++tape`s, `p` and `q`.
543 ++ trim :: 31-bit nonzero
547 =+ haz=(spec syd key)
548 =+ ham=(mix (rsh 0 31 haz) (end 0 31 haz))
549 ?.(=(0 ham) ham $(syd +(syd)))
557 > (trim 5 "lasok termun")
558 [p="lasok" q=" termun"]
569Produce a `++tape` from `++cord`.
582 ++ trip :: cord to tape
587 [^-(@ta (end 3 1 a)) $(a (rsh 3 1 a))]
596 > (trip 'abc 123 !@#')
608Convert `++tape` to a `++list` of codepoints (`@c`).
616A `++list` of codepoints `@c`.
621 ++ tuba :: utf8 to utf32 tape
624 (rip 5 (turf (rap 3 a))) :: XX horrible
632 ~[~-~44f. ~-. ~-~442. ~-~443. ~-~442.]
634 ~[~-c ~-h ~-a ~-r ~-s]
643Wrap a `++list` of utf32 codepoints into a utf8 `++tape`.
647`a` is a `++list` of `@c`.
656 ++ tufa :: utf32 to utf8 tape
660 (weld (rip 3 (tuft i.a)) $(a t.a))
667 > (tufa ~[~-~44f. ~-. ~-~442. ~-~443. ~-~442.])
669 > (tufa ((list @c) ~[%a %b 0xb1 %c]))
679Convert utf32 glyph to
684`a` is a codepoint (`@c`).
693 ++ tuft :: utf32 to utf8 text
701 =+ c=$(a (rsh 5 1 a))
705 :* (mix 0b1100.0000 (cut 0 [6 5] b))
706 (mix 0b1000.0000 (end 0 6 b))
710 :* (mix 0b1110.0000 (cut 0 [12 4] b))
711 (mix 0b1000.0000 (cut 0 [6 6] b))
712 (mix 0b1000.0000 (end 0 6 b))
715 :* (mix 0b1111.0000 (cut 0 [18 3] b))
716 (mix 0b1000.0000 (cut 0 [12 6] b))
717 (mix 0b1000.0000 (cut 0 [6 6] b))
718 (mix 0b1000.0000 (end 0 6 b))
738Convert utf8 (`++cord`) to utf32 codepoints.
746A `@c`, UTF-32 codepoint.
751 ++ turf :: utf8 to utf32
765 $3 [[16 6] [8 6] [0 4] ~]
766 $4 [[24 6] [16 6] [8 6] [0 3] ~]
768 |=({p/@ q/@} [q (cut 0 [p q] a)])
769 ?. =((tuft c) (end 3 b a)) ~|(%bad-utf8 !!)
782 ~-~44f..~442.~443.~442.
784 0x82.d183.d182.d120.8fd1
785 > `@ux`(turf 'я тут')
786 0x442.0000.0443.0000.0442.0000.0020.0000.044f
795Escape `++span` `~` as `~~` and `_` as `~-`. Used for printing.
799`a` is a `++span` (`@ta`).
808 ++ wack :: coin format
816 ?: =('~' i.b) ['~' '~' $(b t.b)]
817 ?: =('_' i.b) ['~' '-' $(b t.b)]
828 > `@t`(wack '~20_sam~')
831 > ~(rend co %many ~[`ud/5 `ta/'~20_sam'])
843Unescape `++span` `~~` as `~` and `~-` as `_`.
856 ++ wick :: knot format
860 =- ?^(b ~ (some (rap 3 (flop c))))
862 |- ^- {b/tape c/tape}
868 $'~' $(b t.t.b, c ['~' c])
869 $'-' $(b t.t.b, c ['_' c])
878 > `@t`(wick '~-ams~~lop')
881 > `@t`(wick (wack '~20_sam~'))
891Unescape `++cord` codepoints.
904 ++ woad :: cord format
917 => .(b (end 3 1 c), c (rsh 3 1 c))
918 ?+ b =- (weld (rip 3 (tuft p.d)) $(a q.d))
930 ?: &((gte b '0') (lte b '9')) 48
931 ?>(&((gte b 'a') (lte b 'z')) 87)
952Escape `++cord` codepoints.
956`a` is a `++span` (`@ta`).
965 ++ wood :: cord format
973 =+ c=(turf (end 3 b a))
974 =+ d=$(a (rsh 3 b a))
975 ?: ?| &((gte c 'a') (lte c 'z'))
976 &((gte c '0') (lte c '9'))
988 [(add ?:((lte f 9) 48 87) f) $(c (end 2 e c))]
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list