urbit/arvo/dill.hoon

754 lines
28 KiB
Plaintext
Raw Normal View History

2014-10-22 06:59:05 +04:00
!:
2013-09-29 00:21:18 +04:00
:: dill (4d), terminal handling
::
2013-12-15 09:42:27 +04:00
|= pit=vase
2014-06-09 01:27:04 +04:00
=> |% :: interface tiles
2014-06-03 09:07:32 +04:00
++ gift :: out result <-$
2014-06-06 03:48:13 +04:00
$% [%bbye ~] :: reset prompt
[%blit p=(list blit)] :: terminal output
[%init p=@p] :: report install
2014-11-20 01:18:37 +03:00
[%logo @] :: logout
2014-06-06 03:48:13 +04:00
[%veer p=@ta q=path r=@t] :: install vane
[%vega p=path] :: reboot by path
2014-10-24 02:56:06 +04:00
[%verb ~] ::
2014-10-22 06:59:05 +04:00
== ::
2014-06-03 09:07:32 +04:00
++ kiss :: in request ->$
2014-06-06 02:14:49 +04:00
$% [%belt p=belt] :: terminal input
[%blew p=blew] :: terminal config
2014-06-22 09:08:01 +04:00
[%boot p=*] :: weird %dill boot
2014-06-06 02:14:49 +04:00
[%crud p=@tas q=(list tank)] :: error with trace
[%flog p=flog] :: wrapped error
[%hail ~] :: terminal refresh
[%hook ~] :: this term hung up
2014-06-05 00:24:26 +04:00
[%harm ~] :: all terms hung up
2014-10-22 06:59:05 +04:00
[%init p=ship] :: after gall ready
2014-06-06 02:14:49 +04:00
[%noop ~] :: no operation
2014-06-06 05:48:53 +04:00
[%talk p=tank] ::
[%text p=tape] ::
2014-06-06 02:14:49 +04:00
== ::
++ flog :: sent to %dill
$% [%crud p=@tas q=(list tank)] ::
[%text p=tape] ::
== ::
2014-10-22 23:13:07 +04:00
++ mess :: message to terminal
$% [%term-ctrl p=(hypo ,%hail)] ::
2014-10-22 06:59:05 +04:00
[%term-in p=(hypo term-in)] ::
== ::
2014-06-22 09:49:10 +04:00
++ move ,[p=duct q=(mold note gift)] :: local move
2014-06-03 09:07:32 +04:00
++ note :: out request $->
2014-10-22 06:59:05 +04:00
$% $: %a ::
$% [%make p=(unit ,@t) q=@ud r=@ s=?] ::
2014-06-22 02:06:42 +04:00
[%sith p=@p q=@uw r=?] ::
2014-10-28 04:50:07 +03:00
== == ::
$: %c ::
$% [%warp p=sock q=riff] ::
2014-06-22 02:06:42 +04:00
== == ::
2014-10-28 04:50:07 +03:00
$: %d ::
2014-06-22 02:06:42 +04:00
$% [%crud p=@tas q=(list tank)] ::
[%text p=tape] ::
2014-10-22 06:59:05 +04:00
== == ::
$: %g ::
$% [%mess p=[p=ship q=path] q=ship r=mess] ::
2014-12-02 00:42:21 +03:00
[%nuke p=[p=ship q=path] q=ship] ::
2014-10-22 06:59:05 +04:00
[%show p=[p=ship q=path] q=ship r=path] ::
2015-01-19 07:52:43 +03:00
[%took p=[p=ship q=path] q=ship] ::
2014-10-22 06:59:05 +04:00
== == ::
$: %t ::
$% [%wait p=@da] ::
2014-06-22 02:06:42 +04:00
== == == ::
2014-10-28 04:50:07 +03:00
++ riff ,[p=desk q=(unit rave)] :: see %clay
2014-06-22 09:49:10 +04:00
++ sign :: in result $<-
$?
2014-10-28 04:50:07 +03:00
$: %c ::
$% [%writ p=riot] ::
== == ::
2014-10-22 06:59:05 +04:00
$: %g ::
2014-11-20 01:18:37 +03:00
$% [%logo p=@] ::
[%mean p=ares] ::
2014-10-22 06:59:05 +04:00
[%nice ~] ::
2015-01-27 00:53:35 +03:00
$: %rush ::
$% [%term-line q=term-line] ::
2014-10-22 06:59:05 +04:00
[%hymn q=manx] ::
== == ::
2014-10-24 02:56:06 +04:00
[%verb ~] ::
2014-08-01 00:23:02 +04:00
[%sage p=path q=*] ::
2014-06-22 02:06:42 +04:00
[%veer p=@ta q=path r=@t] ::
[%vega p=path] ::
== == ::
2014-12-17 02:29:07 +03:00
$: %t ::
$% [%wake ~] ::
== ==
2014-06-22 02:06:42 +04:00
$: @tas :: by any
$% [%crud p=@tas q=(list tank)] ::
2014-06-22 09:08:01 +04:00
[%init p=@p] ::
2014-06-22 02:06:42 +04:00
[%note p=@tD q=tank] ::
== == == ::
2014-10-22 06:59:05 +04:00
++ term-in ::
$: pax=path ::
$= jof ::
2015-01-14 08:38:39 +03:00
$% [%line p=cord] ::
2014-10-22 06:59:05 +04:00
[%res p=span] ::
[%cmd p=char] ::
2014-12-17 02:29:07 +03:00
[%type p=?] ::
2014-10-22 06:59:05 +04:00
== == ::
2014-11-19 04:17:11 +03:00
++ term-line ,[p=[p=cord q=prom r=cord] q=(list cord) r=(list tark)]
2014-12-17 23:38:23 +03:00
++ tark ?(tank [%stem p=@da q=tank r=tank]) ::
2014-06-09 01:27:04 +04:00
:::::::: :: dill tiles
++ bein :: terminal control
$: $: bul=@ud :: buffer length
bus=@ud :: cursor in buffer
but=(list ,@c) :: buffer text
buy=prom :: input style
== ::
$: hiz=@ud :: history depth
hux=path :: history path
hym=(map ,@ud (list ,@c)) :: history overlay
hyt=hist :: history object
hyr=(unit (list ,@c)) :: history search
== ::
$: pol=@ud :: length of prompt
pot=tape :: prompt text
== ::
== ::
++ blew ,[p=@ud q=@ud] :: columns rows
++ belt :: raw console input
$% [%aro p=?(%d %l %r %u)] :: arrow key
[%bac ~] :: true backspace
[%ctl p=@ud] :: control-key
[%del ~] :: true delete
[%met p=@ud] :: meta-key
[%ret ~] :: return
[%txt p=(list ,@c)] :: utf32 text
== ::
++ blit :: raw console output
$% [%bel ~] :: make a noise
[%clr ~] :: clear the screen
[%hop p=@ud] :: set cursor position
[%lin p=(list ,@c)] :: set current line
[%mor ~] :: newline
2014-08-01 00:23:02 +04:00
[%sag p=path q=*] :: save to jamfile
2014-06-09 01:27:04 +04:00
[%sav p=path q=@] :: save to file
== ::
++ blot :: kill ring
$: p=@ud :: length
q=@ud :: depth
r=(list (list ,@c)) :: kills
== ::
++ blur ,[p=@ud q=(unit bein) r=blot] :: columns, prompt
2014-10-22 06:59:05 +04:00
++ kyev ::
$: p=(set ?(%ctrl %shift %alt %meta)) ::
q=$|(cord [%act speck]) ::
== ::
++ speck ::
$? %ctrl %shift %alt %meta %entr %esc ::
%caps %uncap %pgup %pgdn %home %end ::
%baxp %del %ins %up %down %left ::
%right ::
== ::
2014-06-09 01:27:04 +04:00
++ yard :: terminal state
2014-12-17 02:29:07 +03:00
$: p=? :: verbose
q=blur :: display state
r=(map path hist) :: history
s=[p=? q=@da] :: typing?/last typed
== ::
:: XX LEGACY 12-16-2014
++ yord :: old terminal state
2014-06-09 01:27:04 +04:00
$: p=? :: verbose
q=blur :: display state
r=(map path hist) :: history
== ::
2014-06-06 02:14:49 +04:00
-- =>
|%
++ dy
2014-12-17 02:29:07 +03:00
|= [hen=duct our=ship now=@da def=(unit duct) dug=(map duct yard)]
2013-09-29 00:21:18 +04:00
=+ ^= yar ^- yard
2014-06-06 02:14:49 +04:00
=+ yur=(~(get by dug) hen)
?^ yur u.yur
2014-10-30 02:07:13 +03:00
?^ def (~(got by dug) u.def)
2014-12-17 02:29:07 +03:00
[& [80 ~ *blot] ~ | *@da]
2013-09-29 00:21:18 +04:00
=| mos=(list move)
|%
++ beep (curb [[%bel ~] ~]) :: send beep
++ curb :: send blits
2013-12-15 09:42:27 +04:00
|= wab=(list blit)
2013-09-29 00:21:18 +04:00
^+ +>
?~ wab +>
2014-05-24 00:46:43 +04:00
+>(mos [[hen [%give %blit (flop wab)]] mos])
2013-09-29 00:21:18 +04:00
::
2014-01-07 01:43:44 +04:00
++ wod :: word forward
2014-06-02 01:07:13 +04:00
|= bed=bein
2014-01-07 01:43:44 +04:00
^- @ud
?: =(bul.bed bus.bed)
bus.bed
?: =(' ' (snag bus.bed but.bed))
$(bus.bed +(bus.bed))
|-
^- @ud
?: =(bul.bed bus.bed)
bus.bed
?: =(' ' (snag bus.bed but.bed))
bus.bed
$(bus.bed +(bus.bed))
::
++ wob :: word backward
2014-06-02 01:07:13 +04:00
|= bed=bein
2014-01-07 01:43:44 +04:00
^- @ud
?: =(0 bus.bed)
bus.bed
?: =(' ' (snag (dec bus.bed) but.bed))
$(bus.bed (dec bus.bed))
|-
^- @ud
?: =(0 bus.bed)
bus.bed
?: =(' ' (snag (dec bus.bed) but.bed))
bus.bed
$(bus.bed (dec bus.bed))
::
2013-09-29 00:21:18 +04:00
++ edit :: change the bed
2014-06-02 01:07:13 +04:00
|= bed=bein
2013-09-29 00:21:18 +04:00
^+ +>
=. q.q.yar [~ bed]
2013-12-24 00:49:15 +04:00
?> ?=(^ q.q.yar)
2013-09-29 00:21:18 +04:00
%- curb
|- ^- (list blit)
?^ hyr.u.q.q.yar
=+ ris=:(weld "(reverse-i-search)'" (tufa u.hyr.u.q.q.yar) "': ")
%= $
pot.bed ris
pol.bed (lent ris)
hyr.u.q.q.yar ~
==
2013-09-29 00:21:18 +04:00
:~ [%hop (add pol.bed bus.bed)]
:- %lin
%+ weld pot.bed
?- buy.bed
%none but.bed
%text but.bed
%pass `(list ,@)`(runt [(lent but.bed) '*'] ~)
==
==
::
++ fume :: print tank, prefix
2013-12-15 09:42:27 +04:00
|= [pef=@tD tac=tank]
2013-09-29 00:21:18 +04:00
^+ +>
=+ wol=(~(win re tac) 2 p.q.yar)
%- furl
%+ turn wol
2013-12-15 09:42:27 +04:00
|= a=tape ^- tape
2013-09-29 00:21:18 +04:00
?> ?=([@ @ *] a)
[pef ' ' t.t.a]
::
++ furl :: print wall
2013-12-15 09:42:27 +04:00
|= wol=(list tape)
2013-09-29 00:21:18 +04:00
^+ +>
=. +>
%- curb
%- flop
|- ^- (list blit)
?~ wol ~
[[%lin (tuba i.wol)] [%mor ~] $(wol t.wol)]
?~ q.q.yar +>
(edit(q.q.yar ~) u.q.q.yar)
::
++ gore :: move in history
2013-12-15 09:42:27 +04:00
|= hup=@ud
2013-09-29 00:21:18 +04:00
^+ +>
=+ but=(goth hup)
2013-09-29 00:21:18 +04:00
=+ bul=(lent but)
%- edit
2013-12-24 00:49:15 +04:00
?> ?=(^ q.q.yar)
2013-09-29 00:21:18 +04:00
%= u.q.q.yar
hiz hup
hym %+ ~(put by hym.u.q.q.yar)
hiz.u.q.q.yar
but.u.q.q.yar
bus bul
bul bul
2013-09-29 00:21:18 +04:00
but but
==
::
++ goth :: extract history
2013-12-15 09:42:27 +04:00
|= hup=@ud
2013-12-24 00:49:15 +04:00
?> ?=(^ q.q.yar)
=+ byt=(~(get by hym.u.q.q.yar) hup)
?^ byt u.byt
(tuba (rip 3 (snag hup q.hyt.u.q.q.yar)))
::
2013-09-29 00:21:18 +04:00
++ kill :: add to kill ring
2013-12-15 09:42:27 +04:00
|= txt=(list ,@c)
2013-09-29 00:21:18 +04:00
^+ +>
=> ?. =(16 p.r.q.yar) .
.(p.r.q.yar 15, r.r.q.yar (scag 15 r.r.q.yar))
%= +>
p.r.q.yar +(p.r.q.yar)
q.r.q.yar 0
r.r.q.yar [txt r.r.q.yar]
==
::
++ look :: search in history
2013-12-15 09:42:27 +04:00
|= [hup=@ud txt=(list ,@c)]
^+ +>
=+ ^= beg
2013-12-15 09:42:27 +04:00
|= [a=(list ,@c) b=(list ,@c)] ^- ?
?~(a & ?~(b | &(=(i.a i.b) $(a t.a, b t.b))))
=+ ^= mid
2013-12-15 09:42:27 +04:00
|= [a=(list ,@c) b=(list ,@c)] ^- ?
?~(a & ?~(b | |((beg a b) $(b t.b))))
2013-12-24 00:49:15 +04:00
?> ?=(^ q.q.yar)
?: =(hup p.hyt.u.q.q.yar)
beep
=+ but=(goth hup)
?: (mid txt but)
(gore(hyr.u.q.q.yar [~ txt]) hup)
$(hup +(hup))
::
2014-06-06 02:14:49 +04:00
++ leap :: accept response
2014-06-22 09:49:10 +04:00
|= [tea=wire sih=sign]
2014-06-06 02:14:49 +04:00
^+ +>
2014-06-22 02:06:42 +04:00
?- -.+.sih
2014-06-06 02:14:49 +04:00
%crud :: error trace
2014-06-22 02:06:42 +04:00
=. q.+.sih [[%leaf (trip p.+.sih)] q.+.sih]
2014-06-06 02:14:49 +04:00
|- ^+ +>.^$
2014-06-22 02:06:42 +04:00
?~ q.+.sih +>.^$
(fume:$(q.+.sih t.q.+.sih) '!' `tank`i.q.+.sih)
2014-06-06 02:14:49 +04:00
::
2014-10-22 06:59:05 +04:00
%mean ~& %dill-mean +>.$
%nice +>.$
%note ?.(p.yar +>.$ (fume p.+.sih q.+.sih)) :: debug message
?(%rush %rust) :: XX reset prompt
2015-01-19 07:52:43 +03:00
=. mos :_(mos [hen %pass tea %g %took [our /terminal] our])
?> ?=(%term-line +>-.sih)
=. +>.$
2015-01-20 03:07:31 +03:00
=+ lis=(scag 1.000 r.q.sih)
=- (furl (zing (turn (flop lis) -)))
|= a=tark
^- wall
?+ -.a (~(win re a) 0 p.q.yar)
%stem
?: =(q.s.yar p.a) ~
~[(welp ~(ram re q.a) ~(ram re r.a))]
==
2015-01-27 00:53:35 +03:00
?. (levy r.q.sih |=(a=tark ?=(%stem -.a)))
+>.$ :: XX separate prompt/history messages
%- edit
=| bed=bein
=+ ^= hyt ^- hist
=+ hyt=(~(get by r.yar) /)
?~(hyt *hist u.hyt)
?: &(?=(^ q.q.yar) =(/ hux.u.q.q.yar))
=+ bun=(rip 5 (turf r.p.q.sih))
%= u.q.q.yar
bul ?~ r.p.q.sih bul.u.q.q.yar (lent bun)
bus ?~ r.p.q.sih bus.u.q.q.yar (lent bun)
but ?~ r.p.q.sih but.u.q.q.yar bun
hyt [+(p.hyt) [%$ q.hyt]]
pot (trip p.p.q.sih)
pol (met 3 p.p.q.sih)
buy q.p.q.sih
2014-06-06 02:14:49 +04:00
==
%_ bed
bul (met 3 r.p.q.sih)
bus (met 3 r.p.q.sih)
but (rip 3 r.p.q.sih)
buy q.p.q.sih
hux /
hiz 0
hyt [+(p.hyt) [%$ q.hyt]]
pot (trip p.p.q.sih)
pol (met 3 p.p.q.sih)
2014-06-06 02:14:49 +04:00
==
::
2014-08-01 00:23:02 +04:00
%sage :: write a jamfile
%= +>.$
mos :_(mos [hen [%give %blit [%sag p.+.sih q.+.sih] ~]])
==
2014-11-20 01:18:37 +03:00
?(%init %logo %veer %vega %verb) :: drop-throughs
2014-06-22 02:06:42 +04:00
+>(mos :_(mos [hen %give +.sih]))
2014-11-20 01:18:37 +03:00
%writ :: file exists
2014-12-17 02:29:07 +03:00
%_ +>.$
2014-10-22 06:59:05 +04:00
mos
:_ mos
[hen %pass /term-show %g %show [our /terminal] our /lines]
2014-10-22 06:59:05 +04:00
==
2014-12-17 02:29:07 +03:00
::
%wake
2015-01-07 23:37:55 +03:00
?: (lte (sub now ~s15) q.s.yar)
2014-12-17 02:29:07 +03:00
%_ +>.$
mos
:_ mos
[hen %pass /activity %t %wait (add q.s.yar ~s15)]
==
%_ +>.$
p.s.yar |
mos :_(mos (poke %term-in -:!>(*term-in) / %type %|))
==
2014-06-06 02:14:49 +04:00
==
::
++ lear :: handle request
|= kyz=kiss
^+ +>
?- -.kyz
%flog !!
%noop +>
2013-09-29 00:21:18 +04:00
%belt :: terminal input
2014-12-17 02:29:07 +03:00
=. +>.$
2014-12-17 23:38:23 +03:00
?. ?=(?(%bac %del %ret %txt) -.p.kyz) +>.$
2014-12-17 02:29:07 +03:00
?: p.s.yar +>.$(s.yar [& now])
%_ +>.$
s.yar [& now]
mos
:_ :_ mos
[hen %pass /activity %t %wait (add ?:(p.s.yar q.s.yar now) ~s15)]
(poke %term-in -:!>(*term-in) / %type %&)
==
2013-09-29 00:21:18 +04:00
?~ q.q.yar
2014-11-19 02:12:12 +03:00
%^ furl
"Downloading files from ticketing ship, please wait until"
"a prompt shows up. This could take several minutes."
2014-11-19 02:12:12 +03:00
~
?^ hyr.u.q.q.yar :: live search
2014-06-06 02:14:49 +04:00
?+ p.kyz $(hiz.u.q.q.yar 0, hyr.u.q.q.yar ~)
[%bac *]
?: =(~ u.hyr.u.q.q.yar)
(curb [[%bel ~] ~])
%- edit
%= u.q.q.yar
hyr [~ (scag (dec (lent u.hyr.u.q.q.yar)) u.hyr.u.q.q.yar)]
==
::
2014-06-06 02:14:49 +04:00
[%txt *] (look hiz.u.q.q.yar (weld u.hyr.u.q.q.yar p.p.kyz))
[%ctl %g] (edit u.q.q.yar(bul 0, bus 0, but ~, hiz 0, hyr ~))
[%ctl %r]
?: =(p.hyt.u.q.q.yar hiz.u.q.q.yar)
beep
(look +(hiz.u.q.q.yar) u.hyr.u.q.q.yar)
==
2014-06-06 02:14:49 +04:00
?- -.p.kyz
2013-09-29 00:21:18 +04:00
%aro :: arrow
2014-06-06 02:14:49 +04:00
?- p.p.kyz
2013-09-29 00:21:18 +04:00
%d :: down
?: =(0 hiz.u.q.q.yar)
beep
(gore (dec hiz.u.q.q.yar))
::
%l :: left
?: =(0 bus.u.q.q.yar)
beep
(edit u.q.q.yar(bus (dec bus.u.q.q.yar)))
::
%r :: right
?: =(bul.u.q.q.yar bus.u.q.q.yar)
beep
(edit u.q.q.yar(bus +(bus.u.q.q.yar)))
::
%u
=+ hup=+(hiz.u.q.q.yar)
?: =(hup p.hyt.u.q.q.yar)
beep
(gore hup)
==
::
%bac :: backspace
2014-06-06 02:14:49 +04:00
^+ +>.$
2013-09-29 00:21:18 +04:00
?: =(0 bus.u.q.q.yar)
(curb `(list blit)`[[%bel ~] ~])
%- edit
%= u.q.q.yar
bus (dec bus.u.q.q.yar)
bul (dec bul.u.q.q.yar)
but
%+ weld
2013-09-29 00:21:18 +04:00
(scag (dec bus.u.q.q.yar) but.u.q.q.yar)
(slag bus.u.q.q.yar but.u.q.q.yar)
==
::
%ctl :: control
2014-06-06 02:14:49 +04:00
?+ p.p.kyz
2013-09-29 00:21:18 +04:00
beep
%a (edit u.q.q.yar(bus 0))
2014-06-06 02:14:49 +04:00
%b $(kyz [%belt %aro %l])
2013-09-29 00:21:18 +04:00
%d ?: ?& =(0 bul.u.q.q.yar)
=(0 bus.u.q.q.yar)
==
2014-11-20 01:18:37 +03:00
+>.$(mos :_(mos (poke %term-in -:!>(*term-in) / %cmd %d)))
2014-06-06 02:14:49 +04:00
$(kyz [%belt %del ~])
2013-09-29 00:21:18 +04:00
%e (edit u.q.q.yar(bus bul.u.q.q.yar))
2014-06-06 02:14:49 +04:00
%f $(kyz [%belt %aro %r])
2014-11-25 00:15:04 +03:00
%g +>.$(mos :_(mos (poke %term-in -:!>(*term-in) / %cmd %g)))
2013-09-29 00:21:18 +04:00
%k ?: =(bul.u.q.q.yar bus.u.q.q.yar)
beep
2014-06-06 02:14:49 +04:00
=> .(+>.$ (kill (slag bus.u.q.q.yar but.u.q.q.yar)))
2013-09-29 00:21:18 +04:00
%- edit
2013-12-24 00:49:15 +04:00
?> ?=(^ q.q.yar)
2013-09-29 00:21:18 +04:00
%= u.q.q.yar
bul bus.u.q.q.yar
but (scag bus.u.q.q.yar but.u.q.q.yar)
==
%t ?: (lth bul.u.q.q.yar 2)
beep
=+ ^= pos
2014-01-24 13:16:31 +04:00
?: =(bul.u.q.q.yar bus.u.q.q.yar)
(sub bus.u.q.q.yar 2)
?: =(0 bus.u.q.q.yar)
bus.u.q.q.yar
(dec bus.u.q.q.yar)
%- edit
%= u.q.q.yar
bus (add 2 pos)
but %+ weld
%+ weld
(scag pos but.u.q.q.yar)
^- (list ,@c) :+
(snag +(pos) but.u.q.q.yar)
(snag pos but.u.q.q.yar)
~
(slag (add 2 pos) but.u.q.q.yar)
==
2014-06-06 02:14:49 +04:00
%l +>.$(mos :_(mos [hen %give %blit [[%clr ~] ~]]))
%n $(kyz [%belt %aro %d])
2014-12-02 00:42:21 +03:00
%o %_ +>.$
mos
2014-12-06 00:48:30 +03:00
:_ :_ mos
2014-12-02 00:42:21 +03:00
[hen %pass /term-show %g %nuke [our /terminal] our]
[hen %pass /term-show %g %show [our /terminal] our /lines]
2014-12-02 00:42:21 +03:00
==
2014-06-06 02:14:49 +04:00
%p $(kyz [%belt %aro %u])
2013-09-29 00:21:18 +04:00
%u ?: =(0 bus.u.q.q.yar)
beep
2014-06-06 02:14:49 +04:00
=> .(+>.$ (kill (scag bus.u.q.q.yar but.u.q.q.yar)))
2013-09-29 00:21:18 +04:00
%- edit
2013-12-24 00:49:15 +04:00
?> ?=(^ q.q.yar)
2013-09-29 00:21:18 +04:00
%= u.q.q.yar
bus 0
bul (sub bul.u.q.q.yar bus.u.q.q.yar)
but (slag bus.u.q.q.yar but.u.q.q.yar)
==
%r (edit u.q.q.yar(hyr [~ ~]))
2014-11-25 00:15:04 +03:00
%w ?: =(0 bus.u.q.q.yar)
beep
=+ bow=(wob u.q.q.yar)
=+ sow=(sub bus.u.q.q.yar bow)
=> .(+>.$ (kill (swag [bow sow] but.u.q.q.yar)))
%- edit
?> ?=(^ q.q.yar)
%= u.q.q.yar
bus bow
bul (sub bul.u.q.q.yar sow)
but %+ welp
(scag bow but.u.q.q.yar)
(slag bus.u.q.q.yar but.u.q.q.yar)
==
2014-10-22 06:59:05 +04:00
%x +>.$(mos :_(mos (poke %term-in -:!>(*term-in) / %cmd %x)))
2013-09-29 00:21:18 +04:00
%y ?: =(0 p.r.q.yar)
beep
2014-06-06 02:14:49 +04:00
$(kyz [%belt %txt (snag q.r.q.yar r.r.q.yar)])
2013-09-29 00:21:18 +04:00
==
::
%del :: delete
?: =(bul.u.q.q.yar bus.u.q.q.yar)
beep
%- edit
%= u.q.q.yar
bul (dec bul.u.q.q.yar)
but
%+ weld
2013-09-29 00:21:18 +04:00
(scag bus.u.q.q.yar but.u.q.q.yar)
(slag +(bus.u.q.q.yar) but.u.q.q.yar)
==
::
%met :: meta
2014-06-06 02:14:49 +04:00
?+ p.p.kyz
2013-09-29 00:21:18 +04:00
beep
2014-01-07 01:43:44 +04:00
%f
?: =(bul.u.q.q.yar bus.u.q.q.yar)
beep
(edit u.q.q.yar(bus (wod u.q.q.yar)))
::
%b
?: =(0 bus.u.q.q.yar)
beep
(edit u.q.q.yar(bus (wob u.q.q.yar)))
::
%y
2013-09-29 00:21:18 +04:00
?: =(0 p.r.q.yar)
beep
=+ dol=(snag q.r.q.yar r.r.q.yar)
=+ leo=(lent dol)
?. (gte bus.u.q.q.yar leo)
beep
=+ pey=(sub bus.u.q.q.yar leo)
?. =(dol (swag [pey leo] but.u.q.q.yar))
beep
=. q.r.q.yar ?:(=(p.r.q.yar +(q.r.q.yar)) 0 +(q.r.q.yar))
=+ ney=(snag q.r.q.yar r.r.q.yar)
=+ lye=(lent ney)
%- edit
%= u.q.q.yar
bus (sub (add bus.u.q.q.yar lye) leo)
bul (sub (add bul.u.q.q.yar lye) leo)
but %+ weld
(scag pey but.u.q.q.yar)
%+ weld
`(list ,@c)`ney :: XX weird fuse-loop
(slag bus.u.q.q.yar but.u.q.q.yar)
==
==
::
%ret :: return
2013-11-16 01:51:58 +04:00
?: =(%none buy.u.q.q.yar) beep
2013-09-29 00:21:18 +04:00
=+ jab=(rap 3 (tufa but.u.q.q.yar))
2014-06-06 02:14:49 +04:00
%= +>.$
2013-09-29 00:21:18 +04:00
q.q.yar ~
r.yar
?: |(=(%$ jab) =(%pass buy.u.q.q.yar))
r.yar
2013-09-29 00:21:18 +04:00
%+ ~(put by r.yar)
hux.u.q.q.yar
2013-11-14 02:38:04 +04:00
[p.hyt.u.q.q.yar [jab ?~(q.hyt.u.q.q.yar ~ +.q.hyt.u.q.q.yar)]]
2013-09-29 00:21:18 +04:00
::
mos
2014-11-19 04:17:11 +03:00
:* (poke %term-ctrl -:!>(%hail) %hail)
2014-05-24 00:46:43 +04:00
[hen %give [%bbye ~]]
2014-10-22 06:59:05 +04:00
(poke %term-in -:!>(*term-in) / %line jab)
2014-05-24 00:46:43 +04:00
[hen %give [%blit [[%mor ~] ~]]]
2013-09-29 00:21:18 +04:00
mos
==
==
::
%txt :: text keys
2013-11-16 01:51:58 +04:00
?: =(%none buy.u.q.q.yar) beep
2014-06-06 02:14:49 +04:00
=+ let=(lent p.p.kyz)
2013-09-29 00:21:18 +04:00
%- edit
%= u.q.q.yar
bus (add let bus.u.q.q.yar)
bul (add let bul.u.q.q.yar)
but
2013-09-29 00:21:18 +04:00
;: weld
(scag bus.u.q.q.yar but.u.q.q.yar)
2014-06-06 02:14:49 +04:00
p.p.kyz
2013-09-29 00:21:18 +04:00
(slag bus.u.q.q.yar but.u.q.q.yar)
==
==
==
::
2014-06-06 02:14:49 +04:00
%blew +>.$(p.q.yar p.p.kyz) :: window size
2013-09-29 00:21:18 +04:00
%boot
2014-10-22 06:59:05 +04:00
%= +>.$
mos
:_(mos [hen %pass ~ (note %a p.kyz)])
2013-09-29 00:21:18 +04:00
==
::
%crud :: error trace
2014-06-06 02:14:49 +04:00
=. q.kyz [[%leaf (trip p.kyz)] q.kyz]
|- ^+ +>.^$
?~ q.kyz +>.^$
(fume:$(q.kyz t.q.kyz) '!' `tank`i.q.kyz)
2013-09-29 00:21:18 +04:00
::
2014-06-06 02:14:49 +04:00
%hail :: refresh
2014-12-17 04:31:03 +03:00
+>.$
::+>.$(mos :_(mos (poke %term-ctrl -:!>(%hail) %hail)))
2014-06-02 21:51:39 +04:00
::
2014-06-05 00:24:26 +04:00
%harm :: all terms hung up
2014-06-02 21:51:39 +04:00
=+ nug=((map duct yard) [[hen (~(get by dug) hen)] ~ ~])
2014-06-06 20:54:27 +04:00
^+ +>.$
2014-06-02 21:51:39 +04:00
%= +>.$
dug nug
2014-10-22 06:59:05 +04:00
::S mos :_(mos [hen %pass ~ %b kyz])
2014-06-02 21:51:39 +04:00
==
::
%hook :: this term hung up
2014-10-22 06:59:05 +04:00
~& %dill-hook-not-implemented
+>.$
::S +>.$(dug (~(del by dug) hen), mos :_(mos [hen %pass ~ %b kyz]))
::
%init
2014-10-30 02:07:13 +03:00
=. def `(fall def +.hen)
2014-10-22 06:59:05 +04:00
%= +>.$
2014-10-28 04:50:07 +03:00
our p.kyz
2014-10-22 06:59:05 +04:00
mos
:_ mos
2014-10-30 02:07:13 +03:00
[(need def) %pass / %c %warp [p.kyz p.kyz] %main `[%& %y [%ud 1] /]]
2014-10-22 06:59:05 +04:00
==
2014-06-06 05:48:53 +04:00
::
%talk (furl (~(win re p.kyz) 0 p.q.yar)) :: program output
%text $(kyz [%talk %leaf p.kyz]) :: simple message
2013-09-29 00:21:18 +04:00
==
::
2014-10-22 06:59:05 +04:00
++ poke
|= msg=mess
^- move
2014-12-02 00:42:21 +03:00
:^ hen %pass /term-mess
2014-10-28 04:50:07 +03:00
:^ %g %mess [our /terminal]
:- our msg
2014-10-22 06:59:05 +04:00
::
2013-09-29 00:21:18 +04:00
++ yerk :: complete core
2014-10-30 02:07:13 +03:00
^- [p=(list move) q=ship r=(unit duct) s=(map duct yard)]
:^ (flop mos) our def
2014-06-06 20:54:27 +04:00
(~(put by dug) hen yar)
2013-09-29 00:21:18 +04:00
--
2014-06-06 02:14:49 +04:00
--
2014-12-17 02:29:07 +03:00
=| $: %1 ::
2014-10-28 04:50:07 +03:00
our=ship ::
2014-10-30 02:07:13 +03:00
def=(unit duct) ::
2014-06-06 02:14:49 +04:00
dug=(map duct yard) ::
== ::
|= [now=@da eny=@ ski=sled] :: current invocation
|% :: poke/peek pattern
++ call :: handle request
|= $: hen=duct
hic=(hypo (hobo kiss))
==
^- [p=(list move) q=_..^$]
=> %= . :: XX temporary
q.hic
^- kiss
?: ?=(%soft -.q.hic)
:: ~& [%dill-call-soft (,@tas `*`-.p.q.hic)]
((hard kiss) p.q.hic)
?: (~(nest ut -:!>(*kiss)) | p.hic) q.hic
~& [%dill-call-flub (,@tas `*`-.q.hic)]
((hard kiss) q.hic)
==
?: ?=(%flog -.q.hic)
:_ ..^$
%+ turn (~(tap by dug) *(list ,[p=duct q=yard]))
|=([a=duct b=yard] [a %slip %d p.q.hic])
2014-12-17 02:29:07 +03:00
=+ res=yerk:(lear:(dy hen our now def dug) q.hic)
2014-10-30 02:07:13 +03:00
[-.res ..^$(our +<.res, dug +>+.res, def +>-.res)]
2014-05-22 21:39:51 +04:00
::
2013-09-29 00:21:18 +04:00
++ doze
2013-12-15 09:42:27 +04:00
|= [now=@da hen=duct]
2013-09-29 00:21:18 +04:00
^- (unit ,@da)
~
::
2014-12-17 02:29:07 +03:00
++ load :: XX LEGACY 12-16-2014
|= $= old
$% [%0 our=ship def=(unit duct) dug=(map duct yord)]
[%1 our=ship def=(unit duct) dug=(map duct yard)]
==
2014-05-31 03:51:35 +04:00
^+ ..^$
2014-12-17 02:29:07 +03:00
?- -.old
%1 %_(..^$ our our.old, def def.old, dug dug.old)
%0 %= $
old
%= old
- %1
dug (~(run by dug.old) |=(yor=yord [p q r | *@da]:yor))
==
==
==
2013-09-29 00:21:18 +04:00
::
++ scry
2014-05-27 00:43:40 +04:00
|= [fur=(unit (set monk)) ren=@tas his=ship syd=desk lot=coin tyl=path]
^- (unit (unit (pair mark ,*)))
2014-06-02 21:51:39 +04:00
[~ ~ [%tank >dug<]]
2013-09-29 00:21:18 +04:00
::
2014-12-17 02:29:07 +03:00
++ stay [%1 our def dug]
2014-06-06 02:14:49 +04:00
++ take :: process move
2014-06-22 09:49:10 +04:00
|= [tea=wire hen=duct hin=(hypo sign)]
2014-06-06 02:14:49 +04:00
^- [p=(list move) q=_..^$]
2014-12-17 02:29:07 +03:00
=+ res=yerk:(leap:(dy hen our now def dug) tea q.hin)
2014-10-30 02:07:13 +03:00
[-.res ..^$(our +<.res, dug +>+.res, def +>-.res)]
2013-09-29 00:21:18 +04:00
--