:seat compiles.

This commit is contained in:
C. Guy Yarvin 2015-02-08 22:25:00 -08:00
parent 866faaf865
commit 0600aaa111
5 changed files with 84 additions and 68 deletions

View File

@ -261,7 +261,7 @@
^- [p=(list move) q=_..^$] ^- [p=(list move) q=_..^$]
?: ?=(%crud +<.q.hin) ?: ?=(%crud +<.q.hin)
~& [%gall-crud-error pax hen] ~& [%gall-crud-error pax hen]
~& [%gall-crud-data (,[@tas (list tank)] +>.q.hin)] :: ~& [%gall-crud-data (,[@tas (list tank)] +>.q.hin)]
?> ?=(%g -.q.hin) ?> ?=(%g -.q.hin)
?~ pax ~& %strange-path [~ ..^$] ?~ pax ~& %strange-path [~ ..^$]
=+ lum=(lump t.pax) =+ lum=(lump t.pax)

View File

@ -12,7 +12,7 @@
$: bin=(map bone source) :: input devices $: bin=(map bone source) :: input devices
== :: == ::
++ source :: input device ++ source :: input device
$: edg=@ud :: terminal columns $: edg=_80 :: terminal columns
apt=(list term) :: application ring apt=(list term) :: application ring
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
@ -33,12 +33,10 @@
$% [%mean p=ares] :: $% [%mean p=ares] ::
[%nice ~] :: [%nice ~] ::
[%rush %console-effect console-effect] :: [%rush %console-effect console-effect] ::
== ::
++ sign :: in result $<- ++ sign :: in result $<-
$% [%g sign-gall] :: $% [%g sign-gall] ::
$% [%mean p=ares] :: == ::
[%nice ~] ::
[%rush %console-effect console-effect] ::
== == == ::
++ move ,[p=bone q=(mold note gift)] :: ++ move ,[p=bone q=(mold note gift)] ::
++ note-gall :: note to %gall ++ note-gall :: note to %gall
$% [%mess p=[p=ship q=path] q=ship r=message] :: $% [%mess p=[p=ship q=path] q=ship r=message] ::
@ -59,25 +57,26 @@
[(flop moz) %_(+> bin (~(put by bin) ost +<+>))] [(flop moz) %_(+> bin (~(put by bin) ost +<+>))]
:: ::
++ se-belt :: handle input ++ se-belt :: handle input
|= bet=belt |= bet=dill-belt
^+ +> ^+ +>
?: =(%rez -.bet) ?: ?=(%rez -.bet)
+>(wid q.rez) +>(edg q.bet)
?: =(%yow -.bet) ?: ?=(%yow -.bet)
(se-link p.bet) (se-link p.bet)
?~ apt ?~ apt
~& %console-no-terminal ~& %console-no-terminal
(se-blit %bel ~) (se-blit %bel ~)
=+ nam=i.apt =+ nam=i.apt
=+ taz=~(. ta & nam (~(got by feg) nam)) =+ taz=~(. ta [& nam] (~(got by feg) nam))
=< ta-abet =< ta-abet
?- -.bet ?- -.bet
%aro (ta-aro:taz p.bet) %aro (ta-aro:taz p.bet)
%bac ta-bac:taz %bac ta-bac:taz
%cru (ta-cru:taz p.bet q.bet)
%ctl (ta-ctl:taz p.bet) %ctl (ta-ctl:taz p.bet)
%del (ta-del:taz p.bet) %del ta-del:taz
%met (ta-met:taz p.bet) %met (ta-met:taz p.bet)
%ret (ta-ret:taz p.bet) %ret ta-ret:taz
%txt (ta-txt:taz p.bet) %txt (ta-txt:taz p.bet)
== ==
:: ::
@ -98,7 +97,8 @@
:: ::
++ se-nuke :: active drop ++ se-nuke :: active drop
|= nam=term |= nam=term
se-drop:(se-send nam %nuke [her ~[nam]]) ^+ +>
(se-drop:(se-send nam %nuke [her ~[nam]] her) nam)
:: ::
++ se-link :: connect to app ++ se-link :: connect to app
|= nam=term |= nam=term
@ -108,23 +108,24 @@
(se-send nam %show [her ~[nam]] her /console) (se-send nam %show [her ~[nam]] her /console)
:: ::
++ se-blit :: give output ++ se-blit :: give output
|= bil=blit |= bil=dill-blit
(se-emit ost %give %rush %dill-blit bil) (se-emit ost %give %rush %dill-blit bil)
:: ::
++ se-view :: flush buffer ++ se-view :: flush buffer
^+ . ^+ .
=+ ^= lin ^- (pair ,@ud (list ,@c)) =+ ^= lin ^- (pair ,@ud (list ,@c))
?~ apt [0 ~] ?~ apt [0 ~]
~(ta-vew ta & i.apt (~(got by feg) i.apt)) ~(ta-vew ta [& i.apt] (~(got by feg) i.apt))
?: =(mir lin) + ?: =(mir lin) +
=. + ?:(=(q.mir q.lin) + (se-blit %pro q.lin)) =. + ?:(=(q.mir q.lin) + (se-blit %pro q.lin))
=. + ?:(=(p.mir p.lin) + (se-blit %hop p.lin)) =. + ?:(=(p.mir p.lin) + (se-blit %hop p.lin))
+(mir lin) +(mir lin)
:: ::
++ se-kill :: kill a source ++ se-kill :: kill a source
|- ^+ + =+ tup=apt
?~ apt + |- ^+ +>
$(apt +.apt, + (se-nuke i.apt)) ?~ tup +>(apt ~)
$(tup +.tup, +> (se-nuke i.tup))
:: ::
++ se-emit :: emit move ++ se-emit :: emit move
|= mov=move |= mov=move
@ -136,7 +137,7 @@
:: ::
++ se-tame ++ se-tame
|= nam=term |= nam=term
~(. ta & nam (~(got by feg) nam)) ~(. ta [& nam] (~(got by feg) nam))
:: ::
++ se-pour :: receive results ++ se-pour :: receive results
|= [nam=term sil=sign-gall] |= [nam=term sil=sign-gall]
@ -150,7 +151,7 @@
+>.$ +>.$
:: ::
%rush %rush
ta-abet:(ta-got:(se-tame nam) +>.sih) ta-abet:(ta-fec:(se-tame nam) +>.sil)
== ==
:: ::
++ ta :: per target ++ ta :: per target
@ -160,35 +161,39 @@
target :: target state target :: target state
== :: == ::
++ ta-abet :: resolve ++ ta-abet :: resolve
^+ ..ta
?. liv (se-nuke nam) ?. liv (se-nuke nam)
%_(+> feg (~(put by feg) nam +<+)) %_(+> feg (~(put by feg) nam +<+))
:: ::
++ ta-act :: send action ++ ta-act :: send action
|= act=console-action |= act=console-action
%_(+> +> (se-send nam %mess %console-action act)) ^+ +>
%_(+> +> (se-send nam %mess [her ~[nam]] her %console-action act))
:: ::
++ ta-bel .(+> (se-blit %bel ~)) :: beep
++ ta-det :: send edit ++ ta-det :: send edit
|= ted=console-edit |= ted=console-edit
(ta-act [[q.ven p.ven] (sham buf.say) ted) ^+ +>
(ta-act %det [[his.ven.say.inp own.ven.say.inp] (sham buf.say.inp) ted])
:: ::
++ ta-aro :: hear arrow ++ ta-aro :: hear arrow
|= key=?(%d %l %r %u) |= key=?(%d %l %r %u)
^+ +> ^+ +>
?- key ?- key
%d (sa-blit %bel ~) %d ta-bel
%l ?: =(0 pos.inp) %l ?: =(0 pos.inp)
(sa-blit bel ~) ta-bel
+>(pos.inp (dec pos.inp))) +>(pos.inp (dec pos.inp))
%r ?: =((lent buf.say.inp) pos.inp) %r ?: =((lent buf.say.inp) pos.inp)
(sa-blit bel ~) ta-bel
+>(pos.inp +(pos.inp)))) +>(pos.inp +(pos.inp))
%u (sa-blit %bel ~) %u ta-bel
== ==
:: ::
++ ta-bac :: hear backspace ++ ta-bac :: hear backspace
^+ . ^+ .
?: =(0 pos.inp) ?: =(0 pos.inp)
(sa-blit bel ~) .(+> (se-blit %bel ~))
(ta-hom %del (dec pos.inp)) (ta-hom %del (dec pos.inp))
:: ::
++ ta-ctl :: hear control ++ ta-ctl :: hear control
@ -196,22 +201,28 @@
~& [%ta-ctl key] ~& [%ta-ctl key]
+> +>
:: ::
++ ta-cru :: hear crud
|= [lab=@tas tac=(list tank)]
=. +>+> (se-blit %out (tuba (trip lab)))
(ta-tan tac)
::
++ ta-del :: hear delete ++ ta-del :: hear delete
^+ . ^+ .
?: =((lent buf.say.inp) pos.inp) ?: =((lent buf.say.inp) pos.inp)
(sa-blit bel ~) .(+> (se-blit %bel ~))
(ta-hom %del pos.inp) (ta-hom %del pos.inp)
:: ::
++ ta-fec ++ ta-fec
|= fec=console-effect |= fec=console-effect
^+ +> ^+ +>
?- -.fec ?- -.fec
%bel (blit %bel ~) %bel ta-bel
%blk +> %blk +>
%clr (blit %clr ~) %clr +>(+> (se-blit %clr ~))
%det (ta-det p.fec q.fec) %det (ta-got +.fec)
%pro (ta-pro +.fec)
%tan (ta-tan p.fec) %tan (ta-tan p.fec)
%txt $(fec %tan ~[%leaf p.fec]) %txt $(fec [%tan [%leaf p.fec]~])
== ==
:: ::
++ ta-got ++ ta-got
@ -229,13 +240,17 @@
~& [%ta-met key] ~& [%ta-met key]
+> +>
:: ::
++ ta-ret (ta-act ret ~) :: hear return ++ ta-pro :: set prompt
|= pom=console-prompt
+>(pom pom)
::
++ ta-ret (ta-act %ret ~) :: hear return
++ ta-tan :: print tanks ++ ta-tan :: print tanks
|= tac=(list tank) |= tac=(list tank)
=+ wol=`wall`(zing (turn tac |=(a=tank (~(win re [0 edg]) a)))) =+ wol=`wall`(zing (turn tac |=(a=tank (~(win re a) [0 edg]))))
|- ^+ +>.^$ |- ^+ +>.^$
?~ wol +>.^$ ?~ wol +>.^$
$(wol t.wol, +>.^$ (dill-blit %out (tuba i.wol))) $(wol t.wol, +>+>.^$ (se-blit %out (tuba i.wol)))
:: ::
++ ta-txt :: hear text ++ ta-txt :: hear text
|= txt=(list ,@c) |= txt=(list ,@c)
@ -247,34 +262,36 @@
:: ::
++ ta-vew :: computed prompt ++ ta-vew :: computed prompt
^- (pair ,@ud (list ,@c)) ^- (pair ,@ud (list ,@c))
=- [(add pos (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))
?: vis.pom [cap.pom buf.say.inp] ?: vis.pom [cap.pom buf.say.inp]
:- ;: welp :- ;: welp
cap.pom cap.pom
?~ buf.say.inp "" ?~ buf.say.inp ~
%- tuba
;: welp ;: welp
"{" "<"
(scow %p (end 4 1 (sham buf.say.inp))) (scow %p (end 4 1 (sham buf.say.inp)))
"} " "> "
== ==
== ==
=+ len=(lent buf.say.inp) =+ len=(lent buf.say.inp)
|- ^- (list ,@c) |- ^- (list ,@c)
?:(=(0 len) ~ ['*' $(len (dec len))]) ?:(=(0 len) ~ [`@c`'*' $(len (dec len))])
-- --
-- --
++ peer ++ peer
|= [ost=bone her=ship pax=path] |= [ost=bone her=ship pax=path]
^- [(list move) _+>] ^- [(list move) _+>]
?< (~(has by bin) ost) ?< (~(has by bin) ost)
[~ (~(put by bin) [her 80 ~ ~])] [~ +>(bin (~(put by bin) ost *source))]
[~ +>]
:: ::
++ poke-dill-belt ++ poke-dill-belt
|= [ost=bone her=ship bet=dill-belt] |= [ost=bone her=ship bet=dill-belt]
^- [(list move) _+>] ^- [(list move) _+>]
se-abet:se-view:(~(se-belt se ~ [her ost] (~(got by bin) ost)) bet) =< se-abet
=< se-view
(~(se-belt se ~ [her ost] (~(got by bin) ost)) bet)
:: ::
++ pour ++ pour
|= [ost=bone pax=path sih=*] |= [ost=bone pax=path sih=*]
@ -283,11 +300,14 @@
?> ?=([@ @ ~] pax) ?> ?=([@ @ ~] pax)
=< se-abet =< se-abet
=< se-view =< se-view
(~(se-pour se ~ [(slav %p i.pax) ost] (~(got by bin) ost)) i.t.pax sih) (~(se-pour se ~ [(slav %p i.pax) ost] (~(got by bin) ost)) i.t.pax +.sih)
:: ::
++ pull ++ pull
|= ost=bone |= ost=bone
^- [(list move) _+>] ^- [(list move) _+>]
=^ moz +> se-abet:se-view:~(se-kill ~ [our.hid ost] (~(got by bin) ost)) =^ moz +>
=< se-abet
=< se-view
~(se-kill se ~ [our.hid ost] (~(got by bin) ost))
[moz +>.$(bin (~(del by bin) ost))] [moz +>.$(bin (~(del by bin) ost))]
-- --

View File

@ -7,25 +7,16 @@
!: :: :: !: :: ::
:::: :: :: :::: :: ::
:: :: :: :: :: ::
|_ [hid=hide town] |_ [hid=hide ~]
++ peer ,_`. ++ peer ,_`.
++ tease ++ poke--args
^- [(list move) _.] |= [ost=bone you=ship ~]
:_ . ~& %tease
:_ +>.$
:_ ~ :_ ~
:* 0 %pass ~ :* 0 %pass ~
%g %show %g %show
[our.hid /seat] our.hid [our.hid /seat] our.hid
/ /
== ==
++ poke--args
|= [ost=bone you=ship *]
^- [(list move) _+>]
tease
::
++ prep
|= old=(unit (unit house-any))
^- [(list move) _+>]
~& %tease-prep
tease
-- --

View File

@ -5,7 +5,7 @@
:: ::
/? 310 /? 310
/- *console /- *console
:: !:
:::: ::::
:: ::
|% |%
@ -21,7 +21,7 @@
%mor |- ^+ +>.^$ %mor |- ^+ +>.^$
?~ p.ted ?~ p.ted
+>.^$ +>.^$
$(p.ted t.p.ted, +>.$ ^$(ted i.p.ted)) $(p.ted t.p.ted, +>.^$ ^$(ted i.p.ted))
%nop +>.$ %nop +>.$
%set +>.$(buf p.ted, pos (lent p.ted)) %set +>.$(buf p.ted, pos (lent p.ted))
== ==
@ -60,10 +60,10 @@
:: ::
%ins %ins
?- -.dex ?- -.dex
%del ?:((lte p.sin p.dex) dex(p (inc p.dex)) dex) %del ?:((lte p.sin p.dex) dex(p +(p.dex)) dex)
%ins ?: =(p.sin p.dex) %ins ?: =(p.sin p.dex)
?:((gth q.sin q.dex) dex dex(p (inc p.dex))) ?:((gth q.sin q.dex) dex dex(p +(p.dex)))
?:((lte p.sin p.dex) dex(p (inc p.dex)) dex) ?:((lte p.sin p.dex) dex(p +(p.dex)) dex)
== ==
== ==
:: ::

View File

@ -27,6 +27,7 @@
[%blk p=@ud q=@c] :: blink/match char at [%blk p=@ud q=@c] :: blink/match char at
[%clr ~] :: clear screen [%clr ~] :: clear screen
[%det console-change] :: edit input [%det console-change] :: edit input
[%pro console-prompt] :: set prompt
[%tan p=(list tank)] :: classic tank [%tan p=(list tank)] :: classic tank
:: [%taq p=tanq] :: modern tank :: [%taq p=tanq] :: modern tank
[%txt p=tape] :: text line [%txt p=tape] :: text line
@ -34,7 +35,11 @@
++ console-input :: input state ++ console-input :: input state
$: pos=@ud :: cursor position $: pos=@ud :: cursor position
say=console-share :: cursor say=console-share :: cursor
== == ::
++ console-prompt :: prompt definition
$: vis=? :: input visible
cap=(list ,@c) :: caption
== ::
++ console-share :: symmetric state ++ console-share :: symmetric state
$: ven=console-clock :: our vector clock $: ven=console-clock :: our vector clock
leg=(list console-edit) :: unmerged edits leg=(list console-edit) :: unmerged edits