@@ -0,0 +1,1337 @@
1+## 4k: atom printing
2+### `++alf`
3+
4+Alphabetic characters
5+
6+Parse alphabetic characters, both upper and lowercase.
7+
8+Source
9+------
10+
11+ ++ alf ;~(pose low hig) :: alphabetic
12+
13+Examples
14+--------
15+
16+ ~zod/try=> (scan "a" alf)
17+ ~~a
18+ ~zod/try=> (scan "A" alf)
19+ ~~~41.
20+ ~zod/try=> (scan "AaBbCc" (star alf))
21+ "AaBbCc"
22+
23+
24+
25+***
26+### `++aln`
27+
28+Alphanumeric characters
29+
30+Parse alphanumeric characters - both alphabetic characters and numbers.
31+
32+Source
33+------
34+
35+ ++ aln ;~(pose low hig nud) :: alphanumeric
36+
37+Examples
38+--------
39+
40+ ~zod/try=> (scan "0" aln)
41+ ~~0
42+ ~zod/try=> (scan "alf42" (star aln))
43+ "alf42"
44+ ~zod/try=> (scan "0123456789abcdef" (star aln))
45+ "0123456789abcdef"
46+
47+
48+
49+***
50+### `++alp`
51+
52+Alphanumeric and `-`
53+
54+Parse alphanumeric strings and hep, "-".
55+
56+Source
57+------
58+
59+ ++ alp ;~(pose low hig nud hep) :: alphanumeric and -
60+
61+Examples
62+--------
63+
64+ ~zod/try=> (scan "7" alp)
65+ ~~7
66+ ~zod/try=> (scan "s" alp)
67+ ~~s
68+ ~zod/try=> (scan "123abc-" (star alp))
69+ "123abc-"
70+
71+
72+
73+***
74+
75+### `++bet`
76+
77+Axis syntax `-`, `+`
78+
79+Parse the hep and lus axis syntax.
80+
81+Source
82+------
83+
84+ ++ bet ;~(pose (cold 2 hep) (cold 3 lus)) :: axis syntax - +
85+
86+Examples
87+--------
88+
89+ ~zod/try=> (scan "-" bet)
90+ 2
91+ ~zod/try=> (scan "+" bet)
92+ 3
93+
94+
95+
96+***
97+### `++bin`
98+
99+Binary to atom
100+
101+Parse a tape of binary (0s and 1s) and produce its atomic representation.
102+
103+Source
104+------
105+
106+ ++ bin (bass 2 (most gon but)) :: binary to atom
107+
108+Examples
109+--------
110+
111+ ~zod/try=> (scan "0000" bin)
112+ 0
113+ ~zod/try=> (scan "0001" bin)
114+ 1
115+ ~zod/try=> (scan "0010" bin)
116+ 2
117+ ~zod/try=> (scan "100000001111" bin)
118+ 2.063
119+
120+
121+
122+***
123+### `++but`
124+
125+Binary digit
126+
127+Parse a single binary digit.
128+
129+Source
130+------
131+
132+ ++ but (cook |=(a=@ (sub a '0')) (shim '0' '1')) :: binary digit
133+
134+Examples
135+--------
136+
137+ ~zod/try=> (scan "0" but)
138+ 0
139+ ~zod/try=> (scan "1" but)
140+ 1
141+ ~zod/try=> (scan "01" but)
142+ ! {1 2}
143+ ! 'syntax-error'
144+ ! exit
145+ ~zod/try=> (scan "01" (star but))
146+ ~[0 1]
147+
148+
149+
150+***
151+### `++cit`
152+
153+Octal digit
154+
155+Parse a single octal digit.
156+
157+Source
158+------
159+
160+ ++ cit (cook |=(a=@ (sub a '0')) (shim '0' '7')) :: octal digit
161+
162+Examples
163+--------
164+
165+ ~zod/try=> (scan "1" cit)
166+ 1
167+ ~zod/try=> (scan "7" cit)
168+ 7
169+ ~zod/try=> (scan "8" cit)
170+ ! {1 1}
171+ ! 'syntax-error'
172+ ! exit
173+ ~zod/try=> (scan "60" (star cit))
174+ ~[6 0]
175+
176+
177+
178+***
179+### `++dem`
180+
181+Decimal to atom
182+
183+Parse a decimal number to an atom.
184+
185+Source
186+------
187+
188+ ++ dem (bass 10 (most gon dit)) :: decimal to atom
189+
190+Examples
191+--------
192+
193+ ~zod/try=> (scan "7" dem)
194+ 7
195+ ~zod/try=> (scan "42" dem)
196+ 42
197+ ~zod/try=> (scan "150000000" dem)
198+ 150.000.000
199+ ~zod/try=> (scan "12456" dem)
200+ 12.456
201+
202+
203+
204+***
205+### `++dit`
206+
207+Decimal digit
208+
209+Parse a single decimal digit.
210+
211+Source
212+------
213+
214+ ++ dit (cook |=(a=@ (sub a '0')) (shim '0' '9')) :: decimal digit
215+
216+Examples
217+--------
218+
219+ ~zod/try=> (scan "7" dit)
220+ 7
221+ ~zod/try=> (scan "42" (star dit))
222+ ~[4 2]
223+ ~zod/try=> (scan "26000" (star dit))
224+ ~[2 6 0 0 0]
225+
226+
227+
228+***
229+### `++dog`
230+
231+`.` optional gap
232+
233+Dot followed by an optional gap, used with numbers.
234+
235+Source
236+------
237+
238+ ++ dog ;~(plug dot gay) ::
239+
240+Examples
241+--------
242+
243+ /~zod/try=> 1.234.
244+ 703
245+ 1.234.703
246+ ~zod/try=> (scan "a. " ;~(pfix alf dog))
247+ [~~~. ~]
248+
249+
250+
251+***
252+### `++doh`
253+
254+`@p` separator
255+
256+Phonetic base phrase separator
257+
258+Source
259+------
260+
261+ ++ doh ;~(plug ;~(plug hep hep) gay) ::
262+
263+Examples
264+--------
265+
266+ /~zod/try=> ~nopfel-botduc-nilnev-dolfyn--haspub-natlun-lodmur-holtyd
267+ ~nopfel-botduc-nilnev-dolfyn--haspub-natlun-lodmur-holtyd
268+ /~zod/try=> ~nopfel-botduc-nilnev-dolfyn--
269+ haspub-natlun-lodmur-holtyd
270+ ~nopfel-botduc-nilnev-dolfyn--haspub-natlun-lodmur-holtyd
271+ ~zod/try=> (scan "--" doh)
272+ [[~~- ~~-] ~]
273+ ~zod/try=> (scan "-- " doh)
274+ [[~~- ~~-] ~]
275+
276+
277+
278+***
279+### `++dun`
280+
281+`--` to `~`
282+
283+Parse phep, `--`, to null, `~`.
284+
285+Source
286+------
287+
288+ ++ dun (cold ~ ;~(plug hep hep)) :: -- (phep) to ~
289+
290+Examples
291+--------
292+
293+ ~zod/try=> (scan "--" dun)
294+ ~
295+ ~zod/try=> (dun [[1 1] "--"])
296+ [p=[p=1 q=3] q=[~ u=[p=~ q=[p=[p=1 q=3] q=""]]]]
297+
298+
299+
300+***
301+
302+### `++duz`
303+
304+`==` to `~`
305+
306+Parse stet, `==`, to null `~`.
307+
308+Source
309+------
310+
311+ ++ duz (cold ~ ;~(plug tis tis)) :: == (stet) to ~
312+
313+Examples
314+--------
315+
316+ ~zod/try=> (scan "==" duz)
317+ ~
318+ ~zod/try=> (duz [[1 1] "== |=..."])
319+ [p=[p=1 q=3] q=[~ u=[p=~ q=[p=[p=1 q=3] q=" |=..."]]]]
320+
321+
322+
323+***
324+
325+### `++gah`
326+
327+Newline or ' '
328+
329+Whitespace component, either newline or space.
330+
331+Source
332+------
333+
334+ ++ gah (mask [`@`10 ' ' ~]) :: newline or ace
335+
336+Examples
337+--------
338+
339+ /~zod/try=> ^- * :: show spaces
340+ """
341+ -
342+ -
343+ -
344+ """
345+ [32 32 32 45 10 32 45 10 32 32 45 0]
346+ /~zod/try=> ^- *
347+ """
348+
349+ """
350+ [32 32 32 10 32 10 32 32 0]
351+ /~zod/try=> ^- (list ,@)
352+ %- scan :_ (star gah)
353+ """
354+
355+ """
356+ ~[32 32 32 10 32 10 32 32]
357+
358+
359+
360+***
361+### `++gap`
362+
363+Plural whitespace
364+
365+Separates tall runes
366+
367+Source
368+------
369+
370+ ++ gap (cold ~ ;~(plug gaq (star ;~(pose vul gah)))) :: plural whitespace
371+
372+
373+
374+***
375+### `++gaq`
376+
377+End of line
378+
379+Two spaces, a newline, or comment.
380+
381+Source
382+------
383+
384+ ++ gaq ;~ pose :: end of line
385+ (just `@`10)
386+ ;~(plug gah ;~(pose gah vul))
387+ vul
388+ ==
389+
390+
391+
392+
393+***
394+### `++gaw`
395+
396+Classic whitespace
397+
398+Terran whitespace.
399+
400+Source
401+------
402+
403+ ++ gaw (cold ~ (star ;~(pose vul gah))) :: classic white
404+
405+
406+
407+***
408+### `++gay`
409+
410+Optional gap
411+
412+Optional gap.
413+
414+Source
415+------
416+
417+ ++ gay ;~(pose gap (easy ~)) ::
418+
419+
420+
421+***
422+### `++gon`
423+
424+Long numbers
425+
426+Parse long numbers - Numbers which wrap around the shell with the line
427+
428+Source
429+------
430+
431+break ++ gon ;~(pose ;~(plug bas gay fas) (easy ~)) :: long numbers \ /
432+
433+Examples
434+--------
435+characters bas and fas.
436+
437+ ~zod/try=> (scan "\\/" gon)
438+ [~~~5c. ~ ~~~2f.]
439+ ~zod/try=> (gon [[1 1] "\\/"])
440+ [p=[p=1 q=3] q=[~ u=[p=[~~~5c. ~ ~~~2f.] q=[p=[p=1 q=3] q=""]]]]
441+
442+
443+
444+***
445+### `++gul`
446+
447+Axis syntax `<` or `>`
448+
449+Parse the axis gal and gar axis syntax.
450+
451+Source
452+------
453+
454+ ++ gul ;~(pose (cold 2 gal) (cold 3 gar)) :: axis syntax < >
455+
456+Examples
457+--------
458+
459+ ~zod/try=> (scan "<" gul)
460+ 2
461+ ~zod/try=> (scan ">" gul)
462+ 3
463+
464+
465+
466+***
467+### `++hex`
468+
469+Hex to atom
470+
471+Parse any hexadecimal number to an atom.
472+
473+Source
474+------
475+
476+ ++ hex (bass 16 (most gon hit)) :: hex to atom
477+
478+Examples
479+--------
480+
481+ ~zod/try=> (scan "a" hex)
482+ 10
483+ ~zod/try=> (scan "A" hex)
484+ 10
485+ ~zod/try=> (scan "2A" hex)
486+ 42
487+ ~zod/try=> (scan "1ee7" hex)
488+ 7.911
489+ ~zod/try=> (scan "1EE7" hex)
490+ 7.911
491+ ~zod/try=> (scan "1EE7F7" hex)
492+ 2.025.463
493+ ~zod/try=> `@ux`(scan "1EE7F7" hex)
494+ 0x1e.e7f7
495+
496+
497+***
498+### `++hig`
499+
500+Uppercase
501+
502+Parse a single uppercase letter.
503+
504+Source
505+------
506+
507+ ++ hig (shim 'A' 'Z') :: uppercase
508+
509+Examples
510+--------
511+
512+ ~zod/try=> (scan "G" hig)
513+ ~~~47.
514+ ~zod/try=> `cord`(scan "G" hig)
515+ 'G'
516+ ~zod/try=> (scan "ABCDEFGHIJKLMNOPQRSTUVWXYZ" (star hig))
517+ "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
518+ ~zod/try=> (hig [[1 1] "G"])
519+ [p=[p=1 q=2] q=[~ [p=~~~47. q=[p=[p=1 q=2] q=""]]]]
520+
521+
522+
523+***
524+### `++hit`
525+
526+Hex digits
527+
528+Parse a single hexadecimal digit.
529+
530+Source
531+------
532+
533+ ++ hit ;~ pose :: hex digits
534+ dit
535+ (cook |=(a=char (sub a 87)) (shim 'a' 'f'))
536+ (cook |=(a=char (sub a 55)) (shim 'A' 'F'))
537+ ==
538+
539+Examples
540+--------
541+
542+ ~zod/try=> (scan "a" hit)
543+ 10
544+ ~zod/try=> (scan "A" hit)
545+ 10
546+ ~zod/try=> (hit [[1 1] "a"])
547+ [p=[p=1 q=2] q=[~ [p=10 q=[p=[p=1 q=2] q=""]]]]
548+ ~zod/try=> (scan "2A" (star hit))
549+ ~[2 10]
550+
551+
552+***
553+### `++iny`
554+
555+Indentation block
556+
557+Apply [`++rule`]() to indented block starting at current column number, omitting
558+the leading whitespace.
559+
560+Accepts
561+-------
562+
563+`sef` is a [`++rule`]()
564+
565+Produces
566+--------
567+
568+A `++rule`.
569+
570+Source
571+------
572+
573+ ++ iny |* sef=_rule :: indentation block
574+ |= nail ^+ (sef)
575+ =+ [har tap]=[p q]:+<
576+ =+ lev=(fil 3 (dec q.har) ' ')
577+ =+ eol=(just `@t`10)
578+ =+ =- roq=((star ;~(pose prn ;~(sfix eol (jest lev)) -)) har tap)
579+ ;~(simu ;~(plug eol eol) eol)
580+ ?~ q.roq roq
581+ =+ vex=(sef har(q 1) p.u.q.roq)
582+ =+ fur=p.vex(q (add (dec q.har) q.p.vex))
583+ ?~ q.vex vex(p fur)
584+ =- vex(p fur, u.q -)
585+ :+ &3.vex
586+ &4.vex(q.p (add (dec q.har) q.p.&4.vex))
587+ =+ res=|4.vex
588+ |- ?~ res |4.roq
589+ ?. =(10 -.res) [-.res $(res +.res)]
590+ (welp [`@t`10 (trip lev)] $(res +.res))
591+ ::
592+
593+Examples
594+--------
595+
596+ ~zod/try=> (scan "abc" (iny (star ;~(pose prn (just `@`10)))))
597+ "abc"
598+ ~zod/try=> (scan "abc" (star ;~(pose prn (just `@`10))))
599+ "abc"
600+ ~zod/try=> (scan " abc\0ade" ;~(pfix ace ace (star ;~(pose prn (just `@`10)))))
601+ "abc
602+ de"
603+ ~zod/try=> (scan " abc\0ade" ;~(pfix ace ace (iny (star ;~(pose prn (just `@`10))))))
604+ ! {1 6}
605+ ! exit
606+ ~zod/try=> (scan " abc\0a de" ;~(pfix ace ace (iny (star ;~(pose prn (just `@`10))))))
607+ "abc
608+ de"
609+
610+
611+
612+***
613+### `++low`
614+
615+Lowercase
616+
617+Parse a single lowercase letter.
618+
619+Source
620+------
621+
622+ ++ low (shim 'a' 'z') :: lowercase
623+
624+Examples
625+--------
626+
627+ ~zod/try=> (scan "g" low)
628+ ~~g
629+ ~zod/try=> `cord`(scan "g" low)
630+ 'g'
631+ ~zod/try=> (scan "abcdefghijklmnopqrstuvwxyz" (star low))
632+ "abcdefghijklmnopqrstuvwxyz"
633+ ~zod/try=> (low [[1 1] "g"])
634+ [p=[p=1 q=2] q=[~ [p=~~g q=[p=[p=1 q=2] q=""]]]]
635+
636+
637+
638+***
639+### `++mes`
640+
641+Hexbyte
642+
643+Parse a hexbyte.
644+
645+Source
646+------
647+
648+ ++ mes %+ cook :: hexbyte
649+ |=([a=@ b=@] (add (mul 16 a) b))
650+ ;~(plug hit hit)
651+
652+Examples
653+--------
654+
655+ ~zod/try=> (scan "2A" mes)
656+ 42
657+ ~zod/try=> (mes [[1 1] "2A"])
658+ [p=[p=1 q=3] q=[~ u=[p=42 q=[p=[p=1 q=3] q=""]]]]
659+ ~zod/try=> (scan "42" mes)
660+ 66
661+
662+
663+
664+***
665+### `++nix`
666+
667+Letters and `-`
668+
669+Parse Letters and `-`.
670+
671+Source
672+------
673+
674+ ++ nix (boss 256 (star ;~(pose aln cab))) ::
675+
676+Examples
677+--------
678+
679+ ~zod/try=> (scan "as_me" nix)
680+ q=435.626.668.897
681+ ~zod/try=> `@t`(scan "as_me" nix)
682+ 'as_me'
683+
684+
685+
686+***
687+
688+### `++nud`
689+
690+Numeric
691+
692+Parse a numeric character - A number.
693+
694+Source
695+------
696+
697+ ++ nud (shim '0' '9') :: numeric
698+
699+Examples
700+--------
701+
702+ ~zod/try=> (scan "0" nud)
703+ ~~0
704+ ~zod/try=> (scan "7" nud)
705+ ~~7
706+ ~zod/try=> (nud [[1 1] "1"])
707+ [p=[p=1 q=2] q=[~ [p=~~1 q=[p=[p=1 q=2] q=""]]]]
708+ ~zod/try=> (scan "0123456789" (star nud))
709+ "0123456789"
710+
711+
712+***
713+### `++prn`
714+
715+Printable character
716+
717+Parse any printable character.
718+
719+Source
720+------
721+
722+ ++ prn ;~(less (just `@`127) (shim 32 256))
723+
724+Examples
725+--------
726+
727+ ~zod/try=> (scan "h" prn)
728+ ~~h
729+ ~zod/try=> (scan "!" prn)
730+ ~~~21.
731+ ~zod/try=> (scan "\01" prn)
732+ ! {1 1}
733+ ! exit
734+
735+
736+
737+***
738+### `++qit`
739+
740+Chars in cord
741+
742+Parse an individual character to its cord atom representation.
743+
744+Source
745+------
746+
747+ ++ qit ;~ pose :: chars in a cord
748+ ;~(less bas soq prn)
749+ ;~(pfix bas ;~(pose bas soq mes)) :: escape chars
750+ ==
751+
752+Examples
753+--------
754+
755+ ~zod/try=> (scan "%" qit)
756+ 37
757+ ~zod/try=> `@t`(scan "%" qit)
758+ '%'
759+ ~zod/try=> (scan "0" qit)
760+ 48
761+ ~zod/try=> (scan "E" qit)
762+ 69
763+ ~zod/try=> (scan "a" qit)
764+ 97
765+ ~zod/try=> (scan "\\0a" qit)
766+ 10
767+ ~zod/try=> `@ux`(scan "\\0a" qit)
768+ 0xa
769+ ~zod/try=> (scan "cord" (star qit))
770+ ~[99 111 114 100]
771+
772+
773+
774+***
775+### `++qit`
776+
777+Chars in cord
778+
779+Parse an individual character to its cord atom representation.
780+
781+Source
782+------
783+
784+ ++ qit ;~ pose :: chars in a cord
785+ ;~(less bas soq prn)
786+ ;~(pfix bas ;~(pose bas soq mes)) :: escape chars
787+ ==
788+
789+Examples
790+--------
791+
792+ ~zod/try=> (scan "%" qit)
793+ 37
794+ ~zod/try=> `@t`(scan "%" qit)
795+ '%'
796+ ~zod/try=> (scan "0" qit)
797+ 48
798+ ~zod/try=> (scan "E" qit)
799+ 69
800+ ~zod/try=> (scan "a" qit)
801+ 97
802+ ~zod/try=> (scan "\\0a" qit)
803+ 10
804+ ~zod/try=> `@ux`(scan "\\0a" qit)
805+ 0xa
806+ ~zod/try=> (scan "cord" (star qit))
807+ ~[99 111 114 100]
808+
809+
810+
811+
812+***
813+### `++qut`
814+
815+Cord
816+
817+Parse single-soq cord with `\{gap}/` anywhere in the middle, or triple-single
818+quote (aka triple-soq) cord, between which must be in an indented block.
819+
820+Source
821+------
822+
823+ ++ qut ;~ pose :: cord
824+ ;~ less soqs
825+ (ifix [soq soq] (boss 256 (more gon qit)))
826+ ==
827+ %- inde %+ ifix
828+ :- ;~ plug soqs
829+ ;~(pose ;~(plug (plus ace) vul) (just '\0a'))
830+ ==
831+ ;~(plug (just '\0a') soqs)
832+ (boss 256 (star qat))
833+ ==
834+ ::
835+
836+Examples
837+--------
838+
839+ ~zod/try=> (scan "'cord'" qut)
840+ q=1.685.221.219
841+ ~zod/try=> 'cord'
842+ 'cord'
843+ ~zod/try=> `@ud`'cord'
844+ 1.685.221.219
845+ /~zod/try=> '''
846+ Heredoc isn't prohibited from containing quotes
847+ '''
848+ 'Heredoc isn't prohibited from containing quotes'
849+
850+
851+
852+***
853+### `++soz`
854+
855+Delimiting `'''`
856+
857+Parse a triple-single quote, used for multiline strings.
858+
859+Source
860+------
861+
862+ ++ soz ;~(plug soq soq soq) :: delimiting '''
863+
864+Examples
865+--------
866+
867+ ~zod/try=> (scan "'''" soz)
868+ [~~~27. ~~~27. ~~~27.]
869+ ~zod/try=> (rash '"""' soz)
870+ ! {1 1}
871+ ! exit
872+
873+
874+
875+***
876+### `++sym`
877+
878+Term
879+
880+A term: a letter(lowercase), followed by letters, numbers, or `-`.
881+
882+Source
883+------
884+
885+ ++ sym
886+ %+ cook
887+ |=(a=tape (rap 3 ^-((list ,@) a)))
888+ ;~(plug low (star ;~(pose nud low hep)))
889+ ::
890+
891+Examples
892+--------
893+
894+ ~zod/try=> (scan "sam-2" sym)
895+ 215.510.507.891
896+ ~zod/try=> `@t`(scan "sam-2" sym)
897+ 'sam-2'
898+ ~zod/try=> (scan "sym" sym)
899+ 7.174.515
900+
901+
902+
903+***
904+### `++ven`
905+
906+`+>-` axis syntax
907+
908+Axis syntax parser
909+
910+Source
911+------
912+
913+ ++ ven ;~ (comp |=([a=@ b=@] (peg a b))) :: +>- axis syntax
914+ bet
915+ =+ hom=`?`|
916+ |= tub=nail
917+ ^- (like axis)
918+ =+ vex=?:(hom (bet tub) (gul tub))
919+ ?~ q.vex
920+ [p.tub [~ 1 tub]]
921+ =+ wag=$(p.tub p.vex, hom !hom, tub q.u.q.vex)
922+ ?> ?=(^ q.wag)
923+ [p.wag [~ (peg p.u.q.vex p.u.q.wag) q.u.q.wag]]
924+ ==
925+
926+Examples
927+--------
928+
929+ ~zod/arvo=/hoon/hoon> (scan "->+" ven)
930+ 11
931+ ~zod/arvo=/hoon/hoon> `@ub`(scan "->+" ven)
932+ 0b1011
933+ ~zod/arvo=/hoon/hoon> (peg (scan "->" ven) (scan "+" ven))
934+ 11
935+ ~zod/arvo=/hoon/hoon> ->+:[[1 2 [3 4]] 5]
936+ [3 4]
937+
938+
939+
940+***
941+### `++vit`
942+
943+Base64 digit
944+
945+Parse a standard base64 digit.
946+
947+Source
948+------
949+
950+ ++ vit :: base64 digit
951+ ;~ pose
952+ (cook |=(a=@ (sub a 65)) (shim 'A' 'Z'))
953+ (cook |=(a=@ (sub a 71)) (shim 'a' 'z'))
954+ (cook |=(a=@ (add a 4)) (shim '0' '9'))
955+ (cold 62 (just '-'))
956+ (cold 63 (just '+'))
957+ ==
958+
959+Examples
960+--------
961+
962+ ~zod/arvo=/hoon/hoon> (scan "C" vit)
963+ 2
964+ ~zod/arvo=/hoon/hoon> (scan "c" vit)
965+ 28
966+ ~zod/arvo=/hoon/hoon> (scan "2" vit)
967+ 54
968+ ~zod/arvo=/hoon/hoon> (scan "-" vit)
969+ 62
970+
971+
972+***
973+### `++vul`
974+
975+Comments to null
976+
977+Source
978+------
979+
980+ ++ vul %- cold :- ~ :: comments
981+ ;~ plug col col
982+ (star prn)
983+ (just `@`10)
984+ ==
985+
986+Parse comments and produce a null. Note that a comment must be ended
987+with a newline character.
988+
989+Examples
990+--------
991+
992+ ~zod/try=> (scan "::this is a comment \0a" vul)
993+ ~
994+ ~zod/try=> (scan "::this is a comment " vul)
995+ ! {1 21}
996+ ! exit
997+
998+
999+
1000+***
1001+### `++co`
1002+
1003+Literal rendering engine
1004+
1005+A [door]() that contains arms that operate on the sample coin `lot`.
1006+
1007+Accepts
1008+-------
1009+
1010+Produces
1011+--------
1012+
1013+`lot` is a [`++coin`]().
1014+
1015+Source
1016+------
1017+
1018+ ++ co
1019+ =< |_ lot=coin
1020+
1021+Examples
1022+--------
1023+
1024+ ~zod/try=> ~(. co many/~[`ta/'mo' `ud/5])
1025+ < 3.dhd
1026+ [ [ %many
1027+ [%~ %ta @t]
1028+ [%~ %ud @ud]
1029+ %~
1030+ ]
1031+ <10.utz 3.zid [rex="" <414.hmb 100.xkc 1.ypj %164>]>
1032+ ]
1033+ >
1034+
1035+------------------------------------------------------------------------
1036+
1037+### `++rear`
1038+
1039+Prepend & render as tape
1040+
1041+Renders a coin `lot` as a [tape]() prepended to the sample tape `rom`.
1042+
1043+Accepts
1044+-------
1045+
1046+Produces
1047+--------
1048+
1049+`rom` is a [`pe`]()
1050+
1051+`lot` is a [`++coin`]().
1052+
1053+Source
1054+------
1055+
1056+ ++ rear |=(rom=tape =>(.(rex rom) rend))
1057+
1058+Examples
1059+--------
1060+
1061+ ~zod/try=> (~(rear co %$ %ux 200) "--ha")
1062+ "0xc8--ha"
1063+
1064+------------------------------------------------------------------------
1065+
1066+### `++rent`
1067+
1068+Render as span
1069+
1070+Renders a coin `lot` as a span.
1071+
1072+Accepts
1073+-------
1074+
1075+Produces
1076+--------
1077+
1078+`lot` is a [`++coin`]().
1079+
1080+Source
1081+------
1082+
1083+ ++ rent `@ta`(rap 3 rend)
1084+
1085+Examples
1086+--------
1087+
1088+ ~zod/try=> ~(rent co %$ %ux 200)
1089+ ~.0xc8
1090+ ~zod/try=> `@t`~(rent co %$ %ux 200)
1091+ '0xc8'
1092+
1093+------------------------------------------------------------------------
1094+
1095+### `++rend`
1096+
1097+Render as tape
1098+
1099+Renders a coin `lot` as a tape.
1100+
1101+Accepts
1102+-------
1103+
1104+Produces
1105+--------
1106+
1107+`lot` is a [`++coin`]().
1108+
1109+Source
1110+------
1111+
1112+ ++ rend
1113+ ^- tape
1114+ ?: ?=(%blob -.lot)
1115+ ['~' '0' ((v-co 1) (jam p.lot))]
1116+ ?: ?=(%many -.lot)
1117+ :- '.'
1118+ |- ^- tape
1119+ ?~ p.lot
1120+ ['_' '_' rex]
1121+ ['_' (weld (trip (wack rent(lot i.p.lot))) $(p.lot t.p.lot))]
1122+ =+ [yed=(end 3 1 p.p.lot) hay=(cut 3 [1 1] p.p.lot)]
1123+ |- ^- tape
1124+ ?+ yed (z-co q.p.lot)
1125+ %c ['~' '-' (weld (rip 3 (wood (tuft q.p.lot))) rex)]
1126+ %d
1127+ ?+ hay (z-co q.p.lot)
1128+ %a
1129+ =+ yod=(yore q.p.lot)
1130+ => ^+(. .(rex ?~(f.t.yod rex ['.' (s-co f.t.yod)])))
1131+ => ^+ .
1132+ %= .
1133+ rex
1134+ ?: &(=(~ f.t.yod) =(0 h.t.yod) =(0 m.t.yod) =(0 s.t.yod))
1135+ rex
1136+ => .(rex ['.' (y-co s.t.yod)])
1137+ => .(rex ['.' (y-co m.t.yod)])
1138+ ['.' '.' (y-co h.t.yod)]
1139+ ==
1140+ => .(rex ['.' (a-co d.t.yod)])
1141+ => .(rex ['.' (a-co m.yod)])
1142+ => .(rex ?:(a.yod rex ['-' rex]))
1143+ ['~' (a-co y.yod)]
1144+ ::
1145+ %r
1146+ =+ yug=(yell q.p.lot)
1147+ => ^+(. .(rex ?~(f.yug rex ['.' (s-co f.yug)])))
1148+ :- '~'
1149+ ?: &(=(0 d.yug) =(0 m.yug) =(0 h.yug) =(0 s.yug))
1150+ ['.' 's' '0' rex]
1151+ => ^+(. ?:(=(0 s.yug) . .(rex ['.' 's' (a-co s.yug)])))
1152+ => ^+(. ?:(=(0 m.yug) . .(rex ['.' 'm' (a-co m.yug)])))
1153+ => ^+(. ?:(=(0 h.yug) . .(rex ['.' 'h' (a-co h.yug)])))
1154+ => ^+(. ?:(=(0 d.yug) . .(rex ['.' 'd' (a-co d.yug)])))
1155+ +.rex
1156+ ==
1157+ ::
1158+ %f
1159+ ?: =(& q.p.lot)
1160+ ['.' 'y' rex]
1161+ ?:(=(| q.p.lot) ['.' 'n' rex] (z-co q.p.lot))
1162+ ::
1163+ %n ['~' rex]
1164+ %i
1165+ ?+ hay (z-co q.p.lot)
1166+ %f ((ro-co [3 10 4] |=(a=@ ~(d ne a))) q.p.lot)
1167+ %s ((ro-co [4 16 8] |=(a=@ ~(x ne a))) q.p.lot)
1168+ ==
1169+ ::
1170+ %p
1171+ =+ dyx=(met 3 q.p.lot)
1172+ :- '~'
1173+ ?: (lte dyx 1)
1174+ (weld (trip (tod:po q.p.lot)) rex)
1175+ ?: =(2 dyx)
1176+ ;: weld
1177+ (trip (tos:po (end 3 1 q.p.lot)))
1178+ (trip (tod:po (rsh 3 1 q.p.lot)))
1179+ rex
1180+ ==
1181+ =+ [dyz=(met 5 q.p.lot) fin=|]
1182+ |- ^- tape
1183+ ?: =(0 dyz)
1184+ rex
1185+ %= $
1186+ fin &
1187+ dyz (dec dyz)
1188+ q.p.lot (rsh 5 1 q.p.lot)
1189+ rex
1190+ =+ syb=(wren:un (end 5 1 q.p.lot))
1191+ =+ cog=~(zig mu [(rsh 4 1 syb) (end 4 1 syb)])
1192+ ;: weld
1193+ (trip (tos:po (end 3 1 p.cog)))
1194+ (trip (tod:po (rsh 3 1 p.cog)))
1195+ `tape`['-' ~]
1196+ (trip (tos:po (end 3 1 q.cog)))
1197+ (trip (tod:po (rsh 3 1 q.cog)))
1198+ `tape`?:(fin ['-' ?:(=(1 (end 0 1 dyz)) ~ ['-' ~])] ~)
1199+ rex
1200+ ==
1201+ ==
1202+ ::
1203+ %r
1204+ ?+ hay (z-co q.p.lot)
1205+ %d
1206+ =+ r=(rlyd q.p.lot)
1207+ ?~ e.r
1208+ ['.' '~' (r-co r)]
1209+ ['.' '~' u.e.r]
1210+ %h ['.' '~' '~' (r-co (rlyh q.p.lot))]
1211+ %q ['.' '~' '~' '~' (r-co (rlyq q.p.lot))]
1212+ %s ['.' (r-co (rlys q.p.lot))]
1213+ ==
1214+ ::
1215+ %u
1216+ =- (weld p.gam ?:(=(0 q.p.lot) `tape`['0' ~] q.gam))
1217+ ^= gam ^- [p=tape q=tape]
1218+ ?+ hay [~ ((ox-co [10 3] |=(a=@ ~(d ne a))) q.p.lot)]
1219+ %b [['0' 'b' ~] ((ox-co [2 4] |=(a=@ ~(d ne a))) q.p.lot)]
1220+ %i [['0' 'i' ~] ((d-co 1) q.p.lot)]
1221+ %x [['0' 'x' ~] ((ox-co [16 4] |=(a=@ ~(x ne a))) q.p.lot)]
1222+ %v [['0' 'v' ~] ((ox-co [32 5] |=(a=@ ~(x ne a))) q.p.lot)]
1223+ %w [['0' 'w' ~] ((ox-co [64 5] |=(a=@ ~(w ne a))) q.p.lot)]
1224+ ==
1225+ ::
1226+ %s
1227+ %+ weld
1228+ ?:((syn:si q.p.lot) "--" "-")
1229+ $(yed 'u', q.p.lot (abs:si q.p.lot))
1230+ ::
1231+ %t
1232+ ?: =('a' hay)
1233+ ?: =('s' (cut 3 [2 1] p.p.lot))
1234+
1235+ (weld (rip 3 q.p.lot) rex)
1236+ ['~' '.' (weld (rip 3 q.p.lot) rex)]
1237+ ['~' '~' (weld (rip 3 (wood q.p.lot)) rex)]
1238+ ==
1239+ --
1240+ =+ rex=*tape
1241+ =< |%
1242+ ++ a-co |=(dat=@ ((d-co 1) dat))
1243+ ++ d-co |=(min=@ (em-co [10 min] |=([? b=@ c=tape] [~(d ne b) c])))
1244+ ++ r-co
1245+ |= [syn=? nub=@ der=@ ign=(unit tape) ne=?]
1246+ => .(rex ['.' (t-co ((d-co 1) der) ne)])
1247+ => .(rex ((d-co 1) nub))
1248+ ?:(syn rex ['-' rex])
1249+ ++ t-co |= [a=tape n=?] ^- tape
1250+ ?: n a
1251+ ?~ a ~|(%empty-frac !!) t.a
1252+ ::
1253+ ++ s-co
1254+ |= esc=(list ,@) ^- tape
1255+ ~| [%so-co esc]
1256+ ?~ esc
1257+ rex
1258+ :- '.'
1259+ =>(.(rex $(esc t.esc)) ((x-co 4) i.esc))
1260+
1261+ ::
1262+ ++ v-co |=(min=@ (em-co [32 min] |=([? b=@ c=tape] [~(v ne b) c])))
1263+ ++ w-co |=(min=@ (em-co [64 min] |=([? b=@ c=tape] [~(w ne b) c])))
1264+ ++ x-co |=(min=@ (em-co [16 min] |=([? b=@ c=tape] [~(x ne b) c])))
1265+ ++ y-co |=(dat=@ ((d-co 2) dat))
1266+ ++ z-co |=(dat=@ `tape`['0' 'x' ((x-co 1) dat)])
1267+ --
1268+ ~% %co +> ~
1269+ |%
1270+ ++ em-co
1271+ ~/ %emco
1272+ |= [[bas=@ min=@] [par=$+([? @ tape] tape)]]
1273+ |= hol=@
1274+ ^- tape
1275+ ?: &(=(0 hol) =(0 min))
1276+ rex
1277+ =+ [rad=(mod hol bas) dar=(div hol bas)]
1278+ %= $
1279+ min ?:(=(0 min) 0 (dec min))
1280+ hol dar
1281+ rex (par =(0 dar) rad rex)
1282+ ==
1283+ ::
1284+ ++ ox-co
1285+ ~/ %oxco
1286+ |= [[bas=@ gop=@] dug=$+(@ @)]
1287+ %+ em-co
1288+ [|-(?:(=(0 gop) 1 (mul bas $(gop (dec gop))))) 0]
1289+ |= [top=? seg=@ res=tape]
1290+ %+ weld
1291+ ?:(top ~ `tape`['.' ~])
1292+ %. seg
1293+ %+ em-co(rex res)
1294+ [bas ?:(top 0 gop)]
1295+ |=([? b=@ c=tape] [(dug b) c])
1296+ ::
1297+ ++ ro-co
1298+ ~/ %roco
1299+ |= [[buz=@ bas=@ dop=@] dug=$+(@ @)]
1300+ |= hol=@
1301+ ^- tape
1302+ ?: =(0 dop)
1303+ rex
1304+ => .(rex $(dop (dec dop)))
1305+ :- '.'
1306+ %- (em-co [bas 1] |=([? b=@ c=tape] [(dug b) c]))
1307+ [(cut buz [(dec dop) 1] hol)]
1308+ --
1309+ ::
1310+
1311+Examples
1312+--------
1313+
1314+ ~zod/try=> ~(rend co ~ %ux 200)
1315+ "0xc8"
1316+ ~zod/try=> ~(rend co %many ~[[%$ ux/200] [%$ p/40]])
1317+ "._0xc8_~~tem__"
1318+ ~zod/try=> ~(rend co ~ %p 32.819)
1319+ "~pillyt"
1320+ ~zod/try=> ~(rend co ~ %ux 18)
1321+ "0x12"
1322+ ~zod/try=> ~(rend co [~ p=[p=%if q=0x7f00.0001]])
1323+ ".127.0.0.1"
1324+ ~zod/try=> `@ux`.127.0.0.1
1325+ 2.130.706.433
1326+ ~zod/try=> ~(rend co %many ~[[~ %ud 20] [~ %uw 133] [~ %tas 'sam']])
1327+ "._20_0w25_sam__"
1328+ ~zod/try=> ~(rend co %blob [1 1])
1329+ "~0ph"
1330+ ~zod/try=> ~0ph
1331+ [1 1]
1332+ ~zod/try=> `@uv`(jam [1 1])
1333+ 0vph
1334+
1335+
1336+
1337+***