urbit/main/mar/radio-command/door.hook

90 lines
2.3 KiB
Plaintext
Raw Normal View History

2014-12-06 04:18:31 +03:00
::
:::: /hook/door/radio-command/mar
::
/? 314
/- *radio
!:
|_ cod=command
::
++ grab :: convert from
|%
++ noun command :: clam from %noun
++ json
=> [jo ..command]
|= a=json ^- command
=- (need ((of -) a))
=< :~ publish/(ar thot)
review/(ar thot)
design/(ot party/so config/(mu conf) ~)
ping/(ot party/so presence/(ci (soft presence) so) ~)
==
|%
++ op :: parse keys of map
|* [fel=_rule wit=fist]
%+ cu mo
%- ci :_ (om wit)
|= a=(map cord ,_(need *wit))
^- (unit (list ,_[(wonk *fel) (need *wit)]))
(zl (turn (~(tap by a)) (head-rush fel)))
::
++ as :: array as set
:: |*(a=fist (cu sa (ar a))) :: XX types
|* a=fist
%- cu :_ (ar a)
~(gas in *(set ,_(need *a)))
::
++ lake |*(a=_,* $+(json (unit a)))
++ peach
|* a=_[rule rule]
|= tub=nail
^- (like (each ,_(wonk (-.a)) ,_(wonk (+.a))))
%. tub
;~(pose (stag %& -.a) (stag %| +.a))
::
++ head-rush
|* a=_rule
|* [b=cord c=*]
=+ nit=(rush b a)
?~ nit ~
(some [u.nit c])
::
::
++ thot
^- $+(json (unit thought))
%- ot :~
serial/(ci (slat %uv) so)
audience/audi
statement/stam
==
::
++ audi (op stati (ci (soft delivery) so)) :: audience
::
++ stati
^- $+(nail (like station))
%+ peach
;~((glue fas) ;~(pfix sig fed:ag) urs:ab)
%+ sear (soft partner)
2014-12-08 21:41:46 +03:00
;~((glue fas) sym (cook crip (star prn))) :: XX [a-z0-9_]{1,15}
2014-12-06 04:18:31 +03:00
::
++ stam
^- $+(json (unit statement))
=- (ot now/di speech/(of -) ~)
:~ own/so
say/so
exp/(cu |=(a=cord [a ~]) so)
2014-12-06 11:12:52 +03:00
inv/(ot ship/(su fed:ag) party/(su urs:ab) ~)
2014-12-06 04:18:31 +03:00
==
::
::
++ conf
^- $+(json (unit config))
%- ot :~
sources/(as (su stati))
:- %cordon
%+ cu |*(a=^ ?~(-.a a a)) :: XX do type stuff
(ot white/bu list/(as (su fed:ag)) ~)
==
--
-- --