Printing improvements

This commit is contained in:
Anton Dyudin 2015-01-13 21:38:39 -08:00
parent bdde93d01c
commit 43e866939a
8 changed files with 36 additions and 41 deletions

View File

@ -91,7 +91,7 @@
++ term-in ::
$: pax=path ::
$= jof ::
$% [%line p=span] ::
$% [%line p=cord] ::
[%res p=span] ::
[%cmd p=char] ::
[%type p=?] ::

View File

@ -202,23 +202,12 @@
:- ?~(p.u.a ~ ?~(p.u.b ~ `(grom u.p.u.b u.p.u.a)))
(grom q.u.b q.u.a)
::
++ lamp
|= con=(unit coin)
^- (unit path)
?: ?=([~ %$ %tas @] con)
(some [q.p.u.con]~)
?. ?=([~ %many *] con) ~
%- zl:jo
%+ turn p.u.con
|= tem=coin
?.(?=([%$ %ta @] tem) ~ (some q.p.tem))
::
++ lump :: position
|= pax=path
^- [p=hapt q=path]
?> ?=([@ @ *] pax)
:- :- (slav %p i.pax)
(need (lamp (slay i.t.pax)))
(need (pick i.t.pax))
t.t.pax
--
. == :: end preface
@ -574,10 +563,7 @@
::
++ away :: application path
|= pax=path ^- path
=+ ?: &(?=([@tas ~] imp) ((sane %tas) i.imp))
imc=[%$ %tas i.imp]
imc=[%many (turn imp |=(a=span [%$ %ta a]))]
[%a (scot %p our) ~(rent co imc) pax]
[%a (scot %p our) ?~(imp %$ (pack imp)) pax]
::
++ bear :: write backward
|= hen=duct

View File

@ -3031,16 +3031,20 @@
::
++ wick :: span format
|= a=@
^- @ta
^- (unit ,@ta)
=+ b=(rip 3 a)
%+ rap 3
|- ^- tape
?~ b
~
?: =('~' i.b)
?~ t.b !!
[?:(=('~' i.t.b) '~' ?>(=('-' i.t.b) '_')) $(b t.t.b)]
[i.b $(b t.b)]
=- ?^(b ~ (some (rap 3 (flop c))))
=| c=tape
|- ^- [b=tape c=tape]
?~ b [~ c]
?. =('~' i.b)
$(b t.b, c [i.b c])
?~ t.b [b ~]
?- i.t.b
%'~' $(b t.t.b, c ['~' c])
%'-' $(b t.t.b, c ['_' c])
@ [b ~]
==
::
++ woad :: cord format
|= a=@ta
@ -3313,7 +3317,7 @@
=> ^+(. .(rex ?~(f.yug rex ['.' (s-co f.yug)])))
:- '~'
?: &(=(0 d.yug) =(0 m.yug) =(0 h.yug) =(0 s.yug))
['.' 's' '0' rex]
['s' '0' rex]
=> ^+(. ?:(=(0 s.yug) . .(rex ['.' 's' (a-co s.yug)])))
=> ^+(. ?:(=(0 m.yug) . .(rex ['.' 'm' (a-co m.yug)])))
=> ^+(. ?:(=(0 h.yug) . .(rex ['.' 'h' (a-co h.yug)])))
@ -3562,7 +3566,7 @@
:- '~' ;~(pfix sig ;~(pose twid (easy [~ %n 0])))
==
++ nusk
(sear |=(a=@ta (rush (wick a) nuck)) urt:ab)
:(sear |=(a=@ta (rush a nuck)) wick urt:ab)
++ perd
;~ pose
(stag ~ zust)
@ -7090,6 +7094,8 @@
[%pear *]
?. =(lum q.q.ham)
~
?: ?=([%tas ~] +.q.ham)
[~ %leaf '%' '$' ~]
=+ fox=~(rend co [~ p.q.ham q.q.ham])
[~ %leaf ?:(=(['~' ~] fox) fox ['%' fox])]
::

View File

@ -2668,6 +2668,14 @@
?: ?=(| -.mud) mud
(mule |.((slam p.mud sam)))
::
++ pack :: light path encoding
|= [a=term b=path] ^- span
%+ rap 3 :- (wack a)
(turn b |=(c=span (cat 3 '_' (wack c))))
::
++ pick :: light path decoding
|= a=span ^- (unit ,[p=term q=path])
(rush a (most cab (sear wick urt:ab)))
++ saxo :: autocanon
|= who=ship
^- (list ship)

View File

@ -141,7 +141,7 @@
::
--
--
!:
::
:::: per event
::
|%
@ -478,7 +478,7 @@
!>([%rush %term-line `term-line`[prompt [a]~ ~]])
--
--
!:
::
:::: formal interface
::
|_ [hid=hide vat=axle]

View File

@ -63,11 +63,6 @@
::
|%
++ aut %shell
++ encode
|= [a=term b=path] ^- span
(rap 3 a (turn b |=(c=span (cat 3 '_' c))))
::
++ decode |=(a=span `[p=term q=path]`(rash a (most cab sym)))
++ inject
|= [a=[i=mane t=(list mane)] b=marl]
|= man=manx
@ -80,7 +75,7 @@
++ start-shell
|= [our=ship imp=path ost=bone you=ship pax=path]
^- (list move)
=+ auc=(encode aut pax)
=+ auc=(pack aut pax)
:- [ost %pass [%fork pax] %g %sire [aut auc]]
[ost %pass [%resp pax] %g %show [our [auc imp]] you /out]~
--
@ -91,7 +86,7 @@
++ se
|= [hid=hide ost=bone you=ship hiz=(map path term-line) pax=path]
=+ tel=(fall (~(get by hiz) pax) *term-line)
=+ auc=(encode aut pax)
=+ auc=(pack aut pax)
=^ mow tel
?: (~(has by cub.hid) auc)
[~ tel]
@ -128,7 +123,7 @@
==
::
++ poke
|= jof=$%([%line p=span] [%res p=span] [%cmd p=char] [%type p=?])
|= jof=$%([%line p=cord] [%res p=span] [%cmd p=char] [%type p=?])
^+ +>
?- -.jof
%res :: restart shell
@ -212,7 +207,7 @@
^- (list move)
%+ murn (~(tap by cub.hid))
|= [p=span q=term]
?. =(pax q:(decode p)) ~
?. =(p auc) ~
%- some ^- move
:^ ost %pass [-.mez pax]
[%g %mess [our.hid p imp.hid] you mez]

View File

@ -13,7 +13,7 @@
%- need
%. jon => jo
%^ ot
pax/(su ;~(pfix fas (more fas sym)))
pax/(su ;~(pose (cold ~ (full fas)) (plus ;~(pfix fas urs:ab))))
act/(of line/so res/so cmd/so ~)
~
++ noun term-in :: clam from %noun

View File

@ -1,6 +1,6 @@
$: pax=path ::
$= jof ::
$% [%line p=span] ::
$% [%line p=cord] ::
[%res p=span] ::
[%cmd p=char] ::
[%type p=?] ::