2020-06-17 09:36:09 +03:00
|
|
|
/- *sole
|
|
|
|
/+ sole
|
|
|
|
|%
|
2020-06-18 06:31:37 +03:00
|
|
|
+$ any-state $%(state)
|
2020-06-17 09:36:09 +03:00
|
|
|
+$ state [%2 pith-2]
|
|
|
|
::
|
2017-11-30 00:29:35 +03:00
|
|
|
++ pith-2 ::
|
2020-11-25 23:22:55 +03:00
|
|
|
$: eel=(set gill:gall) :: connect to
|
|
|
|
ray=(set well:gall) ::
|
|
|
|
fur=(map dude:gall (unit server)) :: servers
|
|
|
|
bin=(map bone source) :: terminals
|
2015-05-17 04:05:56 +03:00
|
|
|
== ::
|
2020-06-17 09:36:09 +03:00
|
|
|
:: ::
|
2015-05-17 04:05:56 +03:00
|
|
|
++ server :: running server
|
2020-11-25 23:22:55 +03:00
|
|
|
$: syd=desk :: app identity
|
|
|
|
cas=case :: boot case
|
2015-05-17 04:05:56 +03:00
|
|
|
== ::
|
2016-07-06 06:44:25 +03:00
|
|
|
++ kill :: kill ring
|
2020-11-25 23:22:55 +03:00
|
|
|
$: pos=@ud :: ring position
|
|
|
|
num=@ud :: number of entries
|
|
|
|
max=_60 :: max entries
|
|
|
|
old=(list (list @c)) :: entries proper
|
2016-07-06 06:44:25 +03:00
|
|
|
== ::
|
2015-05-17 04:05:56 +03:00
|
|
|
++ source :: input device
|
2020-11-25 23:22:55 +03:00
|
|
|
$: edg=_80 :: terminal columns
|
|
|
|
off=@ud :: window offset
|
|
|
|
kil=kill :: kill buffer
|
|
|
|
inx=@ud :: ring index
|
|
|
|
fug=(map gill:gall (unit target)) :: connections
|
|
|
|
mir=(pair @ud stub) :: mirrored terminal
|
2015-05-17 04:05:56 +03:00
|
|
|
== ::
|
|
|
|
++ history :: past input
|
2020-11-25 23:22:55 +03:00
|
|
|
$: pos=@ud :: input position
|
|
|
|
num=@ud :: number of entries
|
|
|
|
lay=(map @ud (list @c)) :: editing overlay
|
|
|
|
old=(list (list @c)) :: entries proper
|
2015-05-17 04:05:56 +03:00
|
|
|
== ::
|
|
|
|
++ search :: reverse-i-search
|
2020-11-25 23:22:55 +03:00
|
|
|
$: pos=@ud :: search position
|
|
|
|
str=(list @c) :: search string
|
2015-05-17 04:05:56 +03:00
|
|
|
== ::
|
|
|
|
++ target :: application target
|
2016-11-08 04:40:00 +03:00
|
|
|
$: $= blt :: curr & prev belts
|
2017-11-08 00:05:52 +03:00
|
|
|
%+ pair
|
|
|
|
(unit dill-belt:dill)
|
2016-12-07 06:13:33 +03:00
|
|
|
(unit dill-belt:dill)
|
2020-11-25 23:22:55 +03:00
|
|
|
ris=(unit search) :: reverse-i-search
|
|
|
|
hit=history :: all past input
|
|
|
|
pom=sole-prompt :: static prompt
|
|
|
|
inp=sole-command :: input state
|
2015-05-17 04:05:56 +03:00
|
|
|
== ::
|
2015-09-02 01:20:17 +03:00
|
|
|
--
|
2015-05-17 04:31:34 +03:00
|
|
|
:: :: ::
|
2015-05-17 04:05:56 +03:00
|
|
|
:::: :: ::
|
|
|
|
:: :: ::
|
2015-09-02 01:20:17 +03:00
|
|
|
|%
|
2015-05-17 04:05:56 +03:00
|
|
|
++ deft-apes :: default servers
|
2020-06-17 10:54:27 +03:00
|
|
|
|= [our=ship lit=?]
|
2016-12-07 06:13:33 +03:00
|
|
|
%- ~(gas in *(set well:gall))
|
|
|
|
^- (list well:gall)
|
2019-10-09 00:18:36 +03:00
|
|
|
:: boot all default apps off the home desk
|
|
|
|
::
|
|
|
|
=- (turn - |=(a=term home+a))
|
|
|
|
^- (list term)
|
2019-11-20 09:45:44 +03:00
|
|
|
%+ welp
|
2019-10-09 00:18:36 +03:00
|
|
|
:~ %dojo
|
2019-11-15 00:31:44 +03:00
|
|
|
%spider
|
|
|
|
%eth-watcher
|
|
|
|
%azimuth-tracker
|
2019-11-20 00:03:07 +03:00
|
|
|
%ping
|
2019-12-14 03:32:13 +03:00
|
|
|
%goad
|
2020-11-05 12:02:36 +03:00
|
|
|
%lens
|
2019-08-25 12:04:05 +03:00
|
|
|
==
|
2019-11-20 09:36:36 +03:00
|
|
|
?: lit
|
|
|
|
~
|
2019-12-05 05:32:28 +03:00
|
|
|
:~ %acme
|
2019-11-27 10:08:42 +03:00
|
|
|
%clock
|
|
|
|
%dojo
|
|
|
|
%launch
|
|
|
|
%publish
|
|
|
|
%weather
|
|
|
|
%group-store
|
2020-06-08 10:53:16 +03:00
|
|
|
%group-pull-hook
|
|
|
|
%group-push-hook
|
2019-11-27 10:08:42 +03:00
|
|
|
%permission-store
|
|
|
|
%permission-hook
|
|
|
|
%permission-group-hook
|
|
|
|
%invite-store
|
|
|
|
%invite-hook
|
|
|
|
%chat-store
|
|
|
|
%chat-hook
|
|
|
|
%chat-view
|
|
|
|
%chat-cli
|
2020-11-10 22:54:06 +03:00
|
|
|
%herm
|
2019-11-19 01:41:08 +03:00
|
|
|
%contact-store
|
2019-12-14 02:22:36 +03:00
|
|
|
%contact-hook
|
2019-11-19 01:41:08 +03:00
|
|
|
%contact-view
|
2020-01-23 02:20:06 +03:00
|
|
|
%link-store
|
|
|
|
%link-proxy-hook
|
|
|
|
%link-listen-hook
|
2020-02-05 20:31:51 +03:00
|
|
|
%link-view
|
2020-02-13 03:45:01 +03:00
|
|
|
%metadata-store
|
2020-02-20 04:56:36 +03:00
|
|
|
%metadata-hook
|
2020-04-23 23:53:00 +03:00
|
|
|
%s3-store
|
2020-05-28 21:36:31 +03:00
|
|
|
%file-server
|
2020-07-18 02:58:28 +03:00
|
|
|
%glob
|
2020-06-12 21:55:30 +03:00
|
|
|
%graph-store
|
2020-08-19 22:31:47 +03:00
|
|
|
%graph-pull-hook
|
|
|
|
%graph-push-hook
|
2020-11-10 06:32:48 +03:00
|
|
|
%hark-store
|
|
|
|
%hark-graph-hook
|
|
|
|
%hark-group-hook
|
|
|
|
%hark-chat-hook
|
2020-11-06 23:55:32 +03:00
|
|
|
%observe-hook
|
2018-08-10 00:59:33 +03:00
|
|
|
==
|
2015-05-17 04:05:56 +03:00
|
|
|
::
|
|
|
|
++ deft-fish :: default connects
|
2020-06-17 09:36:09 +03:00
|
|
|
|= our=ship
|
2016-12-07 06:13:33 +03:00
|
|
|
%- ~(gas in *(set gill:gall))
|
|
|
|
^- (list gill:gall)
|
2019-11-27 12:19:10 +03:00
|
|
|
[[our %dojo] [our %chat-cli]~]
|
2015-05-17 04:05:56 +03:00
|
|
|
::
|
2017-11-30 00:29:35 +03:00
|
|
|
++ en-gill :: gill to wire
|
2020-06-17 09:36:09 +03:00
|
|
|
|= gyl=gill:gall
|
2016-11-12 04:26:19 +03:00
|
|
|
^- wire
|
2015-06-02 23:52:33 +03:00
|
|
|
[%drum %phat (scot %p p.gyl) q.gyl ~]
|
2015-05-17 04:05:56 +03:00
|
|
|
::
|
2017-11-30 00:29:35 +03:00
|
|
|
++ de-gill :: gill from wire
|
2020-06-17 09:36:09 +03:00
|
|
|
|= way=wire ^- gill:gall
|
|
|
|
?>(?=([@ @ ~] way) [(slav %p i.way) i.t.way])
|
2015-09-02 01:20:17 +03:00
|
|
|
--
|
2020-06-16 10:29:17 +03:00
|
|
|
:: TODO: remove .ost
|
2016-11-17 04:42:58 +03:00
|
|
|
::
|
2020-06-17 09:36:09 +03:00
|
|
|
|= [hid=bowl:gall state]
|
2020-06-17 10:54:27 +03:00
|
|
|
=* sat +<+
|
2019-11-14 21:39:50 +03:00
|
|
|
=/ ost 0
|
|
|
|
=+ (~(gut by bin) ost *source)
|
2015-10-23 01:45:48 +03:00
|
|
|
=* dev -
|
2020-06-17 10:54:27 +03:00
|
|
|
=| moz=(list card:agent:gall)
|
|
|
|
=| biz=(list dill-blit:dill)
|
|
|
|
|%
|
|
|
|
++ this .
|
|
|
|
+$ state ^state :: proxy
|
|
|
|
+$ any-state ^any-state :: proxy
|
|
|
|
++ on-init se-abet:this(eel (deft-fish our.hid))
|
2016-09-07 07:54:25 +03:00
|
|
|
++ diff-sole-effect-phat :: app event
|
2020-11-26 17:09:31 +03:00
|
|
|
|= [way=wire fec=sole-effect]
|
2015-09-02 01:20:17 +03:00
|
|
|
=< se-abet =< se-view
|
2017-11-30 00:29:35 +03:00
|
|
|
=+ gyl=(de-gill way)
|
2015-09-02 01:20:17 +03:00
|
|
|
?: (se-aint gyl) +>.$
|
|
|
|
(se-diff gyl fec)
|
|
|
|
::
|
|
|
|
++ peer ::
|
2020-11-25 23:22:55 +03:00
|
|
|
|= pax=path
|
2016-09-08 08:42:40 +03:00
|
|
|
~| [%drum-unauthorized our+our.hid src+src.hid] :: ourself
|
2016-12-01 04:22:43 +03:00
|
|
|
?> (team:title our.hid src.hid) :: or our own moon
|
2016-09-08 08:30:47 +03:00
|
|
|
=< se-abet =< se-view
|
2016-09-08 08:42:40 +03:00
|
|
|
(se-text "[{<src.hid>}, driving {<our.hid>}]")
|
2015-09-02 01:20:17 +03:00
|
|
|
::
|
2019-08-25 12:04:05 +03:00
|
|
|
++ poke-set-boot-apps ::
|
2020-06-17 10:54:27 +03:00
|
|
|
|= lit=?
|
|
|
|
^- (quip card:agent:gall ^state)
|
2019-08-25 12:04:05 +03:00
|
|
|
:: We do not run se-abet:se-view here because that starts the apps,
|
|
|
|
:: and some apps are not ready to start (eg Talk crashes because the
|
|
|
|
:: terminal has width 0). It appears the first message to drum must
|
|
|
|
:: be the peer.
|
|
|
|
::
|
2020-06-17 10:54:27 +03:00
|
|
|
=. ray (deft-apes our.hid lit)
|
|
|
|
[~ sat]
|
2019-08-25 12:04:05 +03:00
|
|
|
::
|
2016-09-07 07:54:25 +03:00
|
|
|
++ poke-dill-belt :: terminal event
|
2020-11-25 23:22:55 +03:00
|
|
|
|= bet=dill-belt:dill
|
2015-09-02 01:20:17 +03:00
|
|
|
=< se-abet =< se-view
|
|
|
|
(se-belt bet)
|
|
|
|
::
|
2018-10-11 23:19:30 +03:00
|
|
|
++ poke-dill-blit :: terminal output
|
2020-11-25 23:22:55 +03:00
|
|
|
|= bit=dill-blit:dill
|
2018-10-11 23:19:30 +03:00
|
|
|
se-abet:(se-blit-sys bit)
|
|
|
|
::
|
2016-09-07 07:54:25 +03:00
|
|
|
++ poke-start :: start app
|
2020-11-25 23:22:55 +03:00
|
|
|
|= wel=well:gall
|
2015-09-02 01:20:17 +03:00
|
|
|
=< se-abet =< se-view
|
2020-06-17 09:36:09 +03:00
|
|
|
(se-born & wel)
|
2015-09-02 01:20:17 +03:00
|
|
|
::
|
2016-09-07 07:54:25 +03:00
|
|
|
++ poke-link :: connect app
|
2020-11-25 23:22:55 +03:00
|
|
|
|= gyl=gill:gall
|
2015-09-02 01:20:17 +03:00
|
|
|
=< se-abet =< se-view
|
|
|
|
(se-link gyl)
|
|
|
|
::
|
2016-09-07 07:54:25 +03:00
|
|
|
++ poke-unlink :: disconnect app
|
2020-11-25 23:22:55 +03:00
|
|
|
|= gyl=gill:gall
|
2015-10-20 23:48:11 +03:00
|
|
|
=< se-abet =< se-view
|
2019-11-21 01:26:13 +03:00
|
|
|
(se-drop:(se-pull gyl) & gyl)
|
2015-10-20 23:48:11 +03:00
|
|
|
::
|
2016-09-07 07:54:25 +03:00
|
|
|
++ poke-exit :: shutdown
|
2018-03-19 07:18:20 +03:00
|
|
|
|= ~
|
2016-12-07 06:13:33 +03:00
|
|
|
se-abet:(se-blit-sys `dill-blit:dill`[%qit ~])
|
2016-04-30 00:41:55 +03:00
|
|
|
::
|
2016-09-07 07:54:25 +03:00
|
|
|
++ poke-put :: write file
|
2020-11-26 17:09:31 +03:00
|
|
|
|= [pax=path txt=@]
|
2016-05-02 21:56:00 +03:00
|
|
|
se-abet:(se-blit-sys [%sav pax txt]) ::
|
2016-04-30 02:18:59 +03:00
|
|
|
::
|
2019-11-14 21:39:50 +03:00
|
|
|
++ poke
|
|
|
|
|= [=mark =vase]
|
|
|
|
?+ mark ~|([%poke-drum-bad-mark mark] !!)
|
2020-06-16 10:29:17 +03:00
|
|
|
%drum-dill-belt =;(f (f !<(_+<.f vase)) poke-dill-belt)
|
|
|
|
%drum-dill-blit =;(f (f !<(_+<.f vase)) poke-dill-blit)
|
2019-11-14 21:39:50 +03:00
|
|
|
%drum-exit =;(f (f !<(_+<.f vase)) poke-exit)
|
2020-06-16 10:29:17 +03:00
|
|
|
%drum-link =;(f (f !<(_+<.f vase)) poke-link)
|
|
|
|
%drum-put =;(f (f !<(_+<.f vase)) poke-put)
|
2019-11-14 21:39:50 +03:00
|
|
|
%drum-set-boot-apps =;(f (f !<(_+<.f vase)) poke-set-boot-apps)
|
2020-06-16 10:29:17 +03:00
|
|
|
%drum-start =;(f (f !<(_+<.f vase)) poke-start)
|
|
|
|
%drum-unlink =;(f (f !<(_+<.f vase)) poke-unlink)
|
2019-11-14 21:39:50 +03:00
|
|
|
==
|
|
|
|
::
|
2019-12-14 03:32:13 +03:00
|
|
|
++ on-load
|
2020-11-10 06:32:48 +03:00
|
|
|
|= [hood-version=@ud old=any-state]
|
2020-05-22 10:03:43 +03:00
|
|
|
=< se-abet =< se-view
|
2020-06-18 06:31:37 +03:00
|
|
|
=. sat old
|
2020-06-18 07:58:47 +03:00
|
|
|
=. dev (~(gut by bin) ost *source)
|
2020-06-20 00:52:18 +03:00
|
|
|
=? ..on-load (lte hood-version %4)
|
|
|
|
~> %slog.0^leaf+"drum: starting os1 agents"
|
|
|
|
=> (se-born | %home %s3-store)
|
|
|
|
=> (se-born | %home %link-view)
|
|
|
|
=> (se-born | %home %link-listen-hook)
|
|
|
|
=> (se-born | %home %link-store)
|
|
|
|
=> (se-born | %home %link-proxy-hook)
|
|
|
|
=> (se-born | %home %contact-view)
|
|
|
|
=> (se-born | %home %contact-hook)
|
|
|
|
=> (se-born | %home %contact-store)
|
|
|
|
=> (se-born | %home %metadata-hook)
|
|
|
|
=> (se-born | %home %metadata-store)
|
|
|
|
=> (se-born | %home %goad)
|
|
|
|
~> %slog.0^leaf+"drum: resubscribing to %dojo and %chat-cli"
|
|
|
|
=> (se-drop:(se-pull our.hid %dojo) | our.hid %dojo)
|
|
|
|
(se-drop:(se-pull our.hid %chat-cli) | our.hid %chat-cli)
|
|
|
|
=? ..on-load (lte hood-version %5)
|
|
|
|
(se-born | %home %file-server)
|
2020-06-24 03:28:57 +03:00
|
|
|
=? ..on-load (lte hood-version %7)
|
2020-07-18 02:58:28 +03:00
|
|
|
(se-born | %home %glob)
|
2020-07-22 13:42:52 +03:00
|
|
|
=? ..on-load (lte hood-version %8)
|
2020-06-24 03:28:57 +03:00
|
|
|
=> (se-born | %home %group-push-hook)
|
|
|
|
(se-born | %home %group-pull-hook)
|
2020-07-28 22:24:55 +03:00
|
|
|
=? ..on-load (lte hood-version %9)
|
2020-11-10 22:54:06 +03:00
|
|
|
(se-born | %home %graph-store)
|
2020-08-19 22:31:47 +03:00
|
|
|
=? ..on-load (lte hood-version %10)
|
|
|
|
=> (se-born | %home %graph-push-hook)
|
|
|
|
(se-born | %home %graph-pull-hook)
|
2020-11-10 06:32:48 +03:00
|
|
|
=? ..on-load (lte hood-version %11)
|
|
|
|
=> (se-born | %home %hark-graph-hook)
|
|
|
|
=> (se-born | %home %hark-group-hook)
|
|
|
|
=> (se-born | %home %hark-chat-hook)
|
2020-11-10 23:12:52 +03:00
|
|
|
=> (se-born | %home %hark-store)
|
2020-11-18 08:54:50 +03:00
|
|
|
=> (se-born | %home %observe-hook)
|
2020-11-10 22:54:06 +03:00
|
|
|
(se-born | %home %herm)
|
2020-06-20 00:52:18 +03:00
|
|
|
..on-load
|
2019-12-14 03:32:13 +03:00
|
|
|
::
|
2016-09-07 07:54:25 +03:00
|
|
|
++ reap-phat :: ack connect
|
2020-11-26 17:09:31 +03:00
|
|
|
|= [way=wire saw=(unit tang)]
|
2015-09-02 01:20:17 +03:00
|
|
|
=< se-abet =< se-view
|
2017-11-30 00:29:35 +03:00
|
|
|
=+ gyl=(de-gill way)
|
2015-09-02 01:20:17 +03:00
|
|
|
?~ saw
|
|
|
|
(se-join gyl)
|
2019-11-14 21:39:50 +03:00
|
|
|
:: Don't print stack trace because we probably just crashed to
|
|
|
|
:: indicate we don't connect to the console.
|
|
|
|
::
|
|
|
|
(se-drop & gyl)
|
|
|
|
::
|
2020-06-17 10:54:27 +03:00
|
|
|
++ take-arvo
|
2019-11-14 21:39:50 +03:00
|
|
|
|= [=wire =sign-arvo]
|
|
|
|
%+ take-onto wire
|
|
|
|
?> ?=(%onto +<.sign-arvo)
|
|
|
|
+>.sign-arvo
|
2015-09-02 01:20:17 +03:00
|
|
|
::
|
2016-09-07 07:54:25 +03:00
|
|
|
++ take-coup-phat :: ack poke
|
2020-11-26 17:09:31 +03:00
|
|
|
|= [way=wire saw=(unit tang)]
|
2015-09-02 01:20:17 +03:00
|
|
|
=< se-abet =< se-view
|
|
|
|
?~ saw +>
|
2017-11-30 00:29:35 +03:00
|
|
|
=+ gyl=(de-gill way)
|
2015-09-02 01:20:17 +03:00
|
|
|
?: (se-aint gyl) +>.$
|
2019-11-20 22:58:30 +03:00
|
|
|
%- se-dump:(se-drop:(se-pull gyl) & gyl)
|
2016-09-08 08:30:47 +03:00
|
|
|
:_ u.saw
|
2019-11-14 21:39:50 +03:00
|
|
|
>[%drum-coup-fail src.hid gyl]<
|
2015-09-02 01:20:17 +03:00
|
|
|
::
|
2016-09-07 07:54:25 +03:00
|
|
|
++ take-onto :: ack start
|
2020-11-26 17:09:31 +03:00
|
|
|
|= [way=wire saw=(each suss:gall tang)]
|
2015-09-02 01:20:17 +03:00
|
|
|
=< se-abet =< se-view
|
2020-11-26 17:09:31 +03:00
|
|
|
?> ?=([@ @ ~] way)
|
2015-09-02 01:20:17 +03:00
|
|
|
?> (~(has by fur) i.t.way)
|
2020-11-25 23:22:55 +03:00
|
|
|
=/ wel=well:gall [i.way i.t.way]
|
2016-09-09 03:56:17 +03:00
|
|
|
?- saw
|
2020-11-26 17:09:31 +03:00
|
|
|
[%| *] (se-dump p.saw)
|
|
|
|
[%& *] ?> =(q.wel p.p.saw)
|
2016-09-09 03:56:17 +03:00
|
|
|
:: =. +>.$ (se-text "live {<p.saw>}")
|
|
|
|
+>.$(fur (~(put by fur) q.wel `[p.wel %da r.p.saw]))
|
2016-07-04 09:27:08 +03:00
|
|
|
==
|
2015-09-02 01:20:17 +03:00
|
|
|
::
|
2019-11-14 21:39:50 +03:00
|
|
|
++ take-agent
|
2019-11-19 07:36:21 +03:00
|
|
|
|= [=wire =sign:agent:gall]
|
2019-11-14 21:39:50 +03:00
|
|
|
?+ wire ~|([%drum-bad-take-agent wire -.sign] !!)
|
|
|
|
[%drum %phat *]
|
|
|
|
?- -.sign
|
2019-11-21 00:22:36 +03:00
|
|
|
%poke-ack (take-coup-phat t.t.wire p.sign)
|
|
|
|
%watch-ack (reap-phat t.t.wire p.sign)
|
|
|
|
%kick (quit-phat t.t.wire)
|
2019-11-14 21:39:50 +03:00
|
|
|
%fact
|
|
|
|
%+ diff-sole-effect-phat t.t.wire
|
|
|
|
?> ?=(%sole-effect p.cage.sign)
|
|
|
|
!<(sole-effect q.cage.sign)
|
|
|
|
==
|
|
|
|
==
|
|
|
|
::
|
2015-09-02 01:20:17 +03:00
|
|
|
++ quit-phat ::
|
2020-11-25 23:22:55 +03:00
|
|
|
|= way=wire
|
2015-09-02 01:20:17 +03:00
|
|
|
=< se-abet =< se-view
|
2017-11-30 00:29:35 +03:00
|
|
|
=+ gyl=(de-gill way)
|
2019-11-14 21:39:50 +03:00
|
|
|
~& [%drum-quit src.hid gyl]
|
2015-09-02 01:20:17 +03:00
|
|
|
(se-drop %| gyl)
|
|
|
|
:: :: ::
|
|
|
|
:::: :: ::
|
|
|
|
:: :: ::
|
|
|
|
++ se-abet :: resolve
|
2020-06-17 10:54:27 +03:00
|
|
|
^- (quip card:agent:gall state)
|
2015-10-23 01:45:48 +03:00
|
|
|
=. . se-subze:se-adze:se-adit
|
2020-06-17 10:54:27 +03:00
|
|
|
:_ sat(bin (~(put by bin) ost dev))
|
2019-11-19 07:36:21 +03:00
|
|
|
^- (list card:agent:gall)
|
2019-11-14 21:39:50 +03:00
|
|
|
?~ biz (flop moz)
|
|
|
|
:_ (flop moz)
|
|
|
|
=/ =dill-blit:dill ?~(t.biz i.biz [%mor (flop biz)])
|
2019-12-22 23:12:28 +03:00
|
|
|
[%give %fact ~[/drum] %dill-blit !>(dill-blit)]
|
2016-09-07 07:54:25 +03:00
|
|
|
::
|
2015-09-02 01:20:17 +03:00
|
|
|
++ se-adit :: update servers
|
2020-04-24 19:40:15 +03:00
|
|
|
^+ this
|
|
|
|
|^
|
2020-04-29 01:25:21 +03:00
|
|
|
=/ servers=(list well:gall)
|
2020-04-24 19:40:15 +03:00
|
|
|
(sort ~(tap in ray) sort-by-priorities)
|
2020-04-29 01:25:21 +03:00
|
|
|
|-
|
|
|
|
?~ servers
|
|
|
|
this
|
|
|
|
=/ wel=well:gall
|
|
|
|
i.servers
|
2019-11-14 21:39:50 +03:00
|
|
|
=/ =wire [%drum p.wel q.wel ~]
|
2020-04-24 19:40:15 +03:00
|
|
|
=/ hig=(unit (unit server))
|
2020-04-29 01:25:21 +03:00
|
|
|
(~(get by fur) q.wel)
|
|
|
|
?: &(?=(^ hig) |(?=(~ u.hig) =(p.wel syd.u.u.hig)))
|
2020-05-06 02:45:17 +03:00
|
|
|
$(servers t.servers)
|
2020-04-24 19:40:15 +03:00
|
|
|
=. fur
|
2020-04-29 01:25:21 +03:00
|
|
|
(~(put by fur) q.wel ~)
|
|
|
|
=. this
|
|
|
|
(se-text "activated app {(trip p.wel)}/{(trip q.wel)}")
|
|
|
|
=. this
|
|
|
|
%- se-emit
|
2020-06-03 07:50:20 +03:00
|
|
|
[%pass wire %arvo %g %conf q.wel]
|
2020-04-29 01:25:21 +03:00
|
|
|
$(servers t.servers)
|
2020-04-24 19:40:15 +03:00
|
|
|
::
|
|
|
|
++ priorities
|
|
|
|
^- (list (set @))
|
|
|
|
:~
|
2020-04-29 01:32:21 +03:00
|
|
|
:: set up stores with priority: depended on, but never depending
|
2020-04-24 19:40:15 +03:00
|
|
|
%- sy
|
|
|
|
:~ %permission-store
|
|
|
|
%chat-store
|
|
|
|
%contact-store
|
|
|
|
%group-store
|
|
|
|
%link-store
|
|
|
|
%invite-store
|
|
|
|
%metadata-store
|
|
|
|
==
|
2020-04-29 01:32:21 +03:00
|
|
|
:: ensure chat-cli can sub to invites
|
2020-06-09 06:02:24 +03:00
|
|
|
:: and file server can receive pokes
|
|
|
|
(sy ~[%chat-hook %file-server])
|
2020-04-24 19:40:15 +03:00
|
|
|
==
|
|
|
|
++ sort-by-priorities
|
|
|
|
=/ priorities priorities
|
|
|
|
|= [[desk a=term] [desk b=term]]
|
|
|
|
^- ?
|
|
|
|
?~ priorities
|
|
|
|
(aor a b)
|
|
|
|
=* priority i.priorities
|
|
|
|
?: &((~(has in priority) a) (~(has in priority) b))
|
|
|
|
(aor a b)
|
|
|
|
?: (~(has in priority) a)
|
|
|
|
%.y
|
|
|
|
?: (~(has in priority) b)
|
|
|
|
%.n
|
|
|
|
$(priorities t.priorities)
|
|
|
|
--
|
2015-09-02 01:20:17 +03:00
|
|
|
::
|
|
|
|
++ se-adze :: update connections
|
2015-10-23 01:45:48 +03:00
|
|
|
^+ .
|
2020-04-25 00:21:41 +03:00
|
|
|
%+ roll
|
|
|
|
%+ sort
|
|
|
|
~(tap in eel)
|
2020-04-29 01:32:21 +03:00
|
|
|
|= [[@ a=term] [@ b=term]]
|
|
|
|
?: =(a %dojo) %.n
|
|
|
|
?: =(b %dojo) %.y
|
|
|
|
(aor a b)
|
2015-10-23 01:45:48 +03:00
|
|
|
=< .(con +>)
|
2020-11-26 17:09:31 +03:00
|
|
|
|: $:,[gil=gill:gall con=_.] ^+ con
|
2015-10-23 01:45:48 +03:00
|
|
|
=. +>.$ con
|
|
|
|
?: (~(has by fug) gil)
|
|
|
|
+>.$
|
|
|
|
(se-peer gil)
|
|
|
|
::
|
|
|
|
++ se-subze :: downdate connections
|
2019-11-14 21:39:50 +03:00
|
|
|
=< .(dev (~(got by bin) ost))
|
|
|
|
=. bin (~(put by bin) ost dev)
|
2015-10-23 01:45:48 +03:00
|
|
|
^+ .
|
|
|
|
%- ~(rep by bin)
|
|
|
|
=< .(con +>)
|
2020-11-26 17:09:31 +03:00
|
|
|
|: $:,[[ost=bone dev=source] con=_.] ^+ con
|
2019-11-14 21:39:50 +03:00
|
|
|
=+ xeno=se-subze-local:%_(con ost ost, dev dev)
|
|
|
|
xeno(ost ost.con, dev dev.con, bin (~(put by bin) ost dev.xeno))
|
2015-10-23 01:45:48 +03:00
|
|
|
::
|
|
|
|
++ se-subze-local
|
|
|
|
^+ .
|
|
|
|
%- ~(rep by fug)
|
|
|
|
=< .(con +>)
|
2020-11-26 17:09:31 +03:00
|
|
|
|: $:,[[gil=gill:gall *] con=_.] ^+ con
|
2015-10-23 01:45:48 +03:00
|
|
|
=. +>.$ con
|
|
|
|
?: (~(has in eel) gil)
|
|
|
|
+>.$
|
|
|
|
(se-nuke gil)
|
2015-09-02 01:20:17 +03:00
|
|
|
::
|
|
|
|
++ se-aint :: ignore result
|
2020-11-25 23:22:55 +03:00
|
|
|
|= gyl=gill:gall
|
2015-09-02 01:20:17 +03:00
|
|
|
^- ?
|
2019-11-14 21:39:50 +03:00
|
|
|
?. (~(has by bin) ost) &
|
2015-09-02 01:20:17 +03:00
|
|
|
=+ gyr=(~(get by fug) gyl)
|
2018-03-19 07:18:20 +03:00
|
|
|
|(?=(~ gyr) ?=(~ u.gyr))
|
2015-09-02 01:20:17 +03:00
|
|
|
::
|
|
|
|
++ se-alas :: recalculate index
|
2020-11-25 23:22:55 +03:00
|
|
|
|= gyl=gill:gall
|
2015-09-02 01:20:17 +03:00
|
|
|
=+ [xin=0 wag=se-amor]
|
|
|
|
|- ^+ +>.^$
|
|
|
|
?~ wag +>.^$(inx 0)
|
|
|
|
?: =(i.wag gyl) +>.^$(inx xin)
|
|
|
|
$(wag t.wag, xin +(xin))
|
|
|
|
::
|
|
|
|
++ se-amor :: live targets
|
2016-12-07 06:13:33 +03:00
|
|
|
^- (list gill:gall)
|
2017-02-13 22:58:49 +03:00
|
|
|
%+ skim ~(tap in eel)
|
2020-11-26 17:09:31 +03:00
|
|
|
|=(a=gill:gall ?=([~ ~ *] (~(get by fug) a)))
|
2015-09-02 01:20:17 +03:00
|
|
|
::
|
|
|
|
++ se-anon :: rotate index
|
|
|
|
=+ wag=se-amor
|
|
|
|
?~ wag +
|
2015-12-21 00:16:39 +03:00
|
|
|
:: ~& [%se-anon inx+inx wag+wag nex+(mod +(inx) (lent se-amor))]
|
2017-03-02 00:03:41 +03:00
|
|
|
+(off 0, inx (mod +(inx) (lent wag)))
|
2015-09-02 01:20:17 +03:00
|
|
|
::
|
|
|
|
++ se-agon :: current gill
|
2016-12-07 06:13:33 +03:00
|
|
|
^- (unit gill:gall)
|
2015-09-02 01:20:17 +03:00
|
|
|
=+ wag=se-amor
|
|
|
|
?~ wag ~
|
2019-11-21 01:26:13 +03:00
|
|
|
~| [inx=inx wag=wag fug=fug eel=eel]
|
2016-12-07 06:13:33 +03:00
|
|
|
`(snag inx `(list gill:gall)`wag)
|
2015-09-02 01:20:17 +03:00
|
|
|
::
|
|
|
|
++ se-belt :: handle input
|
2020-11-25 23:22:55 +03:00
|
|
|
|= bet=dill-belt:dill
|
2015-09-02 01:20:17 +03:00
|
|
|
^+ +>
|
2020-11-26 17:09:31 +03:00
|
|
|
?: ?=([?(%cru %hey %rez %yow) *] bet) :: target-agnostic
|
2016-09-09 03:57:05 +03:00
|
|
|
?- bet
|
2020-11-26 17:09:31 +03:00
|
|
|
[%cru *] (se-dump:(se-text (trip p.bet)) q.bet)
|
|
|
|
[%hey *] +>(mir [0 ~]) :: refresh
|
|
|
|
[%rez *] +>(edg (dec p.bet)) :: resize window
|
|
|
|
[%yow *] ~&([%no-yow -.bet] +>)
|
2016-09-09 03:57:05 +03:00
|
|
|
==
|
2015-09-02 01:20:17 +03:00
|
|
|
=+ gul=se-agon
|
2018-03-19 07:18:20 +03:00
|
|
|
?: |(?=(~ gul) (se-aint u.gul))
|
2016-09-02 05:37:58 +03:00
|
|
|
(se-blit %bel ~)
|
2016-09-08 08:21:09 +03:00
|
|
|
ta-abet:(ta-belt:(se-tame u.gul) bet)
|
2015-09-02 01:20:17 +03:00
|
|
|
::
|
|
|
|
++ se-born :: new server
|
2020-06-17 09:36:09 +03:00
|
|
|
|= [print-on-repeat=? wel=well:gall]
|
2015-09-02 01:20:17 +03:00
|
|
|
^+ +>
|
|
|
|
?: (~(has in ray) wel)
|
2020-06-17 09:36:09 +03:00
|
|
|
?. print-on-repeat +>
|
2015-09-02 01:20:17 +03:00
|
|
|
(se-text "[already running {<p.wel>}/{<q.wel>}]")
|
2016-09-08 08:31:42 +03:00
|
|
|
%= +>
|
|
|
|
ray (~(put in ray) wel)
|
2016-09-08 08:42:40 +03:00
|
|
|
eel (~(put in eel) [our.hid q.wel])
|
2016-09-08 08:31:42 +03:00
|
|
|
==
|
2015-09-02 01:20:17 +03:00
|
|
|
::
|
|
|
|
++ se-drop :: disconnect
|
2020-11-26 17:09:31 +03:00
|
|
|
|= [pej=? gyl=gill:gall]
|
2015-09-02 01:20:17 +03:00
|
|
|
^+ +>
|
|
|
|
=+ lag=se-agon
|
|
|
|
?. (~(has by fug) gyl) +>.$
|
|
|
|
=. fug (~(del by fug) gyl)
|
|
|
|
=. eel ?.(pej eel (~(del in eel) gyl))
|
2016-07-04 09:27:08 +03:00
|
|
|
=. +>.$ ?. &(?=(^ lag) !=(gyl u.lag))
|
2015-09-02 01:20:17 +03:00
|
|
|
+>.$(inx 0)
|
|
|
|
(se-alas u.lag)
|
|
|
|
=. +>.$ (se-text "[unlinked from {<gyl>}]")
|
2016-09-08 08:42:40 +03:00
|
|
|
?: =(gyl [our.hid %dojo]) :: undead dojo
|
2015-06-02 21:36:56 +03:00
|
|
|
(se-link gyl)
|
2015-10-08 01:42:19 +03:00
|
|
|
+>.$
|
2015-09-02 01:20:17 +03:00
|
|
|
::
|
2019-11-01 00:24:37 +03:00
|
|
|
++ se-tab :: print tab completions
|
2020-11-26 17:09:31 +03:00
|
|
|
|= tl=(list [=cord =tank])
|
2019-11-01 00:24:37 +03:00
|
|
|
^+ +>
|
|
|
|
=/ lots (gth (lent tl) 10)
|
|
|
|
=/ long
|
|
|
|
?: lots
|
|
|
|
0
|
|
|
|
(roll (turn tl |=([=term *] (met 3 term))) max)
|
|
|
|
%- se-dump
|
|
|
|
%- flop
|
|
|
|
^- (list tank)
|
|
|
|
:- leaf+"-----"
|
|
|
|
%+ turn tl
|
2019-11-01 01:14:41 +03:00
|
|
|
|= [=term =type=tank]
|
2019-11-01 00:24:37 +03:00
|
|
|
?: lots
|
|
|
|
leaf+(trip term)
|
|
|
|
=/ type-text ~(ram re type-tank)
|
|
|
|
=/ spaces (trip (fil 3 (sub long (met 3 term)) ' '))
|
|
|
|
=/ =tape "{(trip term)} {spaces} {type-text}"
|
|
|
|
:: If type is too long and not the only result, abbreviate
|
|
|
|
::
|
|
|
|
?: (gth (lent type-text) edg)
|
|
|
|
?: ?=([* ~] tl)
|
|
|
|
:+ %rose
|
|
|
|
["" "" ""]
|
|
|
|
~[leaf+(trip term) type-tank]
|
|
|
|
leaf+(weld (scag (sub edg 3) tape) "...")
|
|
|
|
leaf+tape
|
|
|
|
::
|
2015-09-02 01:20:17 +03:00
|
|
|
++ se-dump :: print tanks
|
2020-11-25 23:22:55 +03:00
|
|
|
|= tac=(list tank)
|
2015-09-02 01:20:17 +03:00
|
|
|
^+ +>
|
2020-11-25 23:22:55 +03:00
|
|
|
=/ wol=wall
|
|
|
|
(zing (turn (flop tac) |=(a=tank (~(win re a) [0 edg]))))
|
2015-09-02 01:20:17 +03:00
|
|
|
|- ^+ +>.^$
|
|
|
|
?~ wol +>.^$
|
2016-10-14 03:54:54 +03:00
|
|
|
?. ((sane %t) (crip i.wol)) :: XX upstream validation
|
2016-10-14 04:18:55 +03:00
|
|
|
~& bad-text+<`*`i.wol>
|
2016-10-14 03:54:54 +03:00
|
|
|
$(wol t.wol)
|
2015-09-02 01:20:17 +03:00
|
|
|
$(wol t.wol, +>.^$ (se-blit %out (tuba i.wol)))
|
|
|
|
::
|
|
|
|
++ se-join :: confirm connection
|
2020-11-25 23:22:55 +03:00
|
|
|
|= gyl=gill:gall
|
2015-09-02 01:20:17 +03:00
|
|
|
^+ +>
|
|
|
|
=. +> (se-text "[linked to {<gyl>}]")
|
2018-03-19 07:18:20 +03:00
|
|
|
?> ?=(~ (~(got by fug) gyl))
|
2015-10-08 01:42:19 +03:00
|
|
|
(se-alas(fug (~(put by fug) gyl `*target)) gyl)
|
2015-09-02 01:20:17 +03:00
|
|
|
::
|
2016-09-07 07:54:25 +03:00
|
|
|
++ se-nuke :: teardown connection
|
2020-11-25 23:22:55 +03:00
|
|
|
|= gyl=gill:gall
|
2015-09-02 01:20:17 +03:00
|
|
|
^+ +>
|
2015-10-08 01:42:19 +03:00
|
|
|
(se-drop:(se-pull gyl) & gyl)
|
2015-09-02 01:20:17 +03:00
|
|
|
::
|
2015-10-20 23:48:11 +03:00
|
|
|
++ se-klin :: disconnect app
|
2020-11-25 23:22:55 +03:00
|
|
|
|= gyl=gill:gall
|
2015-10-20 23:48:11 +03:00
|
|
|
+>(eel (~(del in eel) gyl))
|
|
|
|
::
|
2015-09-02 01:20:17 +03:00
|
|
|
++ se-link :: connect to app
|
2020-11-25 23:22:55 +03:00
|
|
|
|= gyl=gill:gall
|
2015-09-02 01:20:17 +03:00
|
|
|
+>(eel (~(put in eel) gyl))
|
|
|
|
::
|
|
|
|
++ se-blit :: give output
|
2020-11-25 23:22:55 +03:00
|
|
|
|= bil=dill-blit:dill
|
2015-09-02 01:20:17 +03:00
|
|
|
+>(biz [bil biz])
|
|
|
|
::
|
2017-11-08 00:05:52 +03:00
|
|
|
++ se-blit-sys :: output to system
|
2020-11-25 23:22:55 +03:00
|
|
|
|= bil=dill-blit:dill ^+ +>
|
2019-12-22 23:12:28 +03:00
|
|
|
(se-emit %give %fact ~[/drum] %dill-blit !>(bil))
|
2016-04-30 00:41:55 +03:00
|
|
|
::
|
2015-09-02 01:20:17 +03:00
|
|
|
++ se-show :: show buffer, raw
|
2020-11-25 23:22:55 +03:00
|
|
|
|= lin=(pair @ud stub)
|
2015-09-02 01:20:17 +03:00
|
|
|
^+ +>
|
|
|
|
?: =(mir lin) +>
|
2018-02-22 02:45:03 +03:00
|
|
|
=. +> ?:(=(p.mir p.lin) +> (se-blit %hop p.lin))
|
2016-10-19 19:28:11 +03:00
|
|
|
=. +> ?:(=(q.mir q.lin) +> (se-blit %pom q.lin))
|
2015-09-02 01:20:17 +03:00
|
|
|
+>(mir lin)
|
|
|
|
::
|
2016-07-04 09:27:08 +03:00
|
|
|
++ se-just :: adjusted buffer
|
2020-11-26 17:09:31 +03:00
|
|
|
|= [pom=stub lin=(pair @ud (list @c))]
|
2015-09-02 01:20:17 +03:00
|
|
|
^+ +>
|
2017-02-27 07:39:21 +03:00
|
|
|
=/ pol (lent-char:klr pom)
|
2017-02-27 07:44:33 +03:00
|
|
|
=/ pos (add pol p.lin)
|
|
|
|
?: (gte (div (mul pol 100) edg) 35) :: old style (long prompt)
|
2018-02-22 02:45:03 +03:00
|
|
|
=/ off ?:((lte pos edg) 0 (sub pos edg))
|
2017-02-27 07:44:33 +03:00
|
|
|
%+ se-show
|
|
|
|
(sub pos off)
|
2018-04-23 05:41:24 +03:00
|
|
|
(swag:klr [off edg] (welp pom [*stye q.lin]~))
|
2018-02-22 02:45:03 +03:00
|
|
|
=/ end (sub edg pol)
|
2017-02-28 07:59:13 +03:00
|
|
|
=. off ?: (gth p.lin (add end off))
|
|
|
|
(sub p.lin end)
|
|
|
|
?: (lth p.lin off)
|
|
|
|
(min p.lin (dec off))
|
|
|
|
off
|
2017-02-27 07:39:21 +03:00
|
|
|
%+ se-show
|
2017-02-27 07:44:33 +03:00
|
|
|
(sub pos off)
|
2018-04-23 05:41:24 +03:00
|
|
|
(welp pom [*stye (swag [off end] q.lin)]~)
|
2015-09-02 01:20:17 +03:00
|
|
|
::
|
|
|
|
++ se-view :: flush buffer
|
2016-09-07 17:21:41 +03:00
|
|
|
^+ .
|
2015-09-02 01:20:17 +03:00
|
|
|
=+ gul=se-agon
|
2018-03-19 07:18:20 +03:00
|
|
|
?: |(?=(~ gul) (se-aint u.gul)) +
|
2016-09-07 17:21:41 +03:00
|
|
|
(se-just ta-vew:(se-tame u.gul))
|
2015-09-02 01:20:17 +03:00
|
|
|
::
|
2019-11-14 21:39:50 +03:00
|
|
|
++ se-emit
|
2019-11-19 07:36:21 +03:00
|
|
|
|= card:agent:gall
|
2019-11-14 21:39:50 +03:00
|
|
|
%_(+> moz [+< moz])
|
2015-09-02 01:20:17 +03:00
|
|
|
::
|
|
|
|
++ se-text :: return text
|
2020-11-25 23:22:55 +03:00
|
|
|
|= txt=tape
|
2015-09-02 01:20:17 +03:00
|
|
|
^+ +>
|
2016-10-14 03:54:54 +03:00
|
|
|
?. ((sane %t) (crip txt)) :: XX upstream validation
|
2016-10-14 04:18:55 +03:00
|
|
|
~& bad-text+<`*`txt>
|
2016-10-14 03:54:54 +03:00
|
|
|
+>
|
2015-09-02 01:20:17 +03:00
|
|
|
(se-blit %out (tuba txt))
|
|
|
|
::
|
|
|
|
++ se-poke :: send a poke
|
2020-11-26 17:09:31 +03:00
|
|
|
|= [gyl=gill:gall par=cage]
|
2019-11-14 21:39:50 +03:00
|
|
|
(se-emit %pass (en-gill gyl) %agent gyl %poke par)
|
2015-09-02 01:20:17 +03:00
|
|
|
::
|
|
|
|
++ se-peer :: send a peer
|
2020-11-25 23:22:55 +03:00
|
|
|
|= gyl=gill:gall
|
2020-05-05 17:47:37 +03:00
|
|
|
=/ =path /sole/(cat 3 'drum_' (scot %p our.hid))
|
2016-09-07 07:32:40 +03:00
|
|
|
%- se-emit(fug (~(put by fug) gyl ~))
|
2020-05-05 17:47:37 +03:00
|
|
|
[%pass (en-gill gyl) %agent gyl %watch path]
|
2015-09-02 01:20:17 +03:00
|
|
|
::
|
|
|
|
++ se-pull :: cancel subscription
|
2020-11-25 23:22:55 +03:00
|
|
|
|= gyl=gill:gall
|
2019-11-14 21:39:50 +03:00
|
|
|
(se-emit %pass (en-gill gyl) %agent gyl %leave ~)
|
2015-09-02 01:20:17 +03:00
|
|
|
::
|
|
|
|
++ se-tame :: switch connection
|
2020-11-25 23:22:55 +03:00
|
|
|
|= gyl=gill:gall
|
2015-09-02 01:20:17 +03:00
|
|
|
^+ ta
|
2016-09-08 09:33:14 +03:00
|
|
|
~(. ta gyl (need (~(got by fug) gyl)))
|
2015-09-02 01:20:17 +03:00
|
|
|
::
|
|
|
|
++ se-diff :: receive results
|
2020-11-26 17:09:31 +03:00
|
|
|
|= [gyl=gill:gall fec=sole-effect]
|
2015-09-02 01:20:17 +03:00
|
|
|
^+ +>
|
|
|
|
ta-abet:(ta-fec:(se-tame gyl) fec)
|
|
|
|
::
|
|
|
|
++ ta :: per target
|
2020-11-26 17:09:31 +03:00
|
|
|
|_ [gyl=gill:gall target] :: app and state
|
2017-11-08 00:05:52 +03:00
|
|
|
++ ta-abet :: resolve
|
2015-09-02 01:20:17 +03:00
|
|
|
^+ ..ta
|
|
|
|
..ta(fug (~(put by fug) gyl ``target`+<+))
|
|
|
|
::
|
2020-11-25 23:22:55 +03:00
|
|
|
++ ta-poke |=(a=cage +>(..ta (se-poke gyl a))) :: poke gyl
|
2015-05-17 04:05:56 +03:00
|
|
|
::
|
2015-09-02 01:20:17 +03:00
|
|
|
++ ta-act :: send action
|
2020-11-25 23:22:55 +03:00
|
|
|
|= act=sole-action
|
2015-05-17 22:39:03 +03:00
|
|
|
^+ +>
|
2019-11-22 03:51:52 +03:00
|
|
|
(ta-poke %sole-action !>(act))
|
2015-06-02 23:52:33 +03:00
|
|
|
::
|
2020-05-05 17:47:37 +03:00
|
|
|
++ ta-id (cat 3 'drum_' (scot %p our.hid)) :: per-ship duct id
|
|
|
|
::
|
2015-09-02 01:20:17 +03:00
|
|
|
++ ta-aro :: hear arrow
|
2020-11-25 23:22:55 +03:00
|
|
|
|= key=?(%d %l %r %u)
|
2015-05-17 07:50:05 +03:00
|
|
|
^+ +>
|
2016-09-08 06:47:33 +03:00
|
|
|
=. ris ~
|
2015-09-02 01:20:17 +03:00
|
|
|
?- key
|
2020-11-25 22:39:13 +03:00
|
|
|
%d ?. =(num.hit pos.hit)
|
2015-09-02 01:20:17 +03:00
|
|
|
(ta-mov +(pos.hit))
|
|
|
|
?: =(0 (lent buf.say.inp))
|
|
|
|
ta-bel
|
|
|
|
(ta-hom:ta-nex %set ~)
|
2020-11-25 22:39:13 +03:00
|
|
|
%l ?: =(0 pos.inp) ta-bel
|
2016-09-08 06:47:33 +03:00
|
|
|
+>(pos.inp (dec pos.inp))
|
2020-11-25 22:39:13 +03:00
|
|
|
%r ?: =((lent buf.say.inp) pos.inp)
|
2015-09-02 01:20:17 +03:00
|
|
|
ta-bel
|
2016-09-08 06:47:33 +03:00
|
|
|
+>(pos.inp +(pos.inp))
|
2020-11-25 22:39:13 +03:00
|
|
|
%u ?:(=(0 pos.hit) ta-bel (ta-mov (dec pos.hit)))
|
2015-09-02 01:20:17 +03:00
|
|
|
==
|
2015-05-17 07:50:05 +03:00
|
|
|
::
|
2016-07-06 06:44:25 +03:00
|
|
|
++ ta-bel :: beep
|
2016-09-07 20:58:48 +03:00
|
|
|
.(..ta (se-blit %bel ~), q.blt ~) :: forget belt
|
2016-09-09 03:57:05 +03:00
|
|
|
::
|
|
|
|
++ ta-belt :: handle input
|
2020-11-25 23:22:55 +03:00
|
|
|
|= bet=dill-belt:dill
|
2016-09-09 03:57:05 +03:00
|
|
|
^+ +>
|
2020-11-26 17:09:31 +03:00
|
|
|
?< ?=([?(%cru %hey %rez %yow) *] bet) :: target-specific
|
2016-09-09 03:57:05 +03:00
|
|
|
=. blt [q.blt `bet] :: remember belt
|
|
|
|
?- bet
|
2020-11-26 17:09:31 +03:00
|
|
|
[%aro *] (ta-aro p.bet)
|
|
|
|
[%bac *] ta-bac
|
|
|
|
[%ctl *] (ta-ctl p.bet)
|
|
|
|
[%del *] ta-del
|
|
|
|
[%met *] (ta-met p.bet)
|
|
|
|
[%ret *] ta-ret
|
|
|
|
[%txt *] (ta-txt p.bet)
|
2016-09-09 03:57:05 +03:00
|
|
|
==
|
|
|
|
::
|
2015-09-02 01:20:17 +03:00
|
|
|
++ ta-det :: send edit
|
2020-11-25 23:22:55 +03:00
|
|
|
|= ted=sole-edit
|
2015-05-17 04:05:56 +03:00
|
|
|
^+ +>
|
2019-11-22 03:51:52 +03:00
|
|
|
%^ ta-act
|
2020-05-05 17:47:37 +03:00
|
|
|
ta-id
|
2019-11-22 03:51:52 +03:00
|
|
|
%det
|
|
|
|
[[his.ven.say.inp own.ven.say.inp] (sham buf.say.inp) ted]
|
2015-05-17 04:05:56 +03:00
|
|
|
::
|
2015-09-02 01:20:17 +03:00
|
|
|
++ ta-bac :: hear backspace
|
|
|
|
^+ .
|
|
|
|
?^ ris
|
|
|
|
?: =(~ str.u.ris)
|
|
|
|
ta-bel
|
|
|
|
.(str.u.ris (scag (dec (lent str.u.ris)) str.u.ris))
|
|
|
|
?: =(0 pos.inp)
|
2016-09-04 03:35:17 +03:00
|
|
|
?~ buf.say.inp
|
2020-05-05 17:47:37 +03:00
|
|
|
(ta-act ta-id %clr ~)
|
2016-09-04 03:35:17 +03:00
|
|
|
ta-bel
|
|
|
|
(ta-hom %del (dec pos.inp))
|
2015-09-02 01:20:17 +03:00
|
|
|
::
|
|
|
|
++ ta-ctl :: hear control
|
2020-11-25 23:22:55 +03:00
|
|
|
|= key=@ud
|
2015-05-17 04:05:56 +03:00
|
|
|
^+ +>
|
2020-11-25 22:39:13 +03:00
|
|
|
=. ris ?.(?=(?(%g %r) key) ~ ris)
|
2016-09-08 06:47:33 +03:00
|
|
|
?+ key ta-bel
|
2020-11-25 22:39:13 +03:00
|
|
|
%a +>(pos.inp 0)
|
|
|
|
%b (ta-aro %l)
|
|
|
|
%c ta-bel
|
|
|
|
%d ?^ buf.say.inp
|
2016-09-08 09:33:14 +03:00
|
|
|
ta-del
|
|
|
|
?: (~(has in (deft-fish our.hid)) gyl)
|
|
|
|
+>(..ta (se-blit qit+~)) :: quit pier
|
|
|
|
+>(..ta (se-klin gyl)) :: unlink app
|
2020-11-25 22:39:13 +03:00
|
|
|
%e +>(pos.inp (lent buf.say.inp))
|
|
|
|
%f (ta-aro %r)
|
|
|
|
%g ?~ ris ta-bel
|
2015-11-16 03:52:59 +03:00
|
|
|
(ta-hom(pos.hit num.hit, ris ~) [%set ~])
|
2020-11-25 22:39:13 +03:00
|
|
|
%i ta-tab
|
|
|
|
%k =+ len=(lent buf.say.inp)
|
2015-09-02 01:20:17 +03:00
|
|
|
?: =(pos.inp len)
|
2016-07-04 09:27:08 +03:00
|
|
|
ta-bel
|
2016-09-03 08:09:53 +03:00
|
|
|
(ta-kil %r [pos.inp (sub len pos.inp)])
|
2020-11-25 22:39:13 +03:00
|
|
|
%l +>(..ta (se-blit %clr ~))
|
|
|
|
%n (ta-aro %d)
|
|
|
|
%p (ta-aro %u)
|
|
|
|
%r ?~ ris
|
2016-07-04 09:27:08 +03:00
|
|
|
+>(ris `[pos.hit ~])
|
2015-09-02 01:20:17 +03:00
|
|
|
?: =(0 pos.u.ris)
|
|
|
|
ta-bel
|
|
|
|
(ta-ser ~)
|
2020-11-25 22:39:13 +03:00
|
|
|
%t =+ len=(lent buf.say.inp)
|
2015-09-02 01:20:17 +03:00
|
|
|
?: |(=(0 pos.inp) (lth len 2))
|
|
|
|
ta-bel
|
2016-08-28 07:44:28 +03:00
|
|
|
=+ sop=(sub pos.inp ?:(=(len pos.inp) 2 1))
|
2016-09-08 06:47:33 +03:00
|
|
|
(ta-hom (rep:edit [sop 2] (flop (swag [sop 2] buf.say.inp))))
|
2020-11-25 22:39:13 +03:00
|
|
|
%u ?: =(0 pos.inp)
|
2015-09-02 01:20:17 +03:00
|
|
|
ta-bel
|
2016-09-03 08:09:53 +03:00
|
|
|
(ta-kil %l [0 pos.inp])
|
2020-11-25 22:39:13 +03:00
|
|
|
%v ta-bel
|
|
|
|
%w ?: =(0 pos.inp)
|
2016-07-05 09:50:32 +03:00
|
|
|
ta-bel
|
2017-02-28 23:51:39 +03:00
|
|
|
=+ sop=(ta-pos %l %ace pos.inp)
|
2016-09-03 08:09:53 +03:00
|
|
|
(ta-kil %l [(sub pos.inp sop) sop])
|
2020-11-25 22:39:13 +03:00
|
|
|
%x +>(..ta se-anon)
|
|
|
|
%y ?: =(0 num.kil)
|
2016-07-06 06:44:25 +03:00
|
|
|
ta-bel
|
2016-09-08 07:08:34 +03:00
|
|
|
(ta-hom (cat:edit pos.inp ta-yan))
|
2015-05-17 04:05:56 +03:00
|
|
|
==
|
|
|
|
::
|
2015-09-02 01:20:17 +03:00
|
|
|
++ ta-del :: hear delete
|
2015-05-17 04:05:56 +03:00
|
|
|
^+ .
|
2015-09-02 01:20:17 +03:00
|
|
|
?: =((lent buf.say.inp) pos.inp)
|
2016-09-08 09:33:14 +03:00
|
|
|
ta-bel
|
2015-09-02 01:20:17 +03:00
|
|
|
(ta-hom %del pos.inp)
|
2015-05-17 04:05:56 +03:00
|
|
|
::
|
2015-09-02 01:20:17 +03:00
|
|
|
++ ta-erl :: hear local error
|
2020-11-25 23:22:55 +03:00
|
|
|
|= pos=@ud
|
2015-09-02 01:20:17 +03:00
|
|
|
ta-bel(pos.inp (min pos (lent buf.say.inp)))
|
2015-05-17 04:05:56 +03:00
|
|
|
::
|
2015-09-02 01:20:17 +03:00
|
|
|
++ ta-err :: hear remote error
|
2020-11-25 23:22:55 +03:00
|
|
|
|= pos=@ud
|
2015-09-02 01:20:17 +03:00
|
|
|
(ta-erl (~(transpose sole say.inp) pos))
|
2015-05-17 04:05:56 +03:00
|
|
|
::
|
2015-09-02 01:20:17 +03:00
|
|
|
++ ta-fec :: apply effect
|
2020-11-25 23:22:55 +03:00
|
|
|
|= fec=sole-effect
|
2015-05-17 04:05:56 +03:00
|
|
|
^+ +>
|
2016-09-09 03:56:17 +03:00
|
|
|
?- fec
|
2020-11-26 17:09:31 +03:00
|
|
|
[%bel *] ta-bel
|
|
|
|
[%blk *] +>
|
|
|
|
[%clr *] +>(..ta (se-blit fec))
|
|
|
|
[%det *] (ta-got +.fec)
|
|
|
|
[%err *] (ta-err p.fec)
|
|
|
|
[%klr *] +>(..ta (se-blit %klr (make:klr p.fec)))
|
|
|
|
[%mor *] |- ^+ +>.^$
|
2016-09-09 03:56:17 +03:00
|
|
|
?~ p.fec +>.^$
|
|
|
|
$(p.fec t.p.fec, +>.^$ ^$(fec i.p.fec))
|
2020-11-26 17:09:31 +03:00
|
|
|
[%nex *] ta-nex
|
|
|
|
[%pro *] (ta-pro +.fec)
|
|
|
|
[%tab *] +>(..ta (se-tab p.fec))
|
|
|
|
[%tan *] +>(..ta (se-dump p.fec))
|
|
|
|
[%sag *] +>(..ta (se-blit fec))
|
|
|
|
[%sav *] +>(..ta (se-blit fec))
|
|
|
|
[%txt *] +>(..ta (se-text p.fec))
|
|
|
|
[%url *] +>(..ta (se-blit fec))
|
2015-09-02 01:20:17 +03:00
|
|
|
==
|
2015-05-17 04:05:56 +03:00
|
|
|
::
|
2015-09-02 01:20:17 +03:00
|
|
|
++ ta-dog :: change cursor
|
2020-11-25 23:22:55 +03:00
|
|
|
|= ted=sole-edit
|
2015-09-02 01:20:17 +03:00
|
|
|
%_ +>
|
|
|
|
pos.inp
|
|
|
|
=+ len=(lent buf.say.inp)
|
|
|
|
%+ min len
|
|
|
|
|- ^- @ud
|
2016-09-09 03:56:17 +03:00
|
|
|
?- ted
|
2020-11-26 17:09:31 +03:00
|
|
|
[%del *] ?:((gth pos.inp p.ted) (dec pos.inp) pos.inp)
|
|
|
|
[%ins *] ?:((gte pos.inp p.ted) +(pos.inp) pos.inp)
|
|
|
|
[%mor *] |- ^- @ud
|
2016-09-09 03:56:17 +03:00
|
|
|
?~ p.ted pos.inp
|
|
|
|
$(p.ted t.p.ted, pos.inp ^$(ted i.p.ted))
|
2020-11-26 17:09:31 +03:00
|
|
|
[%nop *] pos.inp
|
|
|
|
[%set *] len
|
2015-09-02 01:20:17 +03:00
|
|
|
==
|
|
|
|
==
|
2015-05-17 04:05:56 +03:00
|
|
|
::
|
2017-02-28 23:51:39 +03:00
|
|
|
++ ta-off :: reset buffer offset
|
2020-11-25 23:22:55 +03:00
|
|
|
|= ted=sole-edit
|
|
|
|
=? off (any:edit ted |=(a=sole-edit ?=(%set -.a))) 0
|
2017-02-28 23:51:39 +03:00
|
|
|
+>
|
|
|
|
::
|
2015-09-02 01:20:17 +03:00
|
|
|
++ ta-got :: apply change
|
2020-11-25 23:22:55 +03:00
|
|
|
|= cal=sole-change
|
2018-08-16 03:23:37 +03:00
|
|
|
=^ ted say.inp (~(receive sole say.inp) cal)
|
2017-02-28 23:51:39 +03:00
|
|
|
(ta-dog:(ta-off ted.cal) ted)
|
2015-06-02 23:52:33 +03:00
|
|
|
::
|
2015-09-02 01:20:17 +03:00
|
|
|
++ ta-hom :: local edit
|
2020-11-25 23:22:55 +03:00
|
|
|
|= ted=sole-edit
|
2015-06-02 23:52:33 +03:00
|
|
|
^+ +>
|
2017-02-28 23:51:39 +03:00
|
|
|
=. +> (ta-det:(ta-off ted) ted)
|
2018-08-16 03:23:37 +03:00
|
|
|
(ta-dog(say.inp (~(commit sole say.inp) ted)) ted)
|
2015-05-17 04:05:56 +03:00
|
|
|
::
|
2016-09-03 04:55:07 +03:00
|
|
|
++ ta-jump :: buffer pos
|
2020-11-26 17:09:31 +03:00
|
|
|
|= [dir=?(%l %r) til=?(%ace %edg %wrd) pos=@ud]
|
2016-09-03 04:55:07 +03:00
|
|
|
^- @ud
|
2020-11-25 22:39:13 +03:00
|
|
|
%- ?:(?=(%l dir) sub add)
|
2017-02-28 23:51:39 +03:00
|
|
|
[pos (ta-pos dir til pos)]
|
2016-09-03 04:55:07 +03:00
|
|
|
::
|
2016-09-03 08:09:53 +03:00
|
|
|
++ ta-kil :: kill selection
|
2020-11-26 17:09:31 +03:00
|
|
|
|= [dir=?(%l %r) sel=[@ @]]
|
2016-09-03 08:09:53 +03:00
|
|
|
^+ +>
|
|
|
|
=+ buf=(swag sel buf.say.inp)
|
|
|
|
%. (cut:edit sel)
|
|
|
|
%= ta-hom
|
|
|
|
kil
|
|
|
|
?. ?& ?=(^ old.kil)
|
|
|
|
?=(^ p.blt)
|
2020-11-26 17:09:31 +03:00
|
|
|
?| ?=([%ctl ?(%k %u %w)] u.p.blt)
|
|
|
|
?=([%met ?(%d %bac)] u.p.blt)
|
2016-09-03 08:09:53 +03:00
|
|
|
== ==
|
|
|
|
%= kil :: prepend
|
|
|
|
num +(num.kil)
|
|
|
|
pos +(num.kil)
|
|
|
|
old (scag max.kil `(list (list @c))`[buf old.kil])
|
|
|
|
==
|
|
|
|
%= kil :: cumulative yanks
|
|
|
|
pos num.kil
|
|
|
|
old :_ t.old.kil
|
|
|
|
?- dir
|
2020-11-25 22:39:13 +03:00
|
|
|
%l (welp buf i.old.kil)
|
|
|
|
%r (welp i.old.kil buf)
|
2016-08-28 07:31:35 +03:00
|
|
|
== ==
|
|
|
|
==
|
|
|
|
::
|
2015-09-02 01:20:17 +03:00
|
|
|
++ ta-met :: meta key
|
2020-11-25 23:22:55 +03:00
|
|
|
|= key=@ud
|
2016-09-08 06:47:33 +03:00
|
|
|
^+ +>
|
|
|
|
=. ris ~
|
2016-07-03 07:35:42 +03:00
|
|
|
?+ key ta-bel
|
2020-11-25 22:39:13 +03:00
|
|
|
%dot ?. &(?=(^ old.hit) ?=(^ i.old.hit)) :: last "arg" from hist
|
2016-07-03 05:53:23 +03:00
|
|
|
ta-bel
|
2016-09-09 03:56:17 +03:00
|
|
|
=+ old=`(list @c)`i.old.hit
|
2016-09-04 03:24:55 +03:00
|
|
|
=+ sop=(ta-jump(buf.say.inp old) %l %ace (lent old))
|
2016-09-08 06:47:33 +03:00
|
|
|
(ta-hom (cat:edit pos.inp (slag sop old)))
|
2016-07-03 07:35:42 +03:00
|
|
|
::
|
2020-11-25 22:39:13 +03:00
|
|
|
%bac ?: =(0 pos.inp) :: kill left-word
|
2016-07-03 05:53:23 +03:00
|
|
|
ta-bel
|
2017-02-28 23:51:39 +03:00
|
|
|
=+ sop=(ta-pos %l %edg pos.inp)
|
2016-09-03 08:09:53 +03:00
|
|
|
(ta-kil %l [(sub pos.inp sop) sop])
|
2016-07-03 07:35:42 +03:00
|
|
|
::
|
2020-11-25 22:39:13 +03:00
|
|
|
%b ?: =(0 pos.inp) :: jump left-word
|
2016-07-03 05:53:23 +03:00
|
|
|
ta-bel
|
2016-09-03 04:55:07 +03:00
|
|
|
+>(pos.inp (ta-jump %l %edg pos.inp))
|
2016-07-03 21:39:40 +03:00
|
|
|
::
|
2020-11-25 22:39:13 +03:00
|
|
|
%c ?: =(pos.inp (lent buf.say.inp)) :: capitalize
|
2016-07-03 21:39:40 +03:00
|
|
|
ta-bel
|
2016-09-03 04:55:07 +03:00
|
|
|
=+ sop=(ta-jump %r %wrd pos.inp)
|
|
|
|
%- ta-hom(pos.inp (ta-jump %r %edg sop))
|
2016-10-26 20:48:03 +03:00
|
|
|
%+ rep:edit [sop 1]
|
|
|
|
^- (list @c) ^- (list @) :: XX unicode
|
|
|
|
(cuss `tape``(list @)`(swag [sop 1] buf.say.inp))
|
2016-07-03 21:39:40 +03:00
|
|
|
::
|
2020-11-25 22:39:13 +03:00
|
|
|
%d ?: =(pos.inp (lent buf.say.inp)) :: kill right-word
|
2016-07-03 05:53:23 +03:00
|
|
|
ta-bel
|
2017-02-28 23:51:39 +03:00
|
|
|
(ta-kil %r [pos.inp (ta-pos %r %edg pos.inp)])
|
2016-07-03 07:35:42 +03:00
|
|
|
::
|
2020-11-25 22:39:13 +03:00
|
|
|
%f ?: =(pos.inp (lent buf.say.inp)) :: jump right-word
|
2016-07-03 05:53:23 +03:00
|
|
|
ta-bel
|
2016-09-03 04:55:07 +03:00
|
|
|
+>(pos.inp (ta-jump %r %edg pos.inp))
|
2016-07-03 21:39:40 +03:00
|
|
|
::
|
2020-11-25 22:39:13 +03:00
|
|
|
%r %- ta-hom(lay.hit (~(put by lay.hit) pos.hit ~))
|
2016-09-07 07:54:25 +03:00
|
|
|
:- %set :: revert hist edit
|
2016-08-28 07:44:28 +03:00
|
|
|
?: =(pos.hit num.hit) ~
|
|
|
|
(snag (sub num.hit +(pos.hit)) old.hit)
|
2016-07-05 07:48:56 +03:00
|
|
|
::
|
2020-11-25 22:39:13 +03:00
|
|
|
%t =+ a=(ta-jump %r %edg pos.inp) :: transpose words
|
2016-09-03 04:55:07 +03:00
|
|
|
=+ b=(ta-jump %l %edg a)
|
|
|
|
=+ c=(ta-jump %l %edg b)
|
2016-07-04 03:57:43 +03:00
|
|
|
?: =(b c)
|
|
|
|
ta-bel
|
2016-09-03 04:55:07 +03:00
|
|
|
=+ next=[b (sub a b)]
|
2017-02-28 23:51:39 +03:00
|
|
|
=+ prev=[c (ta-pos %r %edg c)]
|
2016-08-28 07:44:28 +03:00
|
|
|
%- ta-hom(pos.inp a)
|
2016-07-04 03:57:43 +03:00
|
|
|
:~ %mor
|
2016-08-28 07:44:28 +03:00
|
|
|
(rep:edit next (swag prev buf.say.inp))
|
|
|
|
(rep:edit prev (swag next buf.say.inp))
|
2016-07-04 03:57:43 +03:00
|
|
|
==
|
2016-07-03 21:39:40 +03:00
|
|
|
::
|
2020-11-25 22:39:13 +03:00
|
|
|
?(%u %l) :: upper/lower case
|
2016-07-03 21:39:40 +03:00
|
|
|
?: =(pos.inp (lent buf.say.inp))
|
|
|
|
ta-bel
|
2020-11-25 22:39:13 +03:00
|
|
|
=+ case=?:(?=(%u key) cuss cass)
|
2016-09-03 04:55:07 +03:00
|
|
|
=+ sop=(ta-jump %r %wrd pos.inp)
|
2017-02-28 23:51:39 +03:00
|
|
|
=+ sel=[sop (ta-pos %r %edg sop)]
|
2016-10-26 20:48:03 +03:00
|
|
|
%- ta-hom
|
|
|
|
%+ rep:edit sel
|
|
|
|
^- (list @c) ^- (list @) :: XX unicode
|
|
|
|
(case `tape``(list @)`(swag sel buf.say.inp))
|
2016-07-06 06:44:25 +03:00
|
|
|
::
|
2020-11-25 22:39:13 +03:00
|
|
|
%y ?. ?& ?=(^ old.kil) :: rotate & yank
|
2016-07-06 06:44:25 +03:00
|
|
|
?=(^ p.blt)
|
2020-11-26 17:09:31 +03:00
|
|
|
?| ?=([%ctl %y] u.p.blt)
|
|
|
|
?=([%met %y] u.p.blt)
|
2016-07-06 06:44:25 +03:00
|
|
|
== ==
|
|
|
|
ta-bel
|
2016-09-08 07:08:34 +03:00
|
|
|
=+ las=(lent ta-yan)
|
|
|
|
=. pos.kil ?:(=(1 pos.kil) num.kil (dec pos.kil))
|
|
|
|
(ta-hom (rep:edit [(sub pos.inp las) las] ta-yan))
|
2016-07-02 06:31:51 +03:00
|
|
|
==
|
2015-05-17 04:05:56 +03:00
|
|
|
::
|
2015-09-02 01:20:17 +03:00
|
|
|
++ ta-mov :: move in history
|
2020-11-25 23:22:55 +03:00
|
|
|
|= sop=@ud
|
2015-09-02 01:20:17 +03:00
|
|
|
^+ +>
|
|
|
|
?: =(sop pos.hit) +>
|
2016-09-07 04:00:51 +03:00
|
|
|
%- %= ta-hom
|
2015-09-02 01:20:17 +03:00
|
|
|
pos.hit sop
|
2016-09-07 04:00:51 +03:00
|
|
|
lay.hit (~(put by lay.hit) pos.hit buf.say.inp)
|
2015-09-02 01:20:17 +03:00
|
|
|
==
|
2016-09-07 04:00:51 +03:00
|
|
|
:- %set
|
|
|
|
%. (~(get by lay.hit) sop)
|
|
|
|
(bond |.((snag (sub num.hit +(sop)) old.hit)))
|
2015-09-02 01:20:17 +03:00
|
|
|
::
|
|
|
|
++ ta-nex :: advance history
|
2016-09-08 06:47:33 +03:00
|
|
|
^+ .
|
|
|
|
=. ris ~
|
|
|
|
=. lay.hit ~
|
2018-03-19 07:18:20 +03:00
|
|
|
?: ?| ?=(~ buf.say.inp)
|
2016-09-09 03:56:17 +03:00
|
|
|
&(?=(^ old.hit) =(buf.say.inp i.old.hit))
|
2016-06-30 09:11:26 +03:00
|
|
|
==
|
2016-09-08 06:47:33 +03:00
|
|
|
.(pos.hit num.hit)
|
2015-09-02 01:20:17 +03:00
|
|
|
%_ .
|
|
|
|
num.hit +(num.hit)
|
|
|
|
pos.hit +(num.hit)
|
|
|
|
old.hit [buf.say.inp old.hit]
|
|
|
|
==
|
2015-05-17 04:05:56 +03:00
|
|
|
::
|
2017-02-28 23:51:39 +03:00
|
|
|
++ ta-pos :: buffer pos offset
|
2020-11-26 17:09:31 +03:00
|
|
|
|= [dir=?(%l %r) til=?(%ace %edg %wrd) pos=@ud]
|
2016-09-03 04:55:07 +03:00
|
|
|
^- @ud
|
2020-11-25 22:39:13 +03:00
|
|
|
%- ?- til %ace ace:offset
|
|
|
|
%edg edg:offset
|
|
|
|
%wrd wrd:offset
|
2016-09-03 04:55:07 +03:00
|
|
|
==
|
2020-11-25 22:39:13 +03:00
|
|
|
?- dir %l (flop (scag pos buf.say.inp))
|
|
|
|
%r (slag pos buf.say.inp)
|
2016-09-03 04:55:07 +03:00
|
|
|
==
|
|
|
|
::
|
2015-09-02 01:20:17 +03:00
|
|
|
++ ta-pro :: set prompt
|
2020-11-25 23:22:55 +03:00
|
|
|
|= pom=sole-prompt
|
2016-11-14 05:51:21 +03:00
|
|
|
%_ +>
|
|
|
|
pom
|
|
|
|
%_ pom
|
|
|
|
cad
|
|
|
|
;: welp
|
2020-11-25 22:39:13 +03:00
|
|
|
?. ?=(%earl (clan:title p.gyl))
|
2017-11-08 00:05:52 +03:00
|
|
|
(cite:title p.gyl)
|
2016-11-14 05:51:21 +03:00
|
|
|
(scow %p p.gyl)
|
|
|
|
::
|
2017-11-08 00:05:52 +03:00
|
|
|
":"
|
|
|
|
(trip q.gyl)
|
2016-11-14 05:51:21 +03:00
|
|
|
cad.pom
|
|
|
|
==
|
|
|
|
==
|
|
|
|
==
|
2015-09-02 01:20:17 +03:00
|
|
|
::
|
|
|
|
++ ta-ret :: hear return
|
2020-05-05 17:47:37 +03:00
|
|
|
(ta-act ta-id %ret ~)
|
2015-05-17 04:05:56 +03:00
|
|
|
::
|
dojo: add tab completion
This is initial support for type-aware tab completion. When you hit tab, it tries to complete the word you're in the middle of using a face or arm in the subject at that point in the code. It also shows all possible matches and their associated types. It's nearly instantaneous. Notes:
- It advances to the longest common prefix, so if you hit tab on `ab` and the only possible results are `abcde` and `abcdz`, then it'll write `abcd` and print both out (with their types).
- If there are fewer than ten matches, it prints the type along with the face. Printing types is too slow to use all the time, but with 10 it's essentially instantaneous.
- The match closest in the subject to you (i.e. smallest axis number) is displayed lowest (closest to your focus).
Examples below, where `<TAB>` represents me hitting tab while my cursor is at that position (the line with the `<TAB>` is not preserved in the actual output).
```
~zod:dojo> eth<TAB>
-----
ethereum #t/<11.qcl {<3.ltb 27.ipf 7.ecf 36.uek 92.bjk 247.ows 51.mvt 126.xjf 41.mac 1.ane $141> <21.yeb 27.ipf 7.ecf 36.uek 92.bjk 247.ows 51.mvt 126.xjf 41.mac 1.ane $141>}>
ethereum-types #t/<3.ltb 27.ipf 7.ecf 36.uek 92.bjk 247.ows 51.mvt 126.xjf 41.mac 1.ane $141>
~zod:dojo> ethereum
~zod:dojo> |= zong=@ud z<TAB>
-----
zing #t/<1.dqs {* <126.xjf 41.mac 1.ane $141>}>
zap #t/<1.iot {tub/{p/{p/@ud q/@ud} q/""} <1.rff {daf/@t <247.ows 51.mvt 126.xjf 41.mac 1.ane $141>}>}>
zuse #t/$309
zong #t/@ud
~zod:dojo> |= zong=@ud zo<TAB>
-----
zong #t/@ud
~zod:dojo> |= zong=@ud zong
~zod:dojo> <TAB>
hoon-version
trel
quip
pole
unit
qual
lone
... about 600 more lines ...
unity
html
zuse
eny
now
our
~zod:dojo>
```
Functionally, this is in a state where I'd be comfortable shipping it. It doesn't interfere with anything if you don't press tab, and it's perfectly OTA-able. I do think its output is a little verbose, but that can be tuned over time as people try it and determine what feels good in practice.
Additional notes:
- There are plenty of similar systems for other languages, but my most direct inspiration is Idris's editor tools. This is implemented for the dojo, but I actually want it in my editor, which is why the meat is all defind in a library. I've only tested on dojo one-liners, so I don't know the performance on large blocks of code.
- The default type printer isn't great for this use case. In particular,
- Cores should not print anything about their context
- The `#t/` should go away
- If it looks like a gate, we should print its return value
- Maybe special handling for molds, but if the above is done, then for example `bone` is `* -> @ud`.
- The worst part about our wing ordering is that it really screws up tab completion. You want to do `point.owner-address` instead of `owner-address.point` because that lets you type `point.ow<TAB>`. I weakly prefer reading it how we do it now, but it's really not great. You could do an (dojo-specific?) alternate syntax of `point;owner-address`; this is a simple transformation.
- Regardless of the above, this should handle the case where we're in the middle of defining a wing; it doesn't right now.
- When a variable is shadowed, we show both of them. We should probably show the shadowed one with a `^`.
- We probably shouldn't print out hundreds of results. Maybe just the closest 50 with ellipses.
- This gets you any face in your subject, regardless of whether its type is reasonable. We could limit that some by copying the `gol` logic in mint, so that if the pseudo-backward-inference engine happens to know what type it should be, you can filter the tab results according to if they nest in that type. This would be "strongly type-aware".
2019-10-31 06:39:02 +03:00
|
|
|
++ ta-tab :: hear tab
|
2020-05-05 17:47:37 +03:00
|
|
|
(ta-act ta-id %tab pos.inp)
|
dojo: add tab completion
This is initial support for type-aware tab completion. When you hit tab, it tries to complete the word you're in the middle of using a face or arm in the subject at that point in the code. It also shows all possible matches and their associated types. It's nearly instantaneous. Notes:
- It advances to the longest common prefix, so if you hit tab on `ab` and the only possible results are `abcde` and `abcdz`, then it'll write `abcd` and print both out (with their types).
- If there are fewer than ten matches, it prints the type along with the face. Printing types is too slow to use all the time, but with 10 it's essentially instantaneous.
- The match closest in the subject to you (i.e. smallest axis number) is displayed lowest (closest to your focus).
Examples below, where `<TAB>` represents me hitting tab while my cursor is at that position (the line with the `<TAB>` is not preserved in the actual output).
```
~zod:dojo> eth<TAB>
-----
ethereum #t/<11.qcl {<3.ltb 27.ipf 7.ecf 36.uek 92.bjk 247.ows 51.mvt 126.xjf 41.mac 1.ane $141> <21.yeb 27.ipf 7.ecf 36.uek 92.bjk 247.ows 51.mvt 126.xjf 41.mac 1.ane $141>}>
ethereum-types #t/<3.ltb 27.ipf 7.ecf 36.uek 92.bjk 247.ows 51.mvt 126.xjf 41.mac 1.ane $141>
~zod:dojo> ethereum
~zod:dojo> |= zong=@ud z<TAB>
-----
zing #t/<1.dqs {* <126.xjf 41.mac 1.ane $141>}>
zap #t/<1.iot {tub/{p/{p/@ud q/@ud} q/""} <1.rff {daf/@t <247.ows 51.mvt 126.xjf 41.mac 1.ane $141>}>}>
zuse #t/$309
zong #t/@ud
~zod:dojo> |= zong=@ud zo<TAB>
-----
zong #t/@ud
~zod:dojo> |= zong=@ud zong
~zod:dojo> <TAB>
hoon-version
trel
quip
pole
unit
qual
lone
... about 600 more lines ...
unity
html
zuse
eny
now
our
~zod:dojo>
```
Functionally, this is in a state where I'd be comfortable shipping it. It doesn't interfere with anything if you don't press tab, and it's perfectly OTA-able. I do think its output is a little verbose, but that can be tuned over time as people try it and determine what feels good in practice.
Additional notes:
- There are plenty of similar systems for other languages, but my most direct inspiration is Idris's editor tools. This is implemented for the dojo, but I actually want it in my editor, which is why the meat is all defind in a library. I've only tested on dojo one-liners, so I don't know the performance on large blocks of code.
- The default type printer isn't great for this use case. In particular,
- Cores should not print anything about their context
- The `#t/` should go away
- If it looks like a gate, we should print its return value
- Maybe special handling for molds, but if the above is done, then for example `bone` is `* -> @ud`.
- The worst part about our wing ordering is that it really screws up tab completion. You want to do `point.owner-address` instead of `owner-address.point` because that lets you type `point.ow<TAB>`. I weakly prefer reading it how we do it now, but it's really not great. You could do an (dojo-specific?) alternate syntax of `point;owner-address`; this is a simple transformation.
- Regardless of the above, this should handle the case where we're in the middle of defining a wing; it doesn't right now.
- When a variable is shadowed, we show both of them. We should probably show the shadowed one with a `^`.
- We probably shouldn't print out hundreds of results. Maybe just the closest 50 with ellipses.
- This gets you any face in your subject, regardless of whether its type is reasonable. We could limit that some by copying the `gol` logic in mint, so that if the pseudo-backward-inference engine happens to know what type it should be, you can filter the tab results according to if they nest in that type. This would be "strongly type-aware".
2019-10-31 06:39:02 +03:00
|
|
|
::
|
2015-09-02 01:20:17 +03:00
|
|
|
++ ta-ser :: reverse search
|
2020-11-25 23:22:55 +03:00
|
|
|
|= ext=(list @c)
|
2015-05-17 04:05:56 +03:00
|
|
|
^+ +>
|
2018-03-19 07:18:20 +03:00
|
|
|
?: |(?=(~ ris) =(0 pos.u.ris))
|
2016-09-02 05:39:24 +03:00
|
|
|
ta-bel
|
2015-11-16 03:14:41 +03:00
|
|
|
=+ sop=?~(ext (dec pos.u.ris) pos.u.ris)
|
2015-09-02 01:20:17 +03:00
|
|
|
=+ tot=(weld str.u.ris ext)
|
2015-11-16 03:14:41 +03:00
|
|
|
=+ dol=(slag (sub num.hit sop) old.hit)
|
2016-09-02 05:39:24 +03:00
|
|
|
=/ sup
|
2015-12-09 04:54:26 +03:00
|
|
|
|- ^- (unit @ud)
|
2015-09-02 01:20:17 +03:00
|
|
|
?~ dol ~
|
2016-09-02 05:39:24 +03:00
|
|
|
?^ (find tot i.dol)
|
2015-09-02 01:20:17 +03:00
|
|
|
`sop
|
|
|
|
$(sop (dec sop), dol t.dol)
|
|
|
|
?~ sup ta-bel
|
2015-11-16 03:14:41 +03:00
|
|
|
(ta-mov(str.u.ris tot, pos.u.ris u.sup) (dec u.sup))
|
2015-09-02 01:20:17 +03:00
|
|
|
::
|
|
|
|
++ ta-txt :: hear text
|
2020-11-25 23:22:55 +03:00
|
|
|
|= txt=(list @c)
|
2015-09-02 01:20:17 +03:00
|
|
|
^+ +>
|
|
|
|
?^ ris
|
|
|
|
(ta-ser txt)
|
2016-08-28 07:44:28 +03:00
|
|
|
(ta-hom (cat:edit pos.inp txt))
|
2015-09-02 01:20:17 +03:00
|
|
|
::
|
|
|
|
++ ta-vew :: computed prompt
|
2020-11-26 17:09:31 +03:00
|
|
|
^- [pom=stub lin=(pair @ud (list @c))]
|
2020-11-25 23:22:55 +03:00
|
|
|
=; vew=(pair (list @c) styx)
|
2017-02-27 07:39:21 +03:00
|
|
|
[(make:klr q.vew) pos.inp p.vew]
|
2016-08-28 07:44:44 +03:00
|
|
|
?: vis.pom
|
|
|
|
:- buf.say.inp :: default prompt
|
|
|
|
?~ ris
|
|
|
|
cad.pom
|
|
|
|
:(welp "(reverse-i-search)'" (tufa str.u.ris) "': ")
|
|
|
|
:- (reap (lent buf.say.inp) `@c`'*') :: hidden input
|
|
|
|
%+ welp
|
|
|
|
cad.pom
|
|
|
|
?~ buf.say.inp ~
|
|
|
|
:(welp "<" (scow %p (end 4 1 (sham buf.say.inp))) "> ")
|
2016-09-08 07:08:34 +03:00
|
|
|
::
|
|
|
|
++ ta-yan :: yank
|
|
|
|
(snag (sub num.kil pos.kil) old.kil)
|
2015-05-17 04:05:56 +03:00
|
|
|
--
|
2016-08-28 07:44:28 +03:00
|
|
|
++ edit :: produce sole-edits
|
|
|
|
|%
|
|
|
|
++ cat :: mass insert
|
2020-11-26 17:09:31 +03:00
|
|
|
|= [pos=@ud txt=(list @c)]
|
2016-08-28 07:44:28 +03:00
|
|
|
^- sole-edit
|
|
|
|
:- %mor
|
|
|
|
|- ^- (list sole-edit)
|
|
|
|
?~ txt ~
|
|
|
|
[[%ins pos i.txt] $(pos +(pos), txt t.txt)]
|
|
|
|
::
|
|
|
|
++ cut :: mass delete
|
2020-11-26 17:09:31 +03:00
|
|
|
|= [pos=@ud num=@ud]
|
2016-08-28 07:44:28 +03:00
|
|
|
^- sole-edit
|
|
|
|
:- %mor
|
|
|
|
|- ^- (list sole-edit)
|
|
|
|
?: =(0 num) ~
|
|
|
|
[[%del pos] $(num (dec num))]
|
|
|
|
::
|
|
|
|
++ rep :: mass replace
|
2020-11-26 17:09:31 +03:00
|
|
|
|= [[pos=@ud num=@ud] txt=(list @c)]
|
2016-08-28 07:44:28 +03:00
|
|
|
^- sole-edit
|
|
|
|
:~ %mor
|
|
|
|
(cut pos num)
|
|
|
|
(cat pos txt)
|
|
|
|
==
|
2017-03-03 23:27:32 +03:00
|
|
|
++ any :: matches?
|
2020-11-26 17:09:31 +03:00
|
|
|
|= [a=sole-edit b=$-(sole-edit ?)]
|
2017-03-03 23:27:32 +03:00
|
|
|
^- ?
|
2020-11-25 22:39:13 +03:00
|
|
|
?. ?=(%mor -.a) (b a)
|
2020-11-25 23:22:55 +03:00
|
|
|
(lien p.a |=(c=sole-edit ^$(a c)))
|
2016-08-28 07:44:28 +03:00
|
|
|
--
|
2016-09-03 04:55:07 +03:00
|
|
|
++ offset :: calculate offsets
|
|
|
|
|%
|
|
|
|
++ alnm :: alpha-numeric
|
2020-11-25 23:22:55 +03:00
|
|
|
|= a=@ ^- ?
|
2016-09-03 04:55:07 +03:00
|
|
|
?| &((gte a '0') (lte a '9'))
|
|
|
|
&((gte a 'A') (lte a 'Z'))
|
|
|
|
&((gte a 'a') (lte a 'z'))
|
|
|
|
==
|
|
|
|
::
|
|
|
|
++ ace :: next whitespace
|
2020-11-25 23:22:55 +03:00
|
|
|
|= a=(list @)
|
2020-11-26 17:09:31 +03:00
|
|
|
=| [b=_| i=@ud]
|
2016-09-03 04:55:07 +03:00
|
|
|
|- ^- @ud
|
|
|
|
?~ a i
|
2016-09-04 03:24:55 +03:00
|
|
|
=/ c !=(32 i.a)
|
2016-09-03 04:55:07 +03:00
|
|
|
=. b |(b c)
|
|
|
|
?: &(b !|(=(0 i) c)) i
|
|
|
|
$(i +(i), a t.a)
|
|
|
|
::
|
|
|
|
++ edg :: next word boundary
|
2020-11-25 23:22:55 +03:00
|
|
|
|= a=(list @)
|
2020-11-26 17:09:31 +03:00
|
|
|
=| [b=_| i=@ud]
|
2016-09-03 04:55:07 +03:00
|
|
|
|- ^- @ud
|
|
|
|
?~ a i
|
|
|
|
=/ c (alnm i.a)
|
|
|
|
=. b |(b c)
|
|
|
|
?: &(b !|(=(0 i) c)) i
|
|
|
|
$(i +(i), a t.a)
|
|
|
|
::
|
|
|
|
++ wrd :: next or current word
|
2020-11-25 23:22:55 +03:00
|
|
|
|= a=(list @)
|
|
|
|
=| i=@ud
|
2016-09-03 04:55:07 +03:00
|
|
|
|- ^- @ud
|
2018-03-19 07:18:20 +03:00
|
|
|
?: |(?=(~ a) (alnm i.a)) i
|
2016-09-03 04:55:07 +03:00
|
|
|
$(i +(i), a t.a)
|
|
|
|
--
|
2016-07-28 07:14:18 +03:00
|
|
|
::
|
|
|
|
++ klr :: styx/stub engine
|
2016-12-07 06:13:33 +03:00
|
|
|
=, dill
|
2016-07-28 07:14:18 +03:00
|
|
|
|%
|
|
|
|
++ make :: stub from styx
|
2020-11-25 23:22:55 +03:00
|
|
|
|= a=styx ^- stub
|
|
|
|
=| b=stye
|
2016-07-28 07:14:18 +03:00
|
|
|
%+ reel
|
|
|
|
|- ^- stub
|
2016-10-17 23:45:05 +03:00
|
|
|
%- zing %+ turn a
|
2020-11-25 23:22:55 +03:00
|
|
|
|= a=$@(@t (pair styl styx))
|
2016-10-17 23:45:05 +03:00
|
|
|
?@ a [b (tuba (trip a))]~
|
|
|
|
^$(a q.a, b (styd p.a b))
|
2016-07-28 07:14:18 +03:00
|
|
|
::
|
2020-11-26 17:09:31 +03:00
|
|
|
|= [a=(pair stye (list @c)) b=stub]
|
2016-10-17 23:45:05 +03:00
|
|
|
?~ b [a ~]
|
|
|
|
?. =(p.a p.i.b) [a b]
|
2016-07-28 07:14:18 +03:00
|
|
|
[[p.a (weld q.a q.i.b)] t.b]
|
|
|
|
::
|
2016-10-17 23:45:05 +03:00
|
|
|
++ styd :: stye from styl
|
2020-11-26 17:09:31 +03:00
|
|
|
|= [a=styl b=stye] ^+ b :: with inheritance
|
2016-10-17 23:45:05 +03:00
|
|
|
:+ ?~ p.a p.b
|
|
|
|
?~ u.p.a ~
|
|
|
|
(~(put in p.b) u.p.a)
|
|
|
|
(fall p.q.a p.q.b)
|
|
|
|
(fall q.q.a q.q.b)
|
|
|
|
::
|
2016-10-13 08:44:14 +03:00
|
|
|
++ lent-char
|
2020-11-25 23:22:55 +03:00
|
|
|
|= a=stub ^- @
|
2016-10-13 08:44:14 +03:00
|
|
|
(roll (lnts-char a) add)
|
|
|
|
::
|
|
|
|
++ lnts-char :: stub pair tail lengths
|
2020-11-25 23:22:55 +03:00
|
|
|
|= a=stub ^- (list @)
|
2016-07-28 07:14:18 +03:00
|
|
|
%+ turn a
|
2020-11-25 23:22:55 +03:00
|
|
|
|= a=(pair stye (list @c))
|
2016-10-13 08:44:14 +03:00
|
|
|
(lent q.a)
|
2016-07-28 07:14:18 +03:00
|
|
|
::
|
|
|
|
++ brek :: index + incl-len of
|
2020-11-26 17:09:31 +03:00
|
|
|
|= [a=@ b=(list @)] :: stub pair w= idx a
|
|
|
|
=| [c=@ i=@]
|
2016-07-28 07:14:18 +03:00
|
|
|
|- ^- (unit (pair @ @))
|
|
|
|
?~ b ~
|
|
|
|
=. c (add c i.b)
|
|
|
|
?: (gte c a)
|
|
|
|
`[i c]
|
|
|
|
$(i +(i), b t.b)
|
|
|
|
::
|
2016-10-16 06:03:05 +03:00
|
|
|
++ slag :: slag stub, keep stye
|
2020-11-26 17:09:31 +03:00
|
|
|
|= [a=@ b=stub]
|
2016-07-28 07:14:18 +03:00
|
|
|
^- stub
|
2016-10-13 08:44:14 +03:00
|
|
|
=+ c=(lnts-char b)
|
2016-07-28 07:14:18 +03:00
|
|
|
=+ i=(brek a c)
|
|
|
|
?~ i b
|
|
|
|
=+ r=(^slag +(p.u.i) b)
|
|
|
|
?: =(a q.u.i)
|
|
|
|
r
|
|
|
|
=+ n=(snag p.u.i b)
|
|
|
|
:_ r :- p.n
|
|
|
|
(^slag (sub (snag p.u.i c) (sub q.u.i a)) q.n)
|
|
|
|
::
|
2016-10-16 06:03:05 +03:00
|
|
|
++ scag :: scag stub, keep stye
|
2020-11-26 17:09:31 +03:00
|
|
|
|= [a=@ b=stub]
|
2016-07-28 07:14:18 +03:00
|
|
|
^- stub
|
2016-10-13 08:44:14 +03:00
|
|
|
=+ c=(lnts-char b)
|
2016-07-28 07:14:18 +03:00
|
|
|
=+ i=(brek a c)
|
|
|
|
?~ i b
|
|
|
|
?: =(a q.u.i)
|
|
|
|
(^scag +(p.u.i) b)
|
|
|
|
%+ welp
|
|
|
|
(^scag p.u.i b)
|
|
|
|
=+ n=(snag p.u.i b)
|
|
|
|
:_ ~ :- p.n
|
|
|
|
(^scag (sub (snag p.u.i c) (sub q.u.i a)) q.n)
|
2017-02-27 07:44:33 +03:00
|
|
|
::
|
|
|
|
++ swag :: swag stub, keep stye
|
2020-11-26 17:09:31 +03:00
|
|
|
|= [[a=@ b=@] c=stub]
|
2017-02-27 07:44:33 +03:00
|
|
|
(scag b (slag a c))
|
2016-07-28 07:14:18 +03:00
|
|
|
--
|
2015-05-17 04:05:56 +03:00
|
|
|
--
|