stack shortening rc1

This commit is contained in:
Anton Dyudin 2015-11-28 14:44:29 -08:00
parent f800913504
commit 21d7d2fa41
2 changed files with 44 additions and 27 deletions

View File

@ -1024,6 +1024,18 @@
(gor +.a +.b)
(gor -.a -.b)
::
++ lor :: l-order
~/ %lor
|= [a=* b=*]
^- ?
?: =(a b) &
?@ a
?^ b &
(lth a b)
?: =(-.a -.b)
$(a +.a, b +.b)
$(a -.a, b -.b)
::
++ vor :: v-order
~/ %vor
|= [a=* b=*]
@ -4312,14 +4324,11 @@
::
++ smyt :: pretty print path
|= bon=path ^- tank
:+ %rose [['/' ~] ['/' ~] ['/' ~]]
:+ %rose [['/' ~] ['/' ~] ~]
(turn bon |=(a=@ [%leaf (trip a)]))
::
++ spat |=(pax=path (crip (spud pax))) :: render path to cord
++ spud :: render path to tape
|= pax=path ^- tape
=- ~(ram re %rose ["/" "/" ~] -)
(turn pax |=(a=span [%leaf (trip a)]))
++ spud |=(pax=path ~(ram re (smyt pax))) :: render path to tape
++ stab :: parse cord to path
=+ fel=;~(pfix fas (more fas urs:ab))
|=(zep=@t `path`(rash zep fel))
@ -4594,11 +4603,33 @@
|= [[sub=* fol=*] sky=$+(* (unit))]
(mook (mink [sub fol] sky))
::
++ mork :: XX name
|= pon=(list ,[@ta *]) ^+ pon
?~ pon ~
:- i.pon
?. ?=([%spot * ^] i.pon)
$(pon t.pon)
?. ?=([[%spot * ^] *] t.pon)
$(pon t.pon)
=> .(pon t.pon)
=+ sot=+.i.pon
|- ^- (list ,[@ta *])
?. ?=([[%spot * ^] *] t.pon)
[[%spot sot] ^$(pon t.pon)]
=+ sop=+.i.pon
?: ?& =(-.sop -.sot)
(lor +<.sop +<.sot)
(lor +>.sot +>.sop)
==
$(sot sop, pon t.pon)
[[%spot sot] ^$(pon t.pon)]
::
++ mook
|= ton=tone
^- toon
?. ?=([2 *] ton) ton
:- %2
=. p.ton (mork p.ton)
=+ yel=(lent p.ton)
=. p.ton
?. (gth yel 256) p.ton
@ -4608,38 +4639,25 @@
:_ (slag (sub yel 128) p.ton)
:- %lose
%+ rap 3
;: weld
"[skipped "
~(rend co %$ %ud (sub yel 256))
" frames]"
==
"[skipped {(scow %ud (sub yel 256))} frames]"
|- ^- (list tank)
?~ p.ton ~
=+ rex=$(p.ton t.p.ton)
?+ -.i.p.ton rex
%hunk [(tank +.i.p.ton) rex]
%lose [[%leaf (rip 3 (,@ +.i.p.ton))] rex]
%hand :_(rex [%leaf (scow %p (mug +.i.p.ton))])
%hand [[%leaf (scow %p (mug +.i.p.ton))] rex]
%mean :_ rex
?@ +.i.p.ton [%leaf (rip 3 (,@ +.i.p.ton))]
=+ mac=(mack +.i.p.ton +<.i.p.ton)
?~(mac [%leaf "####"] (tank u.mac))
%spot :_ rex
=+ sot=(spot +.i.p.ton)
:- %leaf
;: weld
~(ram re (smyt p.sot))
":<["
~(rend co ~ %ud p.p.q.sot)
" "
~(rend co ~ %ud q.p.q.sot)
"].["
~(rend co ~ %ud p.q.q.sot)
" "
~(rend co ~ %ud q.q.q.sot)
"]>"
==
==
:+ %rose [":" ~ ~]
:~ (smyt p.sot)
=> [ud=|=(a=@u (scow %ud a)) q.sot]
leaf/"<[{(ud p.p)} {(ud q.p)}].[{(ud p.q)} {(ud q.q)}]>"
== ==
::
++ mang
|= [[gat=* sam=*] sky=$+(* (unit))]
@ -7458,7 +7476,6 @@
%void %void
==
::
++ dank |=(pax=path ^-(tank (dish [~ %path] pax)))
++ dash
|= [mil=tape lim=char] ^- tape
:- lim

View File

@ -8,7 +8,7 @@
:- %say
|= [^ [pax=path fla=$|(~ [%full ~])] ~]
=+ len=(lent pax)
=+ rend=?^(fla dank:ut |=(a=path (dank:ut (slag len a))))
=+ rend=?^(fla smyt |=(a=path (smyt (slag len a))))
:- %tang %- flop
|- ^- tang
=+ ark=;;(arch .^(cy/pax))