urbit/main/app/talk/core.hook

252 lines
6.2 KiB
Plaintext
Raw Normal View History

2014-12-10 23:09:01 +03:00
::
:::: /hook/core/talk/app
::
/? 314
2014-12-11 00:10:30 +03:00
/- *radio
2014-12-10 23:09:01 +03:00
::
::::
::
!:
[sed=!>(.) .]
=> |%
++ axle :: application state
$: cur=@ud :: message cursor
src=(set station) :: config sources
== ::
++ work :: user action
$% [%all p=mess] :: say
[%back p=?(%da %dr %ud) q=@] :: backlog
[%def p=mess] :: use current prompt
[%how ~] :: help
2014-12-11 02:33:22 +03:00
[%join p=station] :: subscribe /=main to
[%host p=span] :: create /=foo
2014-12-10 23:09:01 +03:00
[%priv p=@p q=mess] :: private
[%who ~] :: who
== ::
++ iron :: terminal output
$% [%prompt p=cord q=prom r=cord] :: prompt
[%tang p=(list tank)] :: prettyprintable
[%txt p=cord] :: simple text
==
++ mess
$% [%do p=@t]
[%exp p=@t q=tank]
[%say p=@t]
==
++ gift
$% [%mean ares]
[%nice ~]
[%rush iron]
[%rust iron]
==
++ hapt ,[p=ship q=path]
++ move ,[p=bone q=(mold note gift)]
++ note
$? $: %g
$% [%mess p=hapt q=ship r=cage]
[%nuke p=hapt q=ship]
[%show p=hapt q=ship r=path]
== == ==
++ sign
$? $: %g
$% [%mean p=ares]
[%nice ~]
$: %rush
$= p
$% [%txt p=cord]
== ==
$: %rust
$= p
$% [%txt p=cord]
[%radio-report p=report]
== ==
== == ==
--
!:
::::
::
2014-12-11 02:33:22 +03:00
=| [our=@p lat=@da]
2014-12-10 23:09:01 +03:00
|%
++ talk
=<
2014-12-11 02:33:22 +03:00
%+ cook |=(a=work a)
2014-12-10 23:09:01 +03:00
;~ pose
(cold [%how ~] wut)
(cold [%who ~] tis)
(stag %back dat)
(stag %priv ;~(plug ;~(pfix sig fed:ag) ;~(pfix ace mess)))
(stag %all ;~(pfix pam mess))
2014-12-11 02:33:22 +03:00
(comd %join stati)
(comd %host urs:ab)
2014-12-10 23:09:01 +03:00
(stag %def mess)
==
|%
2014-12-11 02:33:22 +03:00
++ peach :: either ++each branch
|* a=_[rule rule]
|= tub=nail
^- (like (each ,_(wonk (-.a)) ,_(wonk (+.a))))
%. tub
;~(pose (stag %& -.a) (stag %| +.a))
::
++ comd :: ! command
|* [a=@tas b=_rule]
%- full
;~((glue (plus ace)) ;~(pfix zap (cold a (jest a))) b)
::
::
2014-12-10 23:09:01 +03:00
++ dat
%+ sear
|= p=coin
?. ?=([%$ ?(%da %dr %ud) @] p) ~
(some +.p)
;~(pfix bas bas (star ace) nuck:so)
::
++ expn
%- sear
:_ text
|= a=@t
^- (unit ,[p=@t q=tank])
2014-12-11 02:33:22 +03:00
=+ hun=(rush a wide:(vang | [&1:% &2:% (scot %da lat) |3:%]))
2014-12-10 23:09:01 +03:00
?~ hun ~
?~(a ~ [~ a (sell (slap sed u.hun))])
::
++ mess
2014-12-11 02:33:22 +03:00
^- $+(nail (like ^mess))
2014-12-10 23:09:01 +03:00
;~ pose
(stag %do ;~(pfix pat text))
(stag %exp ;~(pfix hax expn))
(stag %do (full (easy '')))
(stag %say text)
==
::
++ text (boss 256 (star prn))
2014-12-11 02:33:22 +03:00
++ stati
^- $+(nail (like station))
%+ peach
;~(plug ;~(pose (cold our tis) (ifix sig^fas fed:ag)) urs:ab)
%+ sear (soft partner)
;~((glue fas) sym (cook crip (star prn))) :: XX [a-z0-9_]{1,15}
2014-12-10 23:09:01 +03:00
--
--
!:
::::
::
|_ [hid=hide axle]
::
++ pour-shell
|= [ost=bone txt=cord]
^- [(list move) _+>]
?: =(0 txt) [~ +>.$]
2014-12-11 02:33:22 +03:00
=+ rey=(rush txt talk(lat lat.hid, our our.hid))
2014-12-10 23:09:01 +03:00
?~ rey
[(send /out %give %rush %tang [%leaf "invalid input"] ~) +>.$]
2014-12-11 03:02:02 +03:00
=- :_ ->
:_ ~
^- move
:* ost %pass /command
%g %mess [our.hid /rodeo] our.hid
[%radio-command !>(cod)]
==
^- [cod=command _+>.$]
2014-12-11 02:33:22 +03:00
?+ -.u.rey !!
%def
?> ?=(%say -.p.u.rey)
2014-12-11 03:02:02 +03:00
=- [[%publish - ~] +>.$]
^- thought
:* (shaf %foo eny.hid)
[[`station`[%& our.hid %main] %pending] ~ ~]
`statement`[lat.hid p.u.rey]
2014-12-11 02:33:22 +03:00
==
::
2014-12-11 02:33:22 +03:00
%host
2014-12-11 03:02:02 +03:00
[[%design p.u.rey ~ `config`[~ [%| ~]]] +>.$]
::
2014-12-11 03:02:02 +03:00
%join
=. src (~(put in src) p.u.rey)
[[%design %main ~ `config`[src [%| ~]]] +>.$]
2014-12-10 23:09:01 +03:00
==
::
++ pour-report
|= [ost=bone rep=report]
^- [(list move) _+>]
~& [%pour-report rep]
2014-12-11 03:02:02 +03:00
?+ -.rep !!
%config
`+>.$(src sources.rep)
2014-12-10 23:09:01 +03:00
%grams
:_ +>.$
2014-12-11 00:10:30 +03:00
%- zing ^- (list (list move))
2014-12-10 23:09:01 +03:00
%+ turn
`(list telegram)`q.rep
|= gam=telegram
2014-12-11 00:10:30 +03:00
=* sta r.q.gam
?+ -.q.sta !!
2014-12-10 23:09:01 +03:00
%say
2014-12-11 00:10:30 +03:00
(send /out %give %rush %txt p.q.sta)
2014-12-10 23:09:01 +03:00
==
==
::
++ peer
|= [ost=bone you=ship pax=path]
^- [(list move) _+>]
:_ +>.$
2014-12-11 00:10:30 +03:00
?~ pax !!
2014-12-10 23:09:01 +03:00
?+ i.pax !!
%out
[ost %give %rust %prompt '& ' %text '']~
==
::
++ pour
|= [ost=bone pax=path sih=*]
^- [(list move) _+>]
=+ sih=((hard sign) sih)
2014-12-11 00:10:30 +03:00
?~ pax ~& talk-pour-strange-path/pax !!
?+ i.pax ~& talk-pour-strange-path/pax !!
2014-12-10 23:09:01 +03:00
%cmd-in
?- +<.sih
%nice [~ +>.$]
%mean [(send /out %give +.sih) +>.$]
?(%rush %rust)
?> ?=(%txt -.p.sih)
(pour-shell ost p.p.sih)
==
2014-12-11 00:10:30 +03:00
::
%command
?> ?=(?(%mean %nice) +<.sih)
[~ +>.$]
2014-12-10 23:09:01 +03:00
::
2014-12-11 03:02:02 +03:00
?(%am %fm)
2014-12-11 01:50:40 +03:00
~& talk-pour/sih
2014-12-11 00:10:30 +03:00
?+ &2.sih !!
?(%nice %mean) [~ +>.$]
%rust ?>(?=(%radio-report &3.sih) (pour-report ost p.p.sih))
==
2014-12-10 23:09:01 +03:00
==
::
++ poke-talk-args
|= [ost=bone you=ship arg=~]
^- [(list move) _+>]
:_ +>
:* [ost %pass /cmd-in %g %show [our.hid +.imp.hid] you /in/[-.imp.hid]]
^- move
2014-12-11 00:10:30 +03:00
:* ost %pass /fm
%g %show
[our.hid /rodeo] our.hid
2014-12-10 23:09:01 +03:00
/fm/main
==
2014-12-11 03:02:02 +03:00
^- move
:* ost %pass /am
%g %show [our.hid /rodeo] our.hid
/am/main
==
2014-12-10 23:09:01 +03:00
(send /out %give %rush %prompt '& ' %text '')
==
::
++ send
|= [pax=path msg=(mold note gift)]
^- (list move)
:: ~& [%send pus.hid]
%+ turn (~(tap in (~(get ju pus.hid) pax)))
|=(ost=bone [ost msg])
--