3 title/'4c: Tank Printer'
14Pretty-printing engine that accepts a `++tank` sample and contains arms that perform computation on it.
31 <2.gdc {tac/{$leaf ""} <402.arm 110.jyx 1.ztu $151>}>
39Flatten `++tank` out into a `++tape`.
43`tac` is a `++tank`, taken from sample of `++re` core.
56 $palm ram(tac [%rose [p.p.tac (weld q.p.tac r.p.tac) s.p.tac] q.tac])
63 =+ voz=$(q.tac t.q.tac)
64 (weld ram(tac i.q.tac) ?~(t.q.tac voz (weld p.p.tac voz)))
72 > ~(ram re leaf+"foo")
74 > ~(ram re rose+["." "(" ")"]^~[leaf+"bar" leaf+"baz" leaf+"bam"])
82Render at indent level `tab` and width `edg`.
86`tac` is a `++tank`, taken from sample of `++re` core.
88`tab` and `edg` are atoms.
92A `++wall` (`++list` of `++tapes`).
109 (rig(tab (add 2 tab), lug $(tac i.q.tac)) q.p.tac)
110 => .(q.tac `(list tank)`q.tac)
111 =+ lyn=(mul 2 (lent q.tac))
118 tab (add tab (sub lyn 2))
119 lug $(q.tac t.q.tac, lyn (sub lyn 2))
121 (wig(lug qyr) q.p.tac)
128 > (~(win re leaf+"samoltekon-lapdok") 0 20)
129 <<"samoltekon-lapdok">>
131 > (~(win re leaf+"samoltekon-lapdok") 0 10)
132 <<"\/samolt\/" " ekon-l" " apdok" "\/ \/">>
134 > (~(win re rose+["--" "[" "]"]^~[leaf+"1423" leaf+"2316"]) 0 20)
137 > (~(win re rose+["--" "[" "]"]^~[leaf+"1423" leaf+"2316"]) 0 10)
138 <<"[ 1423" " 2316" "]">>
152 ++ din (mod (add 2 tab) (mul 2 (div edg 3)))
161Determine whether `tac` fits on one line. Internal to `++win`
169++ fit (lte (lent ram) (sub edg tab))
183Wrap `++tape` in `\/` if it doesn't fit at current indentation. Internal to
188`tac` is a `++tank`, taken from sample of `++re` core.
194A `++wall` (list of `++tape`s).
202 ?: & ::(lte (lent hom) (sub edg tab))
203 [(runt [tab ' '] hom) lug]
204 => .(tab (add tab 2), edg (sub edg 2))
205 =+ mut=(trim (sub edg tab) hom)
206 :- (runt [(sub tab 2) ' '] ['\\' '/' (weld p.mut `_hom`['\\' '/' ~])])
212 ['\\' '/' (runt [(sub edg tab) ' '] ['\\' '/' ~])]
214 => .(mut (trim (sub edg tab) hom))
215 [(runt [tab ' '] p.mut) $(hom q.mut)]
226Render `++tape`. Internal to `++win`.
230`tac` is a `++tank`, taken from sample of `++re` core.
243 =+ wug=:(add 1 tab lin)
247 ?|(=(0 wug) ?&(=(' ' i.mir) $(mir t.mir, wug (dec wug))))
248 (rig hom) :: ^ XX regular form?
249 [(runt [tab ' '] (weld hom `tape`[' ' (slag wug i.lug)])) t.lug]
260 ++ show :: XX deprecated, use span
264 [%leaf (mesc (trip vem))]
267 [%leaf '\'' (weld (mesc (tape +.vem)) `tape`['\'' ~])]
269 {s/$a c/@} [%leaf (mesc (trip c.vem))]
270 {s/$b c/*} (shop c.vem |=(a/@ ~(rub at a)))
273 [['.' ~] ['-' ~] ~ ~]
274 [[%leaf (mesc (trip p.s.vem))] $(vem c.vem) ~]
276 {s/$d c/*} (shop c.vem |=(a/@ ~(rud at a)))
277 {s/$k c/*} (tank c.vem)
281 =+ yol=((list @ta) c.vem)
282 (turn yol |=(a/@ta [%leaf (trip a)]))
284 {s/$l c/*} (shol c.vem)
288 :- [%m '%h:<[%d %d].[%d %d]>']
289 [-.c.vem +<-.c.vem +<+.c.vem +>-.c.vem +>+.c.vem ~]
292 {s/$p c/*} (shop c.vem |=(a/@ ~(rup at a)))
293 {s/$q c/*} (shop c.vem |=(a/@ ~(r at a)))
294 {s/$r c/*} $(vem [[%r ' ' '{' '}'] c.vem])
295 {s/$t c/*} (shop c.vem |=(a/@ ~(rt at a)))
296 {s/$v c/*} (shop c.vem |=(a/@ ~(ruv at a)))
297 {s/$x c/*} (shop c.vem |=(a/@ ~(rux at a)))
298 {s/{$m p/@} c/*} (shep p.s.vem c.vem)
300 $(vem [[%r ' ' (cut 3 [0 1] p.s.vem) (cut 3 [1 1] p.s.vem)] c.vem])
302 {s/{$r p/@ q/@ r/@} c/*}
304 :* p=(mesc (trip p.s.vem))
305 q=(mesc (trip q.s.vem))
306 r=(mesc (trip r.s.vem))
311 [^$(vem -.c.vem) $(c.vem +.c.vem)]
313 {s/$z c/*} $(vem [[%r %$ %$ %$] c.vem])
332 =+ c=(cut 3 [i 1] fom)
334 (weld (mesc [c ~]) $(i +(i)))
335 =+ d=(cut 3 [+(i) 1] fom)
337 ['\\' '#' $(i (add 2 i))]
338 (weld ~(ram re (show d -.gar)) $(i (add 2 i), gar +.gar))
348 |= {aug/* vel/$-(a/@ tape)}
353 [[' ' ~] ['[' ~] [']' ~]]
358 [^$(aug -.aug) $(aug +.aug)]
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