4Literal rendering engine
6A door that contains arms that operate on the sample coin `lot`.
28 { lot/{$many {$~ $ta @t} {$~ $ud @ud} $~}
29 <10.cfg 4.jjn {rep/"" <402.arm 110.jyx 1.ztu $151>}>
33------------------------------------------------------------------------
37Prepend & render as tape
39Renders a coin `lot` as a tape prepended to the sample tape `rom`.
54 ++ rear |=(rom/tape =>(.(rex rom) rend))
59 > (~(rear co %$ %ux 200) "--ha")
62------------------------------------------------------------------------
68Renders a coin `lot` as a span.
81 ++ rent `@ta`(rap 3 rend)
86 > ~(rent co %$ %ux 200)
88 > `@t`~(rent co %$ %ux 200)
91------------------------------------------------------------------------
97Renders a coin `lot` as a tape.
113 ['~' '0' ((v-co 1) (jam p.lot))]
119 ['_' (weld (trip (wack rent(lot i.p.lot))) $(p.lot t.p.lot))]
120 =+ [yed=(end 3 1 p.p.lot) hay=(cut 3 [1 1] p.p.lot)]
122 ?+ yed (z-co q.p.lot)
123 $c ['~' '-' (weld (rip 3 (wood (tuft q.p.lot))) rep)]
125 ?+ hay (z-co q.p.lot)
127 =+ yod=(yore q.p.lot)
128 => ^+(. .(rep ?~(f.t.yod rep ['.' (s-co f.t.yod)])))
132 ?: &(=(~ f.t.yod) =(0 h.t.yod) =(0 m.t.yod) =(0 s.t.yod))
134 => .(rep ['.' (y-co s.t.yod)])
135 => .(rep ['.' (y-co m.t.yod)])
136 ['.' '.' (y-co h.t.yod)]
138 => .(rep ['.' (a-co d.t.yod)])
139 => .(rep ['.' (a-co m.yod)])
140 => .(rep ?:(a.yod rep ['-' rep]))
144 =+ yug=(yell q.p.lot)
145 => ^+(. .(rep ?~(f.yug rep ['.' (s-co f.yug)])))
147 ?: &(=(0 d.yug) =(0 m.yug) =(0 h.yug) =(0 s.yug))
149 => ^+(. ?:(=(0 s.yug) . .(rep ['.' 's' (a-co s.yug)])))
150 => ^+(. ?:(=(0 m.yug) . .(rep ['.' 'm' (a-co m.yug)])))
151 => ^+(. ?:(=(0 h.yug) . .(rep ['.' 'h' (a-co h.yug)])))
152 => ^+(. ?:(=(0 d.yug) . .(rep ['.' 'd' (a-co d.yug)])))
159 ?:(=(| q.p.lot) ['.' 'n' rep] (z-co q.p.lot))
163 ?+ hay (z-co q.p.lot)
164 $f ((ro-co [3 10 4] |=(a/@ ~(d ne a))) q.p.lot)
165 $s ((ro-co [4 16 8] |=(a/@ ~(x ne a))) q.p.lot)
169 =+ dyx=(met 3 q.p.lot)
172 (weld (trip (tod:po q.p.lot)) rep)
175 (trip (tos:po (end 3 1 q.p.lot)))
176 (trip (tod:po (rsh 3 1 q.p.lot)))
179 =+ [dyz=(met 5 q.p.lot) fin=| dub=&]
187 q.p.lot (rsh 5 1 q.p.lot)
189 =+ syb=(wren:un (end 5 1 q.p.lot))
190 =+ cog=~(zig mu [(rsh 4 1 syb) (end 4 1 syb)])
192 (trip (tos:po (end 3 1 p.cog)))
193 (trip (tod:po (rsh 3 1 p.cog)))
195 (trip (tos:po (end 3 1 q.cog)))
196 (trip (tod:po (rsh 3 1 q.cog)))
197 `tape`?.(fin ~ ['-' ?.(dub ~ ['-' ~])])
203 ?+ hay (z-co q.p.lot)
204 $d ['.' '~' (r-co (rlyd q.p.lot))]
205 $h ['.' '~' '~' (r-co (rlyh q.p.lot))]
206 $q ['.' '~' '~' '~' (r-co (rlyq q.p.lot))]
207 $s ['.' (r-co (rlys q.p.lot))]
212 %+ welp ['0' 'c' (reap (pad:fa q.p.lot) '1')]
213 (c-co (enc:fa q.p.lot))
214 =- (weld p.gam ?:(=(0 q.p.lot) `tape`['0' ~] q.gam))
215 ^= gam ^- {p/tape q/tape}
216 ?+ hay [~ ((ox-co [10 3] |=(a/@ ~(d ne a))) q.p.lot)]
217 $b [['0' 'b' ~] ((ox-co [2 4] |=(a/@ ~(d ne a))) q.p.lot)]
218 $i [['0' 'i' ~] ((d-co 1) q.p.lot)]
219 $x [['0' 'x' ~] ((ox-co [16 4] |=(a/@ ~(x ne a))) q.p.lot)]
220 $v [['0' 'v' ~] ((ox-co [32 5] |=(a/@ ~(x ne a))) q.p.lot)]
221 $w [['0' 'w' ~] ((ox-co [64 5] |=(a/@ ~(w ne a))) q.p.lot)]
226 ?:((syn:si q.p.lot) "--" "-")
227 $(yed 'u', q.p.lot (abs:si q.p.lot))
231 ?: =('s' (cut 3 [2 1] p.p.lot))
232 (weld (rip 3 q.p.lot) rep)
233 ['~' '.' (weld (rip 3 q.p.lot) rep)]
234 ['~' '~' (weld (rip 3 (wood q.p.lot)) rep)]
241 > ~(rend co ~ %ux 200)
243 > ~(rend co %many ~[[%$ ux+200] [%$ p+40]])
245 > ~(rend co ~ %p 32.819)
247 > ~(rend co ~ %ux 18)
249 > ~(rend co [~ p=[p=%if q=0x7f00.0001]])
253 > ~(rend co %many ~[[~ %ud 20] [~ %uw 133] [~ %tas 'sam']])
255 > ~(rend co %blob [1 1])
269Parse alphabetic characters, both upper and lowercase.
274 ++ alf ;~(pose low hig) :: alphabetic
283 > (scan "AaBbCc" (star alf))
291Alphanumeric characters
293Parse alphanumeric characters - both alphabetic characters and numbers.
298 ++ aln ;~(pose low hig nud) :: alphanumeric
305 > (scan "alf42" (star aln))
307 > (scan "0123456789abcdef" (star aln))
317Parse alphanumeric strings and hep, "-".
322 ++ alp ;~(pose low hig nud hep) :: alphanumeric and -
331 > (scan "123abc-" (star alp))
342Parse the hep and lus axis syntax.
347 ++ bet ;~(pose (cold 2 hep) (cold 3 lus)) :: axis syntax - +
364Parse a tape of binary (0s and 1s) and produce its atomic representation.
369 ++ bin (bass 2 (most gon but)) :: binary to atom
380 > (scan "100000001111" bin)
390Parse a single binary digit.
395 ++ but (cook |=(a=@ (sub a '0')) (shim '0' '1')) :: binary digit
408 > (scan "01" (star but))
418Parse a single octal digit.
423 ++ cit (cook |=(a=@ (sub a '0')) (shim '0' '7')) :: octal digit
436 > (scan "60" (star cit))
446Parse a decimal number to an atom.
451 ++ dem (bass 10 (most gon dit)) :: decimal to atom
460 > (scan "150000000" dem)
472Parse a single decimal digit.
477 ++ dit (cook |=(a=@ (sub a '0')) (shim '0' '9')) :: decimal digit
484 > (scan "42" (star dit))
486 > (scan "26000" (star dit))
496Dot followed by an optional gap, used with numbers.
501 ++ dog ;~(plug dot gay) ::
509 > (scan "a. " ;~(pfix alf dog))
519Phonetic base phrase separator
524 ++ doh ;~(plug ;~(plug hep hep) gay) ::
529 /> ~nopfel-botduc-nilnev-dolfyn--haspub-natlun-lodmur-holtyd
530 ~nopfel-botduc-nilnev-dolfyn--haspub-natlun-lodmur-holtyd
531 /> ~nopfel-botduc-nilnev-dolfyn--
532 haspub-natlun-lodmur-holtyd
533 ~nopfel-botduc-nilnev-dolfyn--haspub-natlun-lodmur-holtyd
546Parse phep, `--`, to null, `~`.
551 ++ dun (cold ~ ;~(plug hep hep)) :: -- (phep) to ~
559 [p=[p=1 q=3] q=[~ u=[p=~ q=[p=[p=1 q=3] q=""]]]]
569Parse stet, `==`, to null `~`.
574 ++ duz (cold ~ ;~(plug tis tis)) :: == (stet) to ~
581 > (duz [[1 1] "== |=..."])
582 [p=[p=1 q=3] q=[~ u=[p=~ q=[p=[p=1 q=3] q=" |=..."]]]]
592Whitespace component, either newline or space.
597 ++ gah (mask [`@`10 ' ' ~]) :: newline or ace
602 /> ^- * :: show spaces
608 [32 32 32 45 10 32 45 10 32 32 45 0]
613 [32 32 32 10 32 10 32 32 0]
615 %- scan :_ (star gah)
619 ~[32 32 32 10 32 10 32 32]
633 ++ gap (cold ~ ;~(plug gaq (star ;~(pose vul gah)))) :: plural whitespace
642Two spaces, a newline, or comment.
647 ++ gaq ;~ pose :: end of line
649 ;~(plug gah ;~(pose gah vul))
666 ++ gaw (cold ~ (star ;~(pose vul gah))) :: classic white
680 ++ gay ;~(pose gap (easy ~)) ::
689Parse long numbers - Numbers which wrap around the shell with the line
694break ++ gon ;~(pose ;~(plug bas gay fas) (easy ~)) :: long numbers \ /
698characters bas and fas.
702 > (gon [[1 1] "\\/"])
703 [p=[p=1 q=3] q=[~ u=[p=[~~~5c. ~ ~~~2f.] q=[p=[p=1 q=3] q=""]]]]
710Axis syntax `<` or `>`
712Parse the axis gal and gar axis syntax.
717 ++ gul ;~(pose (cold 2 gal) (cold 3 gar)) :: axis syntax < >
734Parse any hexadecimal number to an atom.
739 ++ hex (bass 16 (most gon hit)) :: hex to atom
754 > (scan "1EE7F7" hex)
756 > `@ux`(scan "1EE7F7" hex)
765Parse a single uppercase letter.
770 ++ hig (shim 'A' 'Z') :: uppercase
777 > `cord`(scan "G" hig)
779 > (scan "ABCDEFGHIJKLMNOPQRSTUVWXYZ" (star hig))
780 "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
782 [p=[p=1 q=2] q=[~ [p=~~~47. q=[p=[p=1 q=2] q=""]]]]
791Parse a single hexadecimal digit.
796 ++ hit ;~ pose :: hex digits
798 (cook |=(a=char (sub a 87)) (shim 'a' 'f'))
799 (cook |=(a=char (sub a 55)) (shim 'A' 'F'))
810 [p=[p=1 q=2] q=[~ [p=10 q=[p=[p=1 q=2] q=""]]]]
811 > (scan "2A" (star hit))
820Apply `++rule` to indented block starting at current column number, omitting
821the leading whitespace.
836 ++ inde |* sef/rule :: indentation block
838 =+ [har tap]=[p q]:+<
839 =+ lev=(fil 3 (dec q.har) ' ')
841 =+ =- roq=((star ;~(pose prn ;~(sfix eol (jest lev)) -)) har tap)
842 ;~(simu ;~(plug eol eol) eol)
844 =+ vex=(sef har(q 1) p.u.q.roq)
845 =+ fur=p.vex(q (add (dec q.har) q.p.vex))
849 &4.vex(q.p (add (dec q.har) q.p.&4.vex))
852 ?. =(10 -.res) [-.res $(res +.res)]
853 (welp [`@t`10 (trip lev)] $(res +.res))
859 > (scan "abc" (iny (star ;~(pose prn (just `@`10)))))
861 > (scan "abc" (star ;~(pose prn (just `@`10))))
863 > (scan " abc\0ade" ;~(pfix ace ace (star ;~(pose prn (just `@`10)))))
866 > (scan " abc\0ade" ;~(pfix ace ace (iny (star ;~(pose prn (just `@`10))))))
869 > (scan " abc\0a de" ;~(pfix ace ace (iny (star ;~(pose prn (just `@`10))))))
880Parse a single lowercase letter.
885 ++ low (shim 'a' 'z') :: lowercase
892 > `cord`(scan "g" low)
894 > (scan "abcdefghijklmnopqrstuvwxyz" (star low))
895 "abcdefghijklmnopqrstuvwxyz"
897 [p=[p=1 q=2] q=[~ [p=~~g q=[p=[p=1 q=2] q=""]]]]
911 ++ mes %+ cook :: hexbyte
912 |=({a/@ b/@} (add (mul 16 a) b))
921 [p=[p=1 q=3] q=[~ u=[p=42 q=[p=[p=1 q=3] q=""]]]]
932Parse Letters and `-`.
937 ++ nix (boss 256 (star ;~(pose aln cab))) ::
944 > `@t`(scan "as_me" nix)
955Parse a numeric character - A number.
960 ++ nud (shim '0' '9') :: numeric
970 [p=[p=1 q=2] q=[~ [p=~~1 q=[p=[p=1 q=2] q=""]]]]
971 > (scan "0123456789" (star nud))
980Parse any printable character.
985 ++ prn ;~(less (just `@`127) (shim 32 256))
1005Parse an individual character to its cord atom representation.
1010 ++ qit ;~ pose :: chars in a cord
1011 ;~(less bas soq prn)
1012 ;~(pfix bas ;~(pose bas soq mes)) :: escape chars
1020 > `@t`(scan "%" qit)
1030 > `@ux`(scan "\\0a" qit)
1032 > (scan "cord" (star qit))
1042Parse an individual character to its cord atom representation.
1047 ++ qit ;~ pose :: chars in a cord
1048 ;~(less bas soq prn)
1049 ;~(pfix bas ;~(pose bas soq mes)) :: escape chars
1057 > `@t`(scan "%" qit)
1067 > `@ux`(scan "\\0a" qit)
1069 > (scan "cord" (star qit))
1080Parse single-soq cord with `\{gap}/` anywhere in the middle, or triple-single
1081quote (aka triple-soq) cord, between which must be in an indented block.
1086 ++ qut ;~ pose :: cord
1088 (ifix [soq soq] (boss 256 (more gon qit)))
1092 ;~(pose ;~(plug (plus ace) vul) (just '\0a'))
1094 ;~(plug (just '\0a') soqs)
1095 (boss 256 (star qat))
1102 > (scan "'cord'" qut)
1109 Heredoc isn't prohibited from containing quotes
1111 'Heredoc isn't prohibited from containing quotes'
1120Parse a triple-single quote, used for multiline strings.
1125 ++ soz ;~(plug soq soq soq) :: delimiting '''
1131 [~~~27. ~~~27. ~~~27.]
1143A term: a letter(lowercase), followed by letters, numbers, or `-`.
1150 |=(a=tape (rap 3 ^-((list ,@) a)))
1151 ;~(plug low (star ;~(pose nud low hep)))
1157 > (scan "sam-2" sym)
1159 > `@t`(scan "sam-2" sym)
1176 ++ ven ;~ (comp |=({a/@ b/@} (peg a b))) :: +>- axis syntax
1181 =+ vex=?:(hom (bet tub) (gul tub))
1184 =+ wag=$(p.tub p.vex, hom !hom, tub q.u.q.vex)
1186 [p.wag [~ (peg p.u.q.vex p.u.q.wag) q.u.q.wag]]
1192 ~zod/arvo=/hoon/hoon> (scan "->+" ven)
1194 ~zod/arvo=/hoon/hoon> `@ub`(scan "->+" ven)
1196 ~zod/arvo=/hoon/hoon> (peg (scan "->" ven) (scan "+" ven))
1198 ~zod/arvo=/hoon/hoon> ->+:[[1 2 [3 4]] 5]
1208Parse a standard base64 digit.
1213 ++ vit :: base64 digit
1215 (cook |=(a/@ (sub a 65)) (shim 'A' 'Z'))
1216 (cook |=(a/@ (sub a 71)) (shim 'a' 'z'))
1217 (cook |=(a/@ (add a 4)) (shim '0' '9'))
1218 (cold 62 (just '-'))
1219 (cold 63 (just '+'))
1225 ~zod/arvo=/hoon/hoon> (scan "C" vit)
1227 ~zod/arvo=/hoon/hoon> (scan "c" vit)
1229 ~zod/arvo=/hoon/hoon> (scan "2" vit)
1231 ~zod/arvo=/hoon/hoon> (scan "-" vit)
1243 ++ vul %+ cold ~ :: comments
1249Parse comments and produce a null. Note that a comment must be ended
1250with a newline character.
1255 > (scan "::this is a comment \0a" vul)
1257 > (scan "::this is a comment " vul)
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