on 6d45ede help sign in
1268 lines 22 kB history raw
1---
2navhome: /docs
3---
6# 4k: atom printing
7### `++co`
9Literal rendering engine
11A door that contains arms that operate on the sample coin `lot`.
13Accepts
14-------
16Produces
17--------
19`lot` is a `++coin`.
21Source
22------
24 ++ co !.
25 ~% %co ..co ~
26 =< |_ lot/coin
29Examples
30--------
32 > < 3.nta
33 { lot/{$many {$~ $ta @t} {$~ $ud @ud} $~}
34 <10.cfg 4.jjn {rep/"" <402.arm 110.jyx 1.ztu $151>}>
35 }
36 >
38------------------------------------------------------------------------
40### `++rear`
42Prepend & render as tape
44Renders a coin `lot` as a tape prepended to the sample tape `rom`.
46Accepts
47-------
49Produces
50--------
52`rom` is a `pe`
54`lot` is a `++coin`.
56Source
57------
59 ++ rear |=(rom/tape =>(.(rex rom) rend))
61Examples
62--------
64 > (~(rear co %$ %ux 200) "--ha")
65 "0xc8--ha"
67------------------------------------------------------------------------
69### `++rent`
71Render as span
73Renders a coin `lot` as a span.
75Accepts
76-------
78Produces
79--------
81`lot` is a `++coin`.
83Source
84------
86 ++ rent `@ta`(rap 3 rend)
88Examples
89--------
91 > ~(rent co %$ %ux 200)
92 ~.0xc8
93 > `@t`~(rent co %$ %ux 200)
94 '0xc8'
96------------------------------------------------------------------------
98### `++rend`
100Render as tape
102Renders a coin `lot` as a tape.
104Accepts
105-------
107Produces
108--------
110`lot` is a `++coin`.
112Source
113------
115 ++ rend
116 ^- tape
117 ?: ?=($blob -.lot)
118 ['~' '0' ((v-co 1) (jam p.lot))]
119 ?: ?=($many -.lot)
120 :- '.'
121 |- ^- tape
122 ?~ p.lot
123 ['_' '_' rep]
124 ['_' (weld (trip (wack rent(lot i.p.lot))) $(p.lot t.p.lot))]
125 =+ [yed=(end 3 1 p.p.lot) hay=(cut 3 [1 1] p.p.lot)]
126 |- ^- tape
127 ?+ yed (z-co q.p.lot)
128 $c ['~' '-' (weld (rip 3 (wood (tuft q.p.lot))) rep)]
129 $d
130 ?+ hay (z-co q.p.lot)
131 $a
132 =+ yod=(yore q.p.lot)
133 => ^+(. .(rep ?~(f.t.yod rep ['.' (s-co f.t.yod)])))
134 => ^+ .
135 %= .
136 rep
137 ?: &(=(~ f.t.yod) =(0 h.t.yod) =(0 m.t.yod) =(0 s.t.yod))
138 rep
139 => .(rep ['.' (y-co s.t.yod)])
140 => .(rep ['.' (y-co m.t.yod)])
141 ['.' '.' (y-co h.t.yod)]
142 ==
143 => .(rep ['.' (a-co d.t.yod)])
144 => .(rep ['.' (a-co m.yod)])
145 => .(rep ?:(a.yod rep ['-' rep]))
146 ['~' (a-co y.yod)]
147 ::
148 $r
149 =+ yug=(yell q.p.lot)
150 => ^+(. .(rep ?~(f.yug rep ['.' (s-co f.yug)])))
151 :- '~'
152 ?: &(=(0 d.yug) =(0 m.yug) =(0 h.yug) =(0 s.yug))
153 ['s' '0' rep]
154 => ^+(. ?:(=(0 s.yug) . .(rep ['.' 's' (a-co s.yug)])))
155 => ^+(. ?:(=(0 m.yug) . .(rep ['.' 'm' (a-co m.yug)])))
156 => ^+(. ?:(=(0 h.yug) . .(rep ['.' 'h' (a-co h.yug)])))
157 => ^+(. ?:(=(0 d.yug) . .(rep ['.' 'd' (a-co d.yug)])))
158 +.rep
159 ==
160 ::
161 $f
162 ?: =(& q.p.lot)
163 ['.' 'y' rep]
164 ?:(=(| q.p.lot) ['.' 'n' rep] (z-co q.p.lot))
165 ::
166 $n ['~' rep]
167 $i
168 ?+ hay (z-co q.p.lot)
169 $f ((ro-co [3 10 4] |=(a/@ ~(d ne a))) q.p.lot)
170 $s ((ro-co [4 16 8] |=(a/@ ~(x ne a))) q.p.lot)
171 ==
172 ::
173 $p
174 =+ dyx=(met 3 q.p.lot)
175 :- '~'
176 ?: (lte dyx 1)
177 (weld (trip (tod:po q.p.lot)) rep)
178 ?: =(2 dyx)
179 ;: weld
180 (trip (tos:po (end 3 1 q.p.lot)))
181 (trip (tod:po (rsh 3 1 q.p.lot)))
182 rep
183 ==
184 =+ [dyz=(met 5 q.p.lot) fin=| dub=&]
185 |- ^- tape
186 ?: =(0 dyz)
187 rep
188 %= $
189 fin &
190 dub !dub
191 dyz (dec dyz)
192 q.p.lot (rsh 5 1 q.p.lot)
193 rep
194 =+ syb=(wren:un (end 5 1 q.p.lot))
195 =+ cog=~(zig mu [(rsh 4 1 syb) (end 4 1 syb)])
196 ;: weld
197 (trip (tos:po (end 3 1 p.cog)))
198 (trip (tod:po (rsh 3 1 p.cog)))
199 `tape`['-' ~]
200 (trip (tos:po (end 3 1 q.cog)))
201 (trip (tod:po (rsh 3 1 q.cog)))
202 `tape`?.(fin ~ ['-' ?.(dub ~ ['-' ~])])
203 rep
204 ==
205 ==
206 ::
207 $r
208 ?+ hay (z-co q.p.lot)
209 $d ['.' '~' (r-co (rlyd q.p.lot))]
210 $h ['.' '~' '~' (r-co (rlyh q.p.lot))]
211 $q ['.' '~' '~' '~' (r-co (rlyq q.p.lot))]
212 $s ['.' (r-co (rlys q.p.lot))]
213 ==
214 ::
215 $u
216 ?: ?=($c hay)
217 %+ welp ['0' 'c' (reap (pad:fa q.p.lot) '1')]
218 (c-co (enc:fa q.p.lot))
219 =- (weld p.gam ?:(=(0 q.p.lot) `tape`['0' ~] q.gam))
220 ^= gam ^- {p/tape q/tape}
221 ?+ hay [~ ((ox-co [10 3] |=(a/@ ~(d ne a))) q.p.lot)]
222 $b [['0' 'b' ~] ((ox-co [2 4] |=(a/@ ~(d ne a))) q.p.lot)]
223 $i [['0' 'i' ~] ((d-co 1) q.p.lot)]
224 $x [['0' 'x' ~] ((ox-co [16 4] |=(a/@ ~(x ne a))) q.p.lot)]
225 $v [['0' 'v' ~] ((ox-co [32 5] |=(a/@ ~(x ne a))) q.p.lot)]
226 $w [['0' 'w' ~] ((ox-co [64 5] |=(a/@ ~(w ne a))) q.p.lot)]
227 ==
228 ::
229 $s
230 %+ weld
231 ?:((syn:si q.p.lot) "--" "-")
232 $(yed 'u', q.p.lot (abs:si q.p.lot))
233 ::
234 $t
235 ?: =('a' hay)
236 ?: =('s' (cut 3 [2 1] p.p.lot))
237 (weld (rip 3 q.p.lot) rep)
238 ['~' '.' (weld (rip 3 q.p.lot) rep)]
239 ['~' '~' (weld (rip 3 (wood q.p.lot)) rep)]
240 ==
241 --
243Examples
244--------
246 > ~(rend co ~ %ux 200)
247 "0xc8"
248 > ~(rend co %many ~[[%$ ux+200] [%$ p+40]])
249 "._0xc8_~~tem__"
250 > ~(rend co ~ %p 32.819)
251 "~pillyt"
252 > ~(rend co ~ %ux 18)
253 "0x12"
254 > ~(rend co [~ p=[p=%if q=0x7f00.0001]])
255 ".127.0.0.1"
256 > `@ux`.127.0.0.1
257 2.130.706.433
258 > ~(rend co %many ~[[~ %ud 20] [~ %uw 133] [~ %tas 'sam']])
259 "._20_0w25_sam__"
260 > ~(rend co %blob [1 1])
261 "~0ph"
262 > ~0ph
263 [1 1]
264 > `@uv`(jam [1 1])
265 0vph
269***
270### `++alf`
272Alphabetic characters
274Parse alphabetic characters, both upper and lowercase.
276Source
277------
279 ++ alf ;~(pose low hig) :: alphabetic
281Examples
282--------
284 > (scan "a" alf)
285 ~~a
286 > (scan "A" alf)
287 ~~~41.
288 > (scan "AaBbCc" (star alf))
289 "AaBbCc"
293***
294### `++aln`
296Alphanumeric characters
298Parse alphanumeric characters - both alphabetic characters and numbers.
300Source
301------
303 ++ aln ;~(pose low hig nud) :: alphanumeric
305Examples
306--------
308 > (scan "0" aln)
309 ~~0
310 > (scan "alf42" (star aln))
311 "alf42"
312 > (scan "0123456789abcdef" (star aln))
313 "0123456789abcdef"
317***
318### `++alp`
320Alphanumeric and `-`
322Parse alphanumeric strings and hep, "-".
324Source
325------
327 ++ alp ;~(pose low hig nud hep) :: alphanumeric and -
329Examples
330--------
332 > (scan "7" alp)
333 ~~7
334 > (scan "s" alp)
335 ~~s
336 > (scan "123abc-" (star alp))
337 "123abc-"
341***
343### `++bet`
345Axis syntax `-`, `+`
347Parse the hep and lus axis syntax.
349Source
350------
352 ++ bet ;~(pose (cold 2 hep) (cold 3 lus)) :: axis syntax - +
354Examples
355--------
357 > (scan "-" bet)
358 2
359 > (scan "+" bet)
360 3
364***
365### `++bin`
367Binary to atom
369Parse a tape of binary (0s and 1s) and produce its atomic representation.
371Source
372------
374 ++ bin (bass 2 (most gon but)) :: binary to atom
376Examples
377--------
379 > (scan "0000" bin)
380 0
381 > (scan "0001" bin)
382 1
383 > (scan "0010" bin)
384 2
385 > (scan "100000001111" bin)
386 2.063
390***
391### `++but`
393Binary digit
395Parse a single binary digit.
397Source
398------
400 ++ but (cook |=(a=@ (sub a '0')) (shim '0' '1')) :: binary digit
402Examples
403--------
405 > (scan "0" but)
406 0
407 > (scan "1" but)
408 1
409 > (scan "01" but)
410 ! {1 2}
411 ! 'syntax-error'
412 ! exit
413 > (scan "01" (star but))
414 ~[0 1]
418***
419### `++cit`
421Octal digit
423Parse a single octal digit.
425Source
426------
428 ++ cit (cook |=(a=@ (sub a '0')) (shim '0' '7')) :: octal digit
430Examples
431--------
433 > (scan "1" cit)
434 1
435 > (scan "7" cit)
436 7
437 > (scan "8" cit)
438 ! {1 1}
439 ! 'syntax-error'
440 ! exit
441 > (scan "60" (star cit))
442 ~[6 0]
446***
447### `++dem`
449Decimal to atom
451Parse a decimal number to an atom.
453Source
454------
456 ++ dem (bass 10 (most gon dit)) :: decimal to atom
458Examples
459--------
461 > (scan "7" dem)
462 7
463 > (scan "42" dem)
464 42
465 > (scan "150000000" dem)
466 150.000.000
467 > (scan "12456" dem)
468 12.456
472***
473### `++dit`
475Decimal digit
477Parse a single decimal digit.
479Source
480------
482 ++ dit (cook |=(a=@ (sub a '0')) (shim '0' '9')) :: decimal digit
484Examples
485--------
487 > (scan "7" dit)
488 7
489 > (scan "42" (star dit))
490 ~[4 2]
491 > (scan "26000" (star dit))
492 ~[2 6 0 0 0]
496***
497### `++dog`
499`.` optional gap
501Dot followed by an optional gap, used with numbers.
503Source
504------
506 ++ dog ;~(plug dot gay) ::
508Examples
509--------
511 /> 1.234.
512 703
513 1.234.703
514 > (scan "a. " ;~(pfix alf dog))
515 [~~~. ~]
519***
520### `++doh`
522`@p` separator
524Phonetic base phrase separator
526Source
527------
529 ++ doh ;~(plug ;~(plug hep hep) gay) ::
531Examples
532--------
534 /> ~nopfel-botduc-nilnev-dolfyn--haspub-natlun-lodmur-holtyd
535 ~nopfel-botduc-nilnev-dolfyn--haspub-natlun-lodmur-holtyd
536 /> ~nopfel-botduc-nilnev-dolfyn--
537 haspub-natlun-lodmur-holtyd
538 ~nopfel-botduc-nilnev-dolfyn--haspub-natlun-lodmur-holtyd
539 > (scan "--" doh)
540 [[~~- ~~-] ~]
541 > (scan "-- " doh)
542 [[~~- ~~-] ~]
546***
547### `++dun`
549`--` to `~`
551Parse phep, `--`, to null, `~`.
553Source
554------
556 ++ dun (cold ~ ;~(plug hep hep)) :: -- (phep) to ~
558Examples
559--------
561 > (scan "--" dun)
562 ~
563 > (dun [[1 1] "--"])
564 [p=[p=1 q=3] q=[~ u=[p=~ q=[p=[p=1 q=3] q=""]]]]
568***
570### `++duz`
572`==` to `~`
574Parse stet, `==`, to null `~`.
576Source
577------
579 ++ duz (cold ~ ;~(plug tis tis)) :: == (stet) to ~
581Examples
582--------
584 > (scan "==" duz)
585 ~
586 > (duz [[1 1] "== |=..."])
587 [p=[p=1 q=3] q=[~ u=[p=~ q=[p=[p=1 q=3] q=" |=..."]]]]
591***
593### `++gah`
595Newline or ' '
597Whitespace component, either newline or space.
599Source
600------
602 ++ gah (mask [`@`10 ' ' ~]) :: newline or ace
604Examples
605--------
607 /> ^- * :: show spaces
608 """
609 -
610 -
611 -
612 """
613 [32 32 32 45 10 32 45 10 32 32 45 0]
614 /> ^- *
615 """
617 """
618 [32 32 32 10 32 10 32 32 0]
619 /> ^- (list ,@)
620 %- scan :_ (star gah)
621 """
623 """
624 ~[32 32 32 10 32 10 32 32]
628***
629### `++gap`
631Plural whitespace
633Separates tall runes
635Source
636------
638 ++ gap (cold ~ ;~(plug gaq (star ;~(pose vul gah)))) :: plural whitespace
642***
643### `++gaq`
645End of line
647Two spaces, a newline, or comment.
649Source
650------
652 ++ gaq ;~ pose :: end of line
653 (just `@`10)
654 ;~(plug gah ;~(pose gah vul))
655 vul
656 ==
661***
662### `++gaw`
664Classic whitespace
666Terran whitespace.
668Source
669------
671 ++ gaw (cold ~ (star ;~(pose vul gah))) :: classic white
675***
676### `++gay`
678Optional gap
680Optional gap.
682Source
683------
685 ++ gay ;~(pose gap (easy ~)) ::
689***
690### `++gon`
692Long numbers
694Parse long numbers - Numbers which wrap around the shell with the line
696Source
697------
699break ++ gon ;~(pose ;~(plug bas gay fas) (easy ~)) :: long numbers \ /
701Examples
702--------
703characters bas and fas.
705 > (scan "\\/" gon)
706 [~~~5c. ~ ~~~2f.]
707 > (gon [[1 1] "\\/"])
708 [p=[p=1 q=3] q=[~ u=[p=[~~~5c. ~ ~~~2f.] q=[p=[p=1 q=3] q=""]]]]
712***
713### `++gul`
715Axis syntax `<` or `>`
717Parse the axis gal and gar axis syntax.
719Source
720------
722 ++ gul ;~(pose (cold 2 gal) (cold 3 gar)) :: axis syntax < >
724Examples
725--------
727 > (scan "<" gul)
728 2
729 > (scan ">" gul)
730 3
734***
735### `++hex`
737Hex to atom
739Parse any hexadecimal number to an atom.
741Source
742------
744 ++ hex (bass 16 (most gon hit)) :: hex to atom
746Examples
747--------
749 > (scan "a" hex)
750 10
751 > (scan "A" hex)
752 10
753 > (scan "2A" hex)
754 42
755 > (scan "1ee7" hex)
756 7.911
757 > (scan "1EE7" hex)
758 7.911
759 > (scan "1EE7F7" hex)
760 2.025.463
761 > `@ux`(scan "1EE7F7" hex)
762 0x1e.e7f7
765***
766### `++hig`
768Uppercase
770Parse a single uppercase letter.
772Source
773------
775 ++ hig (shim 'A' 'Z') :: uppercase
777Examples
778--------
780 > (scan "G" hig)
781 ~~~47.
782 > `cord`(scan "G" hig)
783 'G'
784 > (scan "ABCDEFGHIJKLMNOPQRSTUVWXYZ" (star hig))
785 "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
786 > (hig [[1 1] "G"])
787 [p=[p=1 q=2] q=[~ [p=~~~47. q=[p=[p=1 q=2] q=""]]]]
791***
792### `++hit`
794Hex digits
796Parse a single hexadecimal digit.
798Source
799------
801 ++ hit ;~ pose :: hex digits
802 dit
803 (cook |=(a=char (sub a 87)) (shim 'a' 'f'))
804 (cook |=(a=char (sub a 55)) (shim 'A' 'F'))
805 ==
807Examples
808--------
810 > (scan "a" hit)
811 10
812 > (scan "A" hit)
813 10
814 > (hit [[1 1] "a"])
815 [p=[p=1 q=2] q=[~ [p=10 q=[p=[p=1 q=2] q=""]]]]
816 > (scan "2A" (star hit))
817 ~[2 10]
820***
821### `++iny`
823Indentation block
825Apply `++rule` to indented block starting at current column number, omitting
826the leading whitespace.
828Accepts
829-------
831`sef` is a `++rule`
833Produces
834--------
836A `++rule`.
838Source
839------
841 ++ inde |* sef/rule :: indentation block
842 |= nail ^+ (sef)
843 =+ [har tap]=[p q]:+<
844 =+ lev=(fil 3 (dec q.har) ' ')
845 =+ eol=(just `@t`10)
846 =+ =- roq=((star ;~(pose prn ;~(sfix eol (jest lev)) -)) har tap)
847 ;~(simu ;~(plug eol eol) eol)
848 ?~ q.roq roq
849 =+ vex=(sef har(q 1) p.u.q.roq)
850 =+ fur=p.vex(q (add (dec q.har) q.p.vex))
851 ?~ q.vex vex(p fur)
852 =- vex(p fur, u.q -)
853 :+ &3.vex
854 &4.vex(q.p (add (dec q.har) q.p.&4.vex))
855 =+ res=|4.vex
856 |- ?~ res |4.roq
857 ?. =(10 -.res) [-.res $(res +.res)]
858 (welp [`@t`10 (trip lev)] $(res +.res))
859 ::
861Examples
862--------
864 > (scan "abc" (iny (star ;~(pose prn (just `@`10)))))
865 "abc"
866 > (scan "abc" (star ;~(pose prn (just `@`10))))
867 "abc"
868 > (scan " abc\0ade" ;~(pfix ace ace (star ;~(pose prn (just `@`10)))))
869 "abc
870 de"
871 > (scan " abc\0ade" ;~(pfix ace ace (iny (star ;~(pose prn (just `@`10))))))
872 ! {1 6}
873 ! exit
874 > (scan " abc\0a de" ;~(pfix ace ace (iny (star ;~(pose prn (just `@`10))))))
875 "abc
876 de"
880***
881### `++low`
883Lowercase
885Parse a single lowercase letter.
887Source
888------
890 ++ low (shim 'a' 'z') :: lowercase
892Examples
893--------
895 > (scan "g" low)
896 ~~g
897 > `cord`(scan "g" low)
898 'g'
899 > (scan "abcdefghijklmnopqrstuvwxyz" (star low))
900 "abcdefghijklmnopqrstuvwxyz"
901 > (low [[1 1] "g"])
902 [p=[p=1 q=2] q=[~ [p=~~g q=[p=[p=1 q=2] q=""]]]]
906***
907### `++mes`
909Hexbyte
911Parse a hexbyte.
913Source
914------
916 ++ mes %+ cook :: hexbyte
917 |=({a/@ b/@} (add (mul 16 a) b))
918 ;~(plug hit hit)
920Examples
921--------
923 > (scan "2A" mes)
924 42
925 > (mes [[1 1] "2A"])
926 [p=[p=1 q=3] q=[~ u=[p=42 q=[p=[p=1 q=3] q=""]]]]
927 > (scan "42" mes)
928 66
932***
933### `++nix`
935Letters and `-`
937Parse Letters and `-`.
939Source
940------
942 ++ nix (boss 256 (star ;~(pose aln cab))) ::
944Examples
945--------
947 > (scan "as_me" nix)
948 q=435.626.668.897
949 > `@t`(scan "as_me" nix)
950 'as_me'
954***
956### `++nud`
958Numeric
960Parse a numeric character - A number.
962Source
963------
965 ++ nud (shim '0' '9') :: numeric
967Examples
968--------
970 > (scan "0" nud)
971 ~~0
972 > (scan "7" nud)
973 ~~7
974 > (nud [[1 1] "1"])
975 [p=[p=1 q=2] q=[~ [p=~~1 q=[p=[p=1 q=2] q=""]]]]
976 > (scan "0123456789" (star nud))
977 "0123456789"
980***
981### `++prn`
983Printable character
985Parse any printable character.
987Source
988------
990 ++ prn ;~(less (just `@`127) (shim 32 256))
992Examples
993--------
995 > (scan "h" prn)
996 ~~h
997 > (scan "!" prn)
998 ~~~21.
999 > (scan "\01" prn)
1000 ! {1 1}
1001 ! exit
1005***
1006### `++qit`
1008Chars in cord
1010Parse an individual character to its cord atom representation.
1012Source
1013------
1015 ++ qit ;~ pose :: chars in a cord
1016 ;~(less bas soq prn)
1017 ;~(pfix bas ;~(pose bas soq mes)) :: escape chars
1018 ==
1020Examples
1021--------
1023 > (scan "%" qit)
1024 37
1025 > `@t`(scan "%" qit)
1026 '%'
1027 > (scan "0" qit)
1028 48
1029 > (scan "E" qit)
1030 69
1031 > (scan "a" qit)
1032 97
1033 > (scan "\\0a" qit)
1034 10
1035 > `@ux`(scan "\\0a" qit)
1036 0xa
1037 > (scan "cord" (star qit))
1038 ~[99 111 114 100]
1042***
1043### `++qit`
1045Chars in cord
1047Parse an individual character to its cord atom representation.
1049Source
1050------
1052 ++ qit ;~ pose :: chars in a cord
1053 ;~(less bas soq prn)
1054 ;~(pfix bas ;~(pose bas soq mes)) :: escape chars
1055 ==
1057Examples
1058--------
1060 > (scan "%" qit)
1061 37
1062 > `@t`(scan "%" qit)
1063 '%'
1064 > (scan "0" qit)
1065 48
1066 > (scan "E" qit)
1067 69
1068 > (scan "a" qit)
1069 97
1070 > (scan "\\0a" qit)
1071 10
1072 > `@ux`(scan "\\0a" qit)
1073 0xa
1074 > (scan "cord" (star qit))
1075 ~[99 111 114 100]
1080***
1081### `++qut`
1083Cord
1085Parse single-soq cord with `\{gap}/` anywhere in the middle, or triple-single
1086quote (aka triple-soq) cord, between which must be in an indented block.
1088Source
1089------
1091 ++ qut ;~ pose :: cord
1092 ;~ less soqs
1093 (ifix [soq soq] (boss 256 (more gon qit)))
1094 ==
1095 %- inde %+ ifix
1096 :- ;~ plug soqs
1097 ;~(pose ;~(plug (plus ace) vul) (just '\0a'))
1098 ==
1099 ;~(plug (just '\0a') soqs)
1100 (boss 256 (star qat))
1101 ==
1102 ::
1104Examples
1105--------
1107 > (scan "'cord'" qut)
1108 q=1.685.221.219
1109 > 'cord'
1110 'cord'
1111 > `@ud`'cord'
1112 1.685.221.219
1113 /> '''
1114 Heredoc isn't prohibited from containing quotes
1115 '''
1116 'Heredoc isn't prohibited from containing quotes'
1120***
1121### `++soz`
1123Delimiting `'''`
1125Parse a triple-single quote, used for multiline strings.
1127Source
1128------
1130 ++ soz ;~(plug soq soq soq) :: delimiting '''
1132Examples
1133--------
1135 > (scan "'''" soz)
1136 [~~~27. ~~~27. ~~~27.]
1137 > (rash '"""' soz)
1138 ! {1 1}
1139 ! exit
1143***
1144### `++sym`
1146Term
1148A term: a letter(lowercase), followed by letters, numbers, or `-`.
1150Source
1151------
1153 ++ sym
1154 %+ cook
1155 |=(a=tape (rap 3 ^-((list ,@) a)))
1156 ;~(plug low (star ;~(pose nud low hep)))
1157 ::
1159Examples
1160--------
1162 > (scan "sam-2" sym)
1163 215.510.507.891
1164 > `@t`(scan "sam-2" sym)
1165 'sam-2'
1166 > (scan "sym" sym)
1167 7.174.515
1171***
1172### `++ven`
1174`+>-` axis syntax
1176Axis syntax parser
1178Source
1179------
1181 ++ ven ;~ (comp |=({a/@ b/@} (peg a b))) :: +>- axis syntax
1182 bet
1183 =+ hom=`?`|
1184 |= tub/nail
1185 ^- (like axis)
1186 =+ vex=?:(hom (bet tub) (gul tub))
1187 ?~ q.vex
1188 [p.tub [~ 1 tub]]
1189 =+ wag=$(p.tub p.vex, hom !hom, tub q.u.q.vex)
1190 ?> ?=(^ q.wag)
1191 [p.wag [~ (peg p.u.q.vex p.u.q.wag) q.u.q.wag]]
1192 ==
1194Examples
1195--------
1197 ~zod/arvo=/hoon/hoon> (scan "->+" ven)
1198 11
1199 ~zod/arvo=/hoon/hoon> `@ub`(scan "->+" ven)
1200 0b1011
1201 ~zod/arvo=/hoon/hoon> (peg (scan "->" ven) (scan "+" ven))
1202 11
1203 ~zod/arvo=/hoon/hoon> ->+:[[1 2 [3 4]] 5]
1204 [3 4]
1208***
1209### `++vit`
1211Base64 digit
1213Parse a standard base64 digit.
1215Source
1216------
1218 ++ vit :: base64 digit
1219 ;~ pose
1220 (cook |=(a/@ (sub a 65)) (shim 'A' 'Z'))
1221 (cook |=(a/@ (sub a 71)) (shim 'a' 'z'))
1222 (cook |=(a/@ (add a 4)) (shim '0' '9'))
1223 (cold 62 (just '-'))
1224 (cold 63 (just '+'))
1225 ==
1227Examples
1228--------
1230 ~zod/arvo=/hoon/hoon> (scan "C" vit)
1232 ~zod/arvo=/hoon/hoon> (scan "c" vit)
1233 28
1234 ~zod/arvo=/hoon/hoon> (scan "2" vit)
1235 54
1236 ~zod/arvo=/hoon/hoon> (scan "-" vit)
1237 62
1240***
1241### `++vul`
1243Comments to null
1245Source
1246------
1248 ++ vul %+ cold ~ :: comments
1249 ;~ plug col col
1250 (star prn)
1251 (just `@`10)
1252 ==
1254Parse comments and produce a null. Note that a comment must be ended
1255with a newline character.
1257Examples
1258--------
1260 > (scan "::this is a comment \0a" vul)
1262 > (scan "::this is a comment " vul)
1263 ! {1 21}
1264 ! exit
1268***