urbit/main/app/seat/core.hook

627 lines
21 KiB
Plaintext
Raw Normal View History

2015-02-09 00:22:33 +03:00
:: :: ::
:::: /hook/core/seat/app :: ::
:: :: ::
/? 314 :: zuse version
/- *console :: console structures
/+ console :: console library
:: :: ::
:::: :: ::
!: :: ::
=> |% :: data structures
++ house :: all state
$: bin=(map bone source) :: input devices
== ::
++ source :: input device
2015-02-16 23:18:10 +03:00
$: edg=_79 :: terminal columns
off=@ud :: window offset
kil=(unit (list ,@c)) :: kill buffer
2015-03-23 01:46:42 +03:00
apt=(list gill) :: application ring
2015-03-23 07:37:01 +03:00
maz=master :: master window
2015-03-23 01:46:42 +03:00
feg=(map gill target) :: live applications
mir=(pair ,@ud (list ,@c)) :: mirrored terminal
2015-02-09 00:22:33 +03:00
== ::
2015-02-16 23:18:10 +03:00
++ master :: master buffer
2015-03-23 07:37:01 +03:00
$: liv=? :: master is live
tar=target :: master target
2015-02-16 23:18:10 +03:00
== ::
2015-02-12 05:57:33 +03:00
++ history :: past input
$: pos=@ud :: input position
num=@ud :: number of entries
lay=(map ,@ud (list ,@c)) :: editing overlay
old=(list (list ,@c)) :: entries proper
== ::
++ search :: reverse-i-search
$: pos=@ud :: search position
str=(list ,@c) :: search string
2015-02-24 21:57:47 +03:00
== ::
2015-02-09 00:22:33 +03:00
++ target :: application target
2015-02-16 23:18:10 +03:00
$: ris=(unit search) :: reverse-i-search
hit=history :: all past input
2015-02-12 05:57:33 +03:00
pom=console-prompt :: static prompt
2015-02-24 21:57:47 +03:00
inp=console-command :: input state
2015-02-09 00:22:33 +03:00
== ::
2015-03-23 07:37:01 +03:00
++ ukase :: master command
$% [%add p=(list gill)] :: add agents
[%del p=(list gill)] :: delete agents
== ::
2015-02-09 00:22:33 +03:00
++ gift :: out result <-$
$% [%mean p=ares] ::
[%nice ~] ::
[%rush %dill-blit dill-blit] ::
== ::
++ sign-gall :: sign from %gall
$% [%mean p=ares] ::
[%nice ~] ::
[%rush %console-effect console-effect] ::
2015-02-09 09:25:00 +03:00
== ::
2015-02-09 00:22:33 +03:00
++ sign :: in result $<-
$% [%g sign-gall] ::
2015-02-09 09:25:00 +03:00
== ::
2015-02-09 00:22:33 +03:00
++ move ,[p=bone q=(mold note gift)] ::
++ note-gall :: note to %gall
2015-02-12 05:57:33 +03:00
$% [%mess p=[p=ship q=path] q=ship r=cage] ::
2015-02-09 00:22:33 +03:00
[%nuke p=[p=ship q=path] q=ship] ::
[%show p=[p=ship q=path] q=ship r=path] ::
[%took p=[p=ship q=path] q=ship] ::
== ::
++ note :: out request $->
$% [%g note-gall] ::
== ::
-- ::
|_ $: hid=hide :: system state
house :: program state
== ::
2015-03-23 01:46:42 +03:00
++ sp
2015-03-23 07:37:01 +03:00
|% ++ sp-ukase
%+ knee *ukase |. ~+
2015-03-23 01:46:42 +03:00
;~ pose
(stag %add ;~(pfix lus sp-gills))
(stag %del ;~(pfix hep sp-gills))
==
::
++ sp-gills
;~ pose
2015-03-23 15:30:00 +03:00
(most ;~(plug com ace) sp-gill)
2015-03-23 01:46:42 +03:00
%+ cook
|= a=ship
[[a %dojo] [a %talk] ~]
;~(pfix sig fed:ag)
==
::
++ sp-gill
;~ pose
(stag our.hid sym)
;~ plug
;~(pfix sig fed:ag)
;~(pfix fas sym)
==
==
--
2015-02-09 00:22:33 +03:00
++ se :: per source
|_ [moz=(list move) [her=ship ost=bone] source]
++ se-abet :: resolve
[(flop moz) %_(+> bin (~(put by bin) ost +<+>))]
::
++ se-belt :: handle input
2015-02-09 09:25:00 +03:00
|= bet=dill-belt
2015-02-09 00:22:33 +03:00
^+ +>
2015-02-09 09:25:00 +03:00
?: ?=(%rez -.bet)
2015-02-16 23:18:10 +03:00
+>(edg (dec p.bet))
2015-02-09 09:25:00 +03:00
?: ?=(%yow -.bet)
2015-02-09 00:22:33 +03:00
(se-link p.bet)
2015-03-23 07:37:01 +03:00
=+ gyl=?^(apt i.apt [~zod %$])
2015-03-23 07:55:06 +03:00
=+ taz=~(. ta [& liv.maz gyl] ?:(liv.maz tar.maz (~(got by feg) gyl)))
2015-02-09 00:22:33 +03:00
=< ta-abet
?- -.bet
%aro (ta-aro:taz p.bet)
%bac ta-bac:taz
2015-02-09 09:25:00 +03:00
%cru (ta-cru:taz p.bet q.bet)
2015-02-09 00:22:33 +03:00
%ctl (ta-ctl:taz p.bet)
2015-02-09 09:25:00 +03:00
%del ta-del:taz
2015-02-09 00:22:33 +03:00
%met (ta-met:taz p.bet)
2015-02-09 09:25:00 +03:00
%ret ta-ret:taz
2015-02-09 00:22:33 +03:00
%txt (ta-txt:taz p.bet)
==
::
++ se-drop :: passive drop
2015-03-23 01:46:42 +03:00
|= gyl=gill
2015-02-09 00:22:33 +03:00
^+ +>
2015-03-23 07:37:01 +03:00
=< se-prom
2015-03-23 01:46:42 +03:00
?> (~(has by feg) gyl)
2015-03-23 07:37:01 +03:00
%_ +>
2015-03-23 07:55:06 +03:00
feg (~(del by feg) gyl)
apt (skip apt |=(a=gill =(gyl a)))
liv.maz ?~(apt & liv.maz)
2015-03-23 07:37:01 +03:00
==
2015-02-09 00:22:33 +03:00
::
++ se-join :: add connection
2015-03-23 01:46:42 +03:00
|= gyl=gill
2015-02-09 00:22:33 +03:00
^+ +>
2015-03-23 07:37:01 +03:00
=< se-prom
?: (~(has by feg) gyl)
(se-blit %bel ~)
+>(liv.maz |, apt [gyl apt], feg (~(put by feg) gyl *target))
2015-02-09 00:22:33 +03:00
::
++ se-nuke :: active drop
2015-03-23 01:46:42 +03:00
|= gyl=gill
2015-02-09 09:25:00 +03:00
^+ +>
2015-03-23 07:57:44 +03:00
(se-drop:(se-send(liv.maz |) gyl %nuke [p.gyl ~[q.gyl]] her) gyl)
2015-02-09 00:22:33 +03:00
::
2015-02-16 23:18:10 +03:00
++ se-like :: act in master
2015-03-23 07:37:01 +03:00
|= kus=ukase
?- -.kus
%add
|- ^+ +>.^$
?~ p.kus +>.^$
$(p.kus t.p.kus, +>.^$ (se-link i.p.kus))
::
%del
|- ^+ +>.^$
?~ p.kus +>.^$
2015-03-23 07:55:06 +03:00
$(p.kus t.p.kus, +>.^$ (se-nuke i.p.kus))
2015-03-23 07:37:01 +03:00
==
::
++ se-prom :: set master prompt
^+ .
%_ .
cad.pom.tar.maz
^- tape
%+ welp
(scow %p our.hid)
=+ ^= mux
|- ^- tape
?~ apt ~
=+ ^= mor ^- tape
?~ t.apt ~
[',' ' ' $(apt t.apt)]
%+ welp
^- tape
=+ txt=(trip q.i.apt)
?: =(our.hid p.i.apt)
txt
:(welp "~" (scow %p p.i.apt) "/" txt)
mor
?~ mux
"# "
:(welp ":" mux "# ")
2015-03-23 01:46:42 +03:00
==
2015-02-16 23:18:10 +03:00
::
2015-02-09 00:22:33 +03:00
++ se-link :: connect to app
2015-03-23 01:46:42 +03:00
|= gyl=gill
2015-02-09 00:22:33 +03:00
^+ +>
2015-03-23 01:46:42 +03:00
%. gyl
2015-02-09 00:22:33 +03:00
=< se-join
2015-03-23 01:46:42 +03:00
(se-send gyl %show [p.gyl ~[q.gyl]] her /console)
2015-02-09 00:22:33 +03:00
::
++ se-blit :: give output
2015-02-09 09:25:00 +03:00
|= bil=dill-blit
2015-02-09 00:22:33 +03:00
(se-emit ost %give %rush %dill-blit bil)
::
2015-02-16 23:18:10 +03:00
++ 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)))
::
2015-02-09 00:22:33 +03:00
++ se-view :: flush buffer
2015-03-23 07:37:01 +03:00
?: liv.maz
2015-03-23 07:55:06 +03:00
(se-just ~(ta-vew ta [& & ~zod %$] tar.maz))
?~ apt
se-view(liv.maz &)
2015-02-16 23:18:10 +03:00
%- se-just
2015-03-23 07:55:06 +03:00
~(ta-vew ta [& | i.apt] (~(got by feg) i.apt))
2015-02-09 00:22:33 +03:00
::
++ se-kill :: kill a source
2015-02-09 09:25:00 +03:00
=+ tup=apt
|- ^+ +>
?~ tup +>(apt ~)
$(tup +.tup, +> (se-nuke i.tup))
2015-02-09 00:22:33 +03:00
::
++ se-emit :: emit move
|= mov=move
%_(+> moz [mov moz])
::
++ se-send :: send a message
2015-03-23 01:46:42 +03:00
|= [gyl=gill nog=note-gall]
(se-emit ost %pass [(scot %p her) (scot %p p.gyl) q.gyl ~] %g nog)
2015-02-09 00:22:33 +03:00
::
++ se-tame
2015-03-23 01:46:42 +03:00
|= gyl=gill
^+ ta
2015-03-23 07:55:06 +03:00
~(. ta [& %| gyl] (~(got by feg) gyl))
2015-02-09 00:22:33 +03:00
::
++ se-pour :: receive results
2015-03-23 01:46:42 +03:00
|= [gyl=gill sil=sign-gall]
2015-02-09 00:22:33 +03:00
^+ +>
?- -.sil
%mean
+>.$
::
%nice
+>.$
::
%rush
2015-03-23 01:46:42 +03:00
ta-abet:ta-rap:(ta-fec:(se-tame gyl) +>.sil)
2015-02-09 00:22:33 +03:00
==
::
++ ta :: per target
|_ $: $: liv=? :: don't delete
2015-03-23 07:55:06 +03:00
mav=? :: showing master
2015-03-23 01:46:42 +03:00
gyl=gill :: target app
2015-02-09 00:22:33 +03:00
== ::
target :: target state
== ::
++ ta-abet :: resolve
2015-02-09 09:25:00 +03:00
^+ ..ta
2015-03-23 07:55:06 +03:00
=. liv.maz mav
?: mav
2015-03-23 07:37:01 +03:00
?. liv
(se-emit ost %give %mean ~)
+>(tar.maz +<+)
?. liv
=. ..ta (se-nuke gyl)
..ta(liv.maz =(~ apt))
2015-03-23 01:46:42 +03:00
%_(+> feg (~(put by feg) gyl +<+))
2015-02-09 00:22:33 +03:00
::
2015-03-23 07:37:01 +03:00
++ ta-ant :: toggle master
^+ .
2015-03-23 07:55:06 +03:00
?: mav
2015-03-23 07:37:01 +03:00
?~ apt ta-bel
%_ .
2015-03-23 07:55:06 +03:00
mav |
2015-03-23 07:37:01 +03:00
+<+ (~(got by feg) gyl)
tar.maz +<+
==
%_ .
2015-03-23 07:55:06 +03:00
mav &
+<+ tar.maz
feg (~(put by feg) gyl +<+)
2015-03-23 07:37:01 +03:00
==
::
2015-03-23 08:18:04 +03:00
++ ta-act :: send action
2015-02-09 00:22:33 +03:00
|= act=console-action
2015-02-09 09:25:00 +03:00
^+ +>
2015-03-23 07:55:06 +03:00
?: mav
2015-03-23 08:18:04 +03:00
+>.$
2015-03-23 01:46:42 +03:00
%_ +>
+>
(se-send gyl %mess [p.gyl ~[q.gyl]] her %console-action !>(act))
==
2015-02-09 00:22:33 +03:00
::
++ ta-aro :: hear arrow
|= key=?(%d %l %r %u)
^+ +>
?- key
2015-02-16 23:18:10 +03:00
%d =. ris ~
?. =(num.hit pos.hit)
2015-02-12 05:57:33 +03:00
(ta-mov +(pos.hit))
?: =(0 (lent buf.say.inp))
ta-bel
(ta-hom:ta-nex %set ~)
2015-02-16 23:18:10 +03:00
%l ?^ ris ta-bel
?: =(0 pos.inp) ta-bel
2015-02-09 09:25:00 +03:00
+>(pos.inp (dec pos.inp))
2015-02-16 23:18:10 +03:00
%r ?^ ris ta-bel
?: =((lent buf.say.inp) pos.inp)
2015-02-09 09:25:00 +03:00
ta-bel
+>(pos.inp +(pos.inp))
2015-02-16 23:18:10 +03:00
%u =. ris ~
?:(=(0 pos.hit) ta-bel (ta-mov (dec pos.hit)))
2015-02-09 00:22:33 +03:00
==
::
2015-02-13 01:50:12 +03:00
++ ta-bel .(+> (se-blit %bel ~)) :: beep
++ ta-cat :: mass insert
|= [pos=@ud txt=(list ,@c)]
^- console-edit
:- %mor
|- ^- (list console-edit)
?~ txt ~
[[%ins pos i.txt] $(pos +(pos), txt t.txt)]
::
++ ta-cut :: mass delete
|= [pos=@ud num=@ud]
^- console-edit
:- %mor
|-(?:(=(0 num) ~ [[%del pos] $(num (dec num))]))
::
++ ta-det :: send edit
|= ted=console-edit
^+ +>
(ta-act %det [[his.ven.say.inp own.ven.say.inp] (sham buf.say.inp) ted])
::
2015-02-09 00:22:33 +03:00
++ ta-bac :: hear backspace
^+ .
2015-02-16 23:18:10 +03:00
?^ ris
?: =(~ str.u.ris)
2015-02-12 05:57:33 +03:00
ta-bel
2015-02-16 23:18:10 +03:00
.(str.u.ris (scag (dec (lent str.u.ris)) str.u.ris))
2015-02-09 00:22:33 +03:00
?: =(0 pos.inp)
2015-02-09 09:25:00 +03:00
.(+> (se-blit %bel ~))
2015-02-12 05:57:33 +03:00
=+ pre=(dec pos.inp)
(ta-hom(pos.inp pre) %del pre)
2015-02-09 00:22:33 +03:00
::
++ ta-ctl :: hear control
|= key=@ud
2015-02-12 05:57:33 +03:00
^+ +>
?+ key ta-bel
%a +>(pos.inp 0)
%b (ta-aro %l)
2015-02-16 23:18:10 +03:00
%c ta-bel(ris ~)
2015-02-12 05:57:33 +03:00
%d ?: &(=(0 pos.inp) =(0 (lent buf.say.inp)))
+>(liv |)
ta-del
%e +>(pos.inp (lent buf.say.inp))
%f (ta-aro %r)
2015-02-16 23:18:10 +03:00
%g ta-bel(ris ~)
2015-02-13 01:50:12 +03:00
%k =+ len=(lent buf.say.inp)
?: =(pos.inp len)
ta-bel
%- ta-hom(kil `(slag pos.inp buf.say.inp))
(ta-cut pos.inp (sub len pos.inp))
2015-02-12 05:57:33 +03:00
%l +>(+> (se-blit %clr ~))
%n (ta-aro %d)
%p (ta-aro %u)
2015-02-16 23:18:10 +03:00
%r ?~ ris
+>(ris `[pos.hit ~])
?: =(0 pos.u.ris)
2015-02-13 01:50:12 +03:00
ta-bel
(ta-ser ~)
2015-02-12 05:57:33 +03:00
%t =+ len=(lent buf.say.inp)
?: |(=(0 pos.inp) (lth len 2))
ta-bel
=+ sop=?:(=(len pos.inp) (dec pos.inp) pos.inp)
=. pos.inp +(sop)
%- ta-hom
:~ %mor
[%del sop]
[%ins (dec sop) (snag sop buf.say.inp)]
==
2015-02-13 01:50:12 +03:00
%u ?: =(0 pos.inp)
ta-bel
%- ta-hom(pos.inp 0, kil `(scag pos.inp buf.say.inp))
(ta-cut 0 pos.inp)
2015-03-23 07:37:01 +03:00
%v ta-ant
2015-02-16 23:18:10 +03:00
%x ?: =(~ apt) ta-bel
2015-03-23 07:55:06 +03:00
?: mav ta-bel
2015-02-16 23:18:10 +03:00
+>(apt (welp (slag 1 apt) [(snag 0 apt) ~]))
2015-02-13 01:50:12 +03:00
%y ?~ kil ta-bel
%- ta-hom(pos.inp (add pos.inp (lent u.kil)))
(ta-cat pos.inp u.kil)
2015-02-12 05:57:33 +03:00
==
2015-02-09 00:22:33 +03:00
::
2015-02-09 09:25:00 +03:00
++ ta-cru :: hear crud
|= [lab=@tas tac=(list tank)]
=. +>+> (se-blit %out (tuba (trip lab)))
(ta-tan tac)
::
2015-02-09 00:22:33 +03:00
++ ta-del :: hear delete
^+ .
?: =((lent buf.say.inp) pos.inp)
2015-02-09 09:25:00 +03:00
.(+> (se-blit %bel ~))
2015-02-09 00:22:33 +03:00
(ta-hom %del pos.inp)
::
2015-03-19 21:53:05 +03:00
++ ta-err :: hear error
|= pos=@ud
=. pos (~(transpose cs say.inp) pos)
ta-bel(pos.inp (min pos (lent buf.say.inp)))
::
2015-02-12 05:57:33 +03:00
++ ta-fec :: apply effect
2015-02-09 00:22:33 +03:00
|= fec=console-effect
^+ +>
?- -.fec
2015-02-09 09:25:00 +03:00
%bel ta-bel
2015-02-09 00:22:33 +03:00
%blk +>
2015-02-24 21:57:47 +03:00
%clr +>(+> (se-blit fec))
2015-02-09 09:25:00 +03:00
%det (ta-got +.fec)
2015-03-19 21:53:05 +03:00
%err (ta-err +.fec)
%mor |- ^+ +>.^$
?~ p.fec +>.^$
$(p.fec t.p.fec, +>.^$ ^$(fec i.p.fec))
2015-02-12 05:57:33 +03:00
%nex ta-nex
2015-02-09 09:25:00 +03:00
%pro (ta-pro +.fec)
2015-02-09 00:22:33 +03:00
%tan (ta-tan p.fec)
2015-02-24 21:57:47 +03:00
%sag +>(+> (se-blit fec))
%sav +>(+> (se-blit fec))
2015-02-09 09:25:00 +03:00
%txt $(fec [%tan [%leaf p.fec]~])
2015-02-09 00:22:33 +03:00
==
::
++ ta-rap :: send %took
2015-03-23 01:46:42 +03:00
.(+> (se-send gyl %took [p.gyl ~[q.gyl]] her))
::
++ ta-dog :: change cursor
|= ted=console-edit
%_ +>
pos.inp
=+ len=(lent buf.say.inp)
%+ min len
|- ^- @ud
?- -.ted
%del ?:((gth pos.inp p.ted) (dec pos.inp) pos.inp)
%ins ?:((lte pos.inp p.ted) +(pos.inp) pos.inp)
%mor |- ^- @ud
?~ p.ted pos.inp
$(p.ted t.p.ted, pos.inp ^$(ted i.p.ted))
%nop pos.inp
%set len
==
==
2015-02-12 05:57:33 +03:00
::
++ ta-got :: apply change
|= cal=console-change
=^ ted say.inp (~(receive cs say.inp) cal)
(ta-dog ted)
2015-02-09 00:22:33 +03:00
::
++ ta-hom :: local edit
|= ted=console-edit
^+ +>
=. +> (ta-det ted)
=. +> (ta-dog(say.inp (~(commit cs say.inp) ted)) ted)
2015-02-12 05:57:33 +03:00
+>
2015-02-09 00:22:33 +03:00
::
++ ta-met :: meta key
|= key=@ud
~& [%ta-met key]
+>
::
2015-02-12 05:57:33 +03:00
++ ta-mov :: move in history
|= sop=@ud
^+ +>
?: =(sop pos.hit) +>
%+ %= ta-hom
pos.hit sop
lay.hit %+ ~(put by lay.hit)
pos.hit
buf.say.inp
==
%set
%- (bond |.((snag (sub num.hit +(sop)) old.hit)))
(~(get by lay.hit) sop)
::
++ ta-nex :: advance history
%_ .
num.hit +(num.hit)
pos.hit +(num.hit)
2015-02-16 23:18:10 +03:00
ris ~
2015-02-12 05:57:33 +03:00
lay.hit ~
old.hit [buf.say.inp old.hit]
==
::
2015-02-09 09:25:00 +03:00
++ ta-pro :: set prompt
|= pom=console-prompt
+>(pom pom)
::
2015-03-23 07:37:01 +03:00
++ ta-ret :: hear return
2015-03-23 07:55:06 +03:00
?. mav
2015-03-23 07:37:01 +03:00
(ta-act %ret ~)
=+ fey=(ruse (tufa buf.say.inp) sp-ukase:sp)
?- -.fey
%| (ta-err p.fey)
%& =. +>+ (se-like p.fey)
=. pom pom.tar.maz
(ta-hom:ta-nex %set ~)
==
::
2015-02-12 05:57:33 +03:00
++ ta-ser :: reverse search
|= ext=(list ,@c)
^+ +>
2015-02-16 23:18:10 +03:00
?: |(?=(~ ris) =(0 pos.u.ris)) ta-bel
=+ tot=(weld str.u.ris ext)
=+ dol=(slag (sub num.hit pos.u.ris) old.hit)
=+ sop=pos.u.ris
2015-02-12 05:57:33 +03:00
=+ ^= ser
=+ ^= beg
|= [a=(list ,@c) b=(list ,@c)] ^- ?
?~(a & ?~(b | &(=(i.a i.b) $(a t.a, b t.b))))
|= [a=(list ,@c) b=(list ,@c)] ^- ?
?~(a & ?~(b | |((beg a b) $(b t.b))))
=+ ^= sup
|- ^- (unit ,@ud)
?~ dol ~
?: (ser tot i.dol)
`sop
$(sop (dec sop), dol t.dol)
?~ sup ta-bel
2015-02-16 23:18:10 +03:00
(ta-mov(str.u.ris tot, pos.u.ris (dec u.sup)) (dec u.sup))
2015-02-12 05:57:33 +03:00
::
2015-02-09 00:22:33 +03:00
++ ta-tan :: print tanks
|= tac=(list tank)
2015-02-09 09:25:00 +03:00
=+ wol=`wall`(zing (turn tac |=(a=tank (~(win re a) [0 edg]))))
2015-02-09 00:22:33 +03:00
|- ^+ +>.^$
?~ wol +>.^$
2015-02-09 09:25:00 +03:00
$(wol t.wol, +>+>.^$ (se-blit %out (tuba i.wol)))
2015-02-09 00:22:33 +03:00
::
++ ta-txt :: hear text
|= txt=(list ,@c)
2015-02-12 05:57:33 +03:00
^+ +>
2015-02-16 23:18:10 +03:00
?^ ris
2015-02-12 05:57:33 +03:00
(ta-ser txt)
%- ta-hom(pos.inp (add (lent txt) pos.inp))
2015-02-09 00:22:33 +03:00
:- %mor
|- ^- (list console-edit)
?~ txt ~
[[%ins pos.inp i.txt] $(pos.inp +(pos.inp), txt t.txt)]
::
++ ta-vew :: computed prompt
2015-02-12 05:57:33 +03:00
|- ^- (pair ,@ud (list ,@c))
2015-02-16 23:18:10 +03:00
?^ ris
2015-02-12 05:57:33 +03:00
%= $
2015-02-16 23:18:10 +03:00
ris ~
2015-03-19 22:58:54 +03:00
cad.pom
:(welp "(reverse-i-search)'" (tufa str.u.ris) "': ")
2015-02-12 05:57:33 +03:00
==
2015-03-19 22:58:54 +03:00
=- [(add pos.inp (lent p.vew)) (weld (tuba p.vew) q.vew)]
^= vew ^- (pair tape (list ,@c))
?: vis.pom [cad.pom buf.say.inp]
2015-02-09 00:22:33 +03:00
:- ;: welp
2015-03-19 22:58:54 +03:00
cad.pom
2015-02-09 09:25:00 +03:00
?~ buf.say.inp ~
2015-02-09 00:22:33 +03:00
;: welp
2015-02-09 09:25:00 +03:00
"<"
2015-02-09 00:22:33 +03:00
(scow %p (end 4 1 (sham buf.say.inp)))
2015-02-09 09:25:00 +03:00
"> "
2015-02-09 00:22:33 +03:00
==
==
=+ len=(lent buf.say.inp)
|- ^- (list ,@c)
2015-02-09 09:25:00 +03:00
?:(=(0 len) ~ [`@c`'*' $(len (dec len))])
2015-02-09 00:22:33 +03:00
--
--
++ peer
|= [ost=bone her=ship pax=path]
^- [(list move) _+>]
?< (~(has by bin) ost)
2015-02-16 23:18:10 +03:00
:- [ost %give %rush %dill-blit %pro [`@c`0x23 `@c`0x20 ~]]~
%= +>
bin
%+ ~(put by bin) ost
^- source
:* 80
0
~
~
2015-03-23 07:37:01 +03:00
:* %&
*(unit search)
*history
2015-03-23 15:30:00 +03:00
`console-prompt`[%& %seat "{(scow %p our.hid)}# "]
2015-03-23 07:37:01 +03:00
*console-command
==
2015-02-16 23:18:10 +03:00
~
[0 ~]
==
==
2015-02-09 00:22:33 +03:00
::
++ poke-dill-belt
|= [ost=bone her=ship bet=dill-belt]
^- [(list move) _+>]
2015-02-09 09:25:00 +03:00
=< se-abet
=< se-view
2015-02-09 23:40:44 +03:00
(~(se-belt se [ost %give %nice ~]~ [her ost] (~(got by bin) ost)) bet)
2015-02-09 00:22:33 +03:00
::
++ pour
|= [ost=bone pax=path sih=*]
^- [(list move) _+>]
=+ sih=((hard sign) sih)
2015-03-23 01:46:42 +03:00
?> ?=([@ @ @ ~] pax)
2015-02-09 00:22:33 +03:00
=< se-abet
=< se-view
2015-03-23 01:46:42 +03:00
=+ gyl=[(slav %p i.t.pax) i.t.t.pax]
(~(se-pour se ~ [(slav %p i.pax) ost] (~(got by bin) ost)) gyl +.sih)
2015-02-09 00:22:33 +03:00
::
++ pull
|= ost=bone
^- [(list move) _+>]
2015-02-09 09:25:00 +03:00
=^ moz +>
=< se-abet
=< se-view
~(se-kill se ~ [our.hid ost] (~(got by bin) ost))
2015-02-09 00:22:33 +03:00
[moz +>.$(bin (~(del by bin) ost))]
--