Various fixes and improvements.

This commit is contained in:
C. Guy Yarvin 2015-02-16 12:18:10 -08:00
parent d980b1da23
commit f189282a45
4 changed files with 116 additions and 47 deletions

View File

@ -46,6 +46,7 @@
$: %d :: $: %d ::
$% [%crud p=@tas q=(list tank)] :: $% [%crud p=@tas q=(list tank)] ::
[%text p=tape] :: [%text p=tape] ::
[%logo ~] ::
== == :: == == ::
$: %g :: $: %g ::
$% [%mess p=[p=ship q=path] q=ship r=mess] :: $% [%mess p=[p=ship q=path] q=ship r=mess] ::

View File

@ -98,7 +98,7 @@
$% [%bbye ~] :: reset prompt $% [%bbye ~] :: reset prompt
[%blit p=(list blit)] :: terminal output [%blit p=(list blit)] :: terminal output
[%init p=@p] :: set owner [%init p=@p] :: set owner
[%logo @] :: logout [%logo ~] :: logout
[%veer p=@ta q=path r=@t] :: install vane [%veer p=@ta q=path r=@t] :: install vane
[%vega p=path] :: reboot by path [%vega p=path] :: reboot by path
[%verb ~] :: [%verb ~] ::
@ -233,8 +233,7 @@
+> +>
:: ::
[%g %mean *] [%g %mean *]
:: ~& [%take-mean sih] +>(moz [[hen %give %logo ~] moz])
+>
:: ::
[%g %nice *] [%g %nice *]
:: ~& [%take-nice sih] :: ~& [%take-nice sih]

View File

@ -37,7 +37,7 @@
[%dub p=term q=horn] :: /= apply face [%dub p=term q=horn] :: /= apply face
[%fan p=(list horn)] :: /. list [%fan p=(list horn)] :: /. list
[%for p=path q=horn] :: /, descend [%for p=path q=horn] :: /, descend
[%hel p=horn] :: /% propogate heel [%hel p=horn] :: /% propagate heel
[%hub p=horn] :: /@ list by @ud [%hub p=horn] :: /@ list by @ud
[%man p=(map span horn)] :: /* hetero map [%man p=(map span horn)] :: /* hetero map
[%nap p=horn] :: /_ homo map [%nap p=horn] :: /_ homo map

View File

@ -12,16 +12,21 @@
$: bin=(map bone source) :: input devices $: bin=(map bone source) :: input devices
== :: == ::
++ source :: input device ++ source :: input device
$: edg=_80 :: terminal columns $: edg=_79 :: terminal columns
kil=(unit (list ,@c)) off=@ud :: window offset
kil=(unit (list ,@c)) :: kill buffer
apt=(list term) :: application ring apt=(list term) :: application ring
maz=(unit (list ,@c)) :: master window
feg=(map term target) :: live applications feg=(map term target) :: live applications
mir=(pair ,@ud (list ,@c)) :: mirrored state mir=(pair ,@ud (list ,@c)) :: mirrored state
== :: == ::
++ master :: master buffer
$: pos=@ud :: cursor position
buf=(list ,@c) :: text entry
== ::
++ history :: past input ++ history :: past input
$: pos=@ud :: input position $: pos=@ud :: input position
num=@ud :: number of entries num=@ud :: number of entries
ris=(unit search) :: reverse-i-search
lay=(map ,@ud (list ,@c)) :: editing overlay lay=(map ,@ud (list ,@c)) :: editing overlay
old=(list (list ,@c)) :: entries proper old=(list (list ,@c)) :: entries proper
== :: == ::
@ -30,7 +35,8 @@
str=(list ,@c) :: search string str=(list ,@c) :: search string
== ==
++ target :: application target ++ target :: application target
$: hit=history :: all past input $: ris=(unit search) :: reverse-i-search
hit=history :: all past input
pom=console-prompt :: static prompt pom=console-prompt :: static prompt
inp=console-input :: input state inp=console-input :: input state
== :: == ::
@ -70,9 +76,27 @@
|= bet=dill-belt |= bet=dill-belt
^+ +> ^+ +>
?: ?=(%rez -.bet) ?: ?=(%rez -.bet)
+>(edg q.bet) +>(edg (dec p.bet))
?: ?=(%yow -.bet) ?: ?=(%yow -.bet)
(se-link p.bet) (se-link p.bet)
?^ maz
?+ -.bet (se-blit %bel ~)
::
%bac
?: =(0 (lent u.maz))
(se-blit %bel ~)
+>(u.maz (scag (dec (lent u.maz)) u.maz))
::
%ctl
?+ p.bet (se-blit %bel ~)
%d (se-emit ost %give %mean ~)
%v +>.$(maz ~)
%x $(maz ~)
==
::
%ret (se-like(maz ~) u.maz)
%txt +>(u.maz (weld u.maz p.bet))
==
?~ apt ?~ apt
~& %console-no-terminal ~& %console-no-terminal
(se-blit %bel ~) (se-blit %bel ~)
@ -94,22 +118,28 @@
|= nam=term |= nam=term
^+ +> ^+ +>
?> (~(has by feg) nam) ?> (~(has by feg) nam)
%_ +> =: feg (~(del by feg) nam)
feg (~(del by feg) nam)
apt (skip apt |=(a=term =(nam a))) apt (skip apt |=(a=term =(nam a)))
== ==
?^ apt +>
?^ maz +>
+>(maz `~)
:: ::
++ se-join :: add connection ++ se-join :: add connection
|= nam=term |= nam=term
^+ +> ^+ +>
?< (~(has by feg) nam) ?< (~(has by feg) nam)
+>(apt [nam apt], feg (~(put by feg) nam *target)) +>(maz ~, apt [nam apt], feg (~(put by feg) nam *target))
:: ::
++ se-nuke :: active drop ++ se-nuke :: active drop
|= nam=term |= nam=term
^+ +> ^+ +>
(se-drop:(se-send nam %nuke [her ~[nam]] her) nam) (se-drop:(se-send nam %nuke [her ~[nam]] her) nam)
:: ::
++ se-like :: act in master
|= buf=(list ,@c)
(se-link (crip (tufa buf)))
::
++ se-link :: connect to app ++ se-link :: connect to app
|= nam=term |= nam=term
^+ +> ^+ +>
@ -121,15 +151,35 @@
|= bil=dill-blit |= bil=dill-blit
(se-emit ost %give %rush %dill-blit bil) (se-emit ost %give %rush %dill-blit bil)
:: ::
++ se-show :: show buffer, raw
|= lin=(pair ,@ud (list ,@c))
^+ +>
?: =(mir lin) +>
=. +> ?:(=(q.mir q.lin) +> (se-blit %pro q.lin))
=. +> ?:(=(p.mir p.lin) +> (se-blit %hop p.lin))
+>(mir lin)
::
++ se-just :: adjusted buffer
|= lin=(pair ,@ud (list ,@c))
^+ +>
=. off ?:((lth p.lin edg) 0 (sub p.lin edg))
(se-show (sub p.lin off) (scag edg (slag off q.lin)))
::
++ se-view :: flush buffer ++ se-view :: flush buffer
^+ . %- se-just
=+ ^= lin ^- (pair ,@ud (list ,@c)) ?^ maz
?~ apt [0 ~] =- [(lent zil) zil]
^= zil ^- (list ,@c)
%- welp
:_ u.maz
|- ^- (list ,@c)
?~ apt [`@c`0x23 `@c`0x20 ~]
=+ nex=$(apt t.apt)
%+ welp (tuba (trip i.apt))
?~(t.apt nex `_nex`[`@c`0x2c `@c`0x20 nex])
?~ apt
~&(%se-no-view [0 ~])
~(ta-vew ta [& i.apt] (~(got by feg) i.apt)) ~(ta-vew ta [& i.apt] (~(got by feg) i.apt))
?: =(mir lin) +
=. + ?:(=(q.mir q.lin) + (se-blit %pro q.lin))
=. + ?:(=(p.mir p.lin) + (se-blit %hop p.lin))
+(mir lin)
:: ::
++ se-kill :: kill a source ++ se-kill :: kill a source
=+ tup=apt =+ tup=apt
@ -154,7 +204,6 @@
^+ +> ^+ +>
?- -.sil ?- -.sil
%mean %mean
~& [%se-pour-mean sil]
+>.$ +>.$
:: ::
%nice %nice
@ -184,18 +233,21 @@
|= key=?(%d %l %r %u) |= key=?(%d %l %r %u)
^+ +> ^+ +>
?- key ?- key
%d ?. =(num.hit pos.hit) %d =. ris ~
?. =(num.hit pos.hit)
(ta-mov +(pos.hit)) (ta-mov +(pos.hit))
?: =(0 (lent buf.say.inp)) ?: =(0 (lent buf.say.inp))
ta-bel ta-bel
(ta-hom:ta-nex %set ~) (ta-hom:ta-nex %set ~)
%l ?: =(0 pos.inp) %l ?^ ris ta-bel
ta-bel ?: =(0 pos.inp) ta-bel
+>(pos.inp (dec pos.inp)) +>(pos.inp (dec pos.inp))
%r ?: =((lent buf.say.inp) pos.inp) %r ?^ ris ta-bel
?: =((lent buf.say.inp) pos.inp)
ta-bel ta-bel
+>(pos.inp +(pos.inp)) +>(pos.inp +(pos.inp))
%u ?:(=(0 pos.hit) ta-bel (ta-mov (dec pos.hit))) %u =. ris ~
?:(=(0 pos.hit) ta-bel (ta-mov (dec pos.hit)))
== ==
:: ::
++ ta-bel .(+> (se-blit %bel ~)) :: beep ++ ta-bel .(+> (se-blit %bel ~)) :: beep
@ -220,10 +272,10 @@
:: ::
++ ta-bac :: hear backspace ++ ta-bac :: hear backspace
^+ . ^+ .
?^ ris.hit ?^ ris
?: =(~ str.u.ris.hit) ?: =(~ str.u.ris)
ta-bel ta-bel
.(str.u.ris.hit (scag (dec (lent str.u.ris.hit)) str.u.ris.hit)) .(str.u.ris (scag (dec (lent str.u.ris)) str.u.ris))
?: =(0 pos.inp) ?: =(0 pos.inp)
.(+> (se-blit %bel ~)) .(+> (se-blit %bel ~))
=+ pre=(dec pos.inp) =+ pre=(dec pos.inp)
@ -235,13 +287,13 @@
?+ key ta-bel ?+ key ta-bel
%a +>(pos.inp 0) %a +>(pos.inp 0)
%b (ta-aro %l) %b (ta-aro %l)
%c ta-bel(ris.hit ~) %c ta-bel(ris ~)
%d ?: &(=(0 pos.inp) =(0 (lent buf.say.inp))) %d ?: &(=(0 pos.inp) =(0 (lent buf.say.inp)))
+>(liv |) +>(liv |)
ta-del ta-del
%e +>(pos.inp (lent buf.say.inp)) %e +>(pos.inp (lent buf.say.inp))
%f (ta-aro %r) %f (ta-aro %r)
%g ta-bel(ris.hit ~) %g ta-bel(ris ~)
%k =+ len=(lent buf.say.inp) %k =+ len=(lent buf.say.inp)
?: =(pos.inp len) ?: =(pos.inp len)
ta-bel ta-bel
@ -250,9 +302,9 @@
%l +>(+> (se-blit %clr ~)) %l +>(+> (se-blit %clr ~))
%n (ta-aro %d) %n (ta-aro %d)
%p (ta-aro %u) %p (ta-aro %u)
%r ?~ ris.hit %r ?~ ris
+>(ris.hit `[pos.hit ~]) +>(ris `[pos.hit ~])
?: =(0 pos.u.ris.hit) ?: =(0 pos.u.ris)
ta-bel ta-bel
(ta-ser ~) (ta-ser ~)
%t =+ len=(lent buf.say.inp) %t =+ len=(lent buf.say.inp)
@ -269,6 +321,10 @@
ta-bel ta-bel
%- ta-hom(pos.inp 0, kil `(scag pos.inp buf.say.inp)) %- ta-hom(pos.inp 0, kil `(scag pos.inp buf.say.inp))
(ta-cut 0 pos.inp) (ta-cut 0 pos.inp)
%v +>(maz `~)
%x ?: =(~ apt) ta-bel
?^ maz ta-bel
+>(apt (welp (slag 1 apt) [(snag 0 apt) ~]))
%y ?~ kil ta-bel %y ?~ kil ta-bel
%- ta-hom(pos.inp (add pos.inp (lent u.kil))) %- ta-hom(pos.inp (add pos.inp (lent u.kil)))
(ta-cat pos.inp u.kil) (ta-cat pos.inp u.kil)
@ -339,7 +395,7 @@
%_ . %_ .
num.hit +(num.hit) num.hit +(num.hit)
pos.hit +(num.hit) pos.hit +(num.hit)
ris.hit ~ ris ~
lay.hit ~ lay.hit ~
old.hit [buf.say.inp old.hit] old.hit [buf.say.inp old.hit]
== ==
@ -352,10 +408,10 @@
++ ta-ser :: reverse search ++ ta-ser :: reverse search
|= ext=(list ,@c) |= ext=(list ,@c)
^+ +> ^+ +>
?: |(?=(~ ris.hit) =(0 pos.u.ris.hit)) ta-bel ?: |(?=(~ ris) =(0 pos.u.ris)) ta-bel
=+ tot=(weld str.u.ris.hit ext) =+ tot=(weld str.u.ris ext)
=+ dol=(slag (sub num.hit pos.u.ris.hit) old.hit) =+ dol=(slag (sub num.hit pos.u.ris) old.hit)
=+ sop=pos.u.ris.hit =+ sop=pos.u.ris
=+ ^= ser =+ ^= ser
=+ ^= beg =+ ^= beg
|= [a=(list ,@c) b=(list ,@c)] ^- ? |= [a=(list ,@c) b=(list ,@c)] ^- ?
@ -369,7 +425,7 @@
`sop `sop
$(sop (dec sop), dol t.dol) $(sop (dec sop), dol t.dol)
?~ sup ta-bel ?~ sup ta-bel
(ta-mov(str.u.ris.hit tot, pos.u.ris.hit (dec u.sup)) (dec u.sup)) (ta-mov(str.u.ris tot, pos.u.ris (dec u.sup)) (dec u.sup))
:: ::
++ ta-tan :: print tanks ++ ta-tan :: print tanks
|= tac=(list tank) |= tac=(list tank)
@ -381,7 +437,7 @@
++ ta-txt :: hear text ++ ta-txt :: hear text
|= txt=(list ,@c) |= txt=(list ,@c)
^+ +> ^+ +>
?^ ris.hit ?^ ris
(ta-ser txt) (ta-ser txt)
%- ta-hom(pos.inp (add (lent txt) pos.inp)) %- ta-hom(pos.inp (add (lent txt) pos.inp))
:- %mor :- %mor
@ -391,11 +447,11 @@
:: ::
++ ta-vew :: computed prompt ++ ta-vew :: computed prompt
|- ^- (pair ,@ud (list ,@c)) |- ^- (pair ,@ud (list ,@c))
?^ ris.hit ?^ ris
%= $ %= $
ris.hit ~ ris ~
cap.pom cap.pom
`(list ,@)`:(welp "(reverse-i-search)'" str.u.ris.hit "': ") `(list ,@)`:(welp "(reverse-i-search)'" str.u.ris "': ")
== ==
=- [(add pos.inp (lent p.vew)) (weld p.vew q.vew)] =- [(add pos.inp (lent p.vew)) (weld p.vew q.vew)]
^= vew ^- (pair (list ,@c) (list ,@c)) ^= vew ^- (pair (list ,@c) (list ,@c))
@ -419,7 +475,20 @@
|= [ost=bone her=ship pax=path] |= [ost=bone her=ship pax=path]
^- [(list move) _+>] ^- [(list move) _+>]
?< (~(has by bin) ost) ?< (~(has by bin) ost)
[~ +>(bin (~(put by bin) ost *source))] :- [ost %give %rush %dill-blit %pro [`@c`0x23 `@c`0x20 ~]]~
%= +>
bin
%+ ~(put by bin) ost
^- source
:* 80
0
~
~
`~
~
[0 ~]
==
==
:: ::
++ poke-dill-belt ++ poke-dill-belt
|= [ost=bone her=ship bet=dill-belt] |= [ost=bone her=ship bet=dill-belt]