urbit/mar/talk/command.hoon

128 lines
3.3 KiB
Plaintext
Raw Normal View History

2014-12-06 04:18:31 +03:00
::
2016-02-05 06:05:37 +03:00
:::: /hoon/command/talk/mar
2014-12-06 04:18:31 +03:00
::
2016-02-18 02:00:12 +03:00
/? 310
/- talk
2017-02-14 03:02:25 +03:00
/+ old-zuse
2016-11-17 04:42:58 +03:00
::
2016-11-17 04:37:39 +03:00
=, talk
2016-01-31 06:37:03 +03:00
|_ cod/command
2014-12-06 04:18:31 +03:00
::
++ grab :: convert from
|%
++ noun command :: clam from %noun
++ json
2017-02-14 03:02:25 +03:00
=, old-zuse
=, jo
2016-01-31 06:37:03 +03:00
|= a/json ^- command
2014-12-06 04:18:31 +03:00
=- (need ((of -) a))
2016-01-31 06:37:03 +03:00
=< :~ publish+(ar thot)
review+(ar thot)
design+(ot party+so config+(mu conf) ~)
2014-12-06 04:18:31 +03:00
==
|%
++ op :: parse keys of map
|* {fel/rule wit/fist}
%+ cu malt
2016-01-31 06:37:03 +03:00
%+ ci
|= a/(map cord _(need *wit))
2017-02-14 03:44:49 +03:00
=, unity
2016-01-31 06:37:03 +03:00
^- (unit (list _[(wonk *fel) (need *wit)]))
2017-02-14 03:44:49 +03:00
(drop-list (turn (~(tap by a)) (head-rush fel)))
2016-01-31 06:37:03 +03:00
(om wit)
2014-12-06 04:18:31 +03:00
::
++ ke :: callbacks
2016-01-31 06:37:03 +03:00
|* {gar/* sef/_|.(fist)}
|= jon/json
^- (unit _gar)
2015-10-28 02:43:08 +03:00
=- ~! gar ~! (need -) -
((sef) jon)
::
2014-12-06 04:18:31 +03:00
++ as :: array as set
|* a/fist
2016-01-31 06:37:03 +03:00
(cu ~(gas in *(set _(need *a))) (ar a))
2014-12-06 04:18:31 +03:00
::
2016-02-04 10:12:23 +03:00
++ lake |*(a/_* $-(json (unit a)))
2014-12-06 04:18:31 +03:00
++ peach
2016-01-31 06:37:03 +03:00
|* a/{rule rule}
|= tub/nail
2016-01-31 06:37:03 +03:00
^- (like (each _(wonk (-.a)) _(wonk (+.a))))
2014-12-06 04:18:31 +03:00
%. tub
;~(pose (stag %& -.a) (stag %| +.a))
::
++ head-rush
2016-01-31 06:37:03 +03:00
|* a/rule
|* {cord *}
=+ nit=(rush +<- a)
2014-12-06 04:18:31 +03:00
?~ nit ~
(some [u.nit +>->])
2014-12-06 04:18:31 +03:00
::
::
++ thot
2016-02-04 10:12:23 +03:00
^- $-(json (unit thought))
2014-12-06 04:18:31 +03:00
%- ot :~
serial+ceri
audience+audi
2016-01-31 06:37:03 +03:00
statement+stam
2014-12-06 04:18:31 +03:00
==
::
2016-01-31 06:37:03 +03:00
++ ceri
2016-02-04 10:12:23 +03:00
^- $-(json (unit serial))
2016-01-31 06:37:03 +03:00
(ci (slat %uv) so)
::
++ audi
2016-02-04 10:12:23 +03:00
^- $-(json (unit audience))
(op parn memb)
2016-01-31 06:37:03 +03:00
::
++ auri (op parn (ci (soft presence) so))
2016-01-31 06:37:03 +03:00
++ memb (ot [envelope+lope delivery+(ci (soft delivery) so) ~])
++ lope (ot [visible+bo sender+(mu (su parn)) ~])
2014-12-06 04:18:31 +03:00
::
2015-01-26 20:44:09 +03:00
++ parn
2016-02-04 10:12:23 +03:00
^- $-(nail (like partner))
2014-12-06 04:18:31 +03:00
%+ peach
;~((glue fas) ;~(pfix sig fed:ag) urs:ab)
2015-01-26 20:44:09 +03:00
%+ sear (soft passport)
2014-12-12 04:09:59 +03:00
;~((glue fas) sym urs:ab) :: XX [a-z0-9_]{1,15}
2014-12-06 04:18:31 +03:00
::
2016-01-31 06:37:03 +03:00
++ speech-or-eval $?(speech {$eval p/@t} {$mor p/(list speech-or-eval)})
2015-06-19 04:47:41 +03:00
++ eval
|= a/(trel @da bouquet speech-or-eval)
2016-01-31 06:37:03 +03:00
^- statement
2015-10-28 02:43:08 +03:00
%= a r ^- speech
|-
2016-01-31 06:37:03 +03:00
?: ?=($mor -.r.a)
[%mor (turn p.r.a |=(b/speech-or-eval ^$(r.a b)))]
?. ?=($eval -.r.a) r.a
=- [%fat tank+- %exp p.r.a]
2015-10-28 02:43:08 +03:00
=+ pax=[&1:% &2:% (scot %da p.a) |3:%]
p:(mule |.([(sell (slap !>(..zuse) (rain pax p.r.a)))]~))
==
2015-06-19 04:47:41 +03:00
::
2014-12-06 04:18:31 +03:00
++ stam
^- $-(json (unit statement))
2015-06-19 04:47:41 +03:00
%+ cu eval
2016-01-31 06:37:03 +03:00
(ot date+di bouquet+(as (ar so)) speech+spec ~)
2015-10-28 02:43:08 +03:00
::
++ spec
%+ ke *speech-or-eval |.
2015-10-28 02:43:08 +03:00
%- of
:~ lin+(ot say+bo txt+so ~)
2016-01-31 06:37:03 +03:00
url+(su aurf:urlp)
eval+so
mor+(ar spec)
:: exp+(cu |=(a=cord [a ~]) so)
:: inv+(ot ship+(su fed:ag) party+(su urs:ab) ~)
2014-12-06 04:18:31 +03:00
==
::
++ conf
2016-02-04 10:12:23 +03:00
^- $-(json (unit config))
2014-12-06 04:18:31 +03:00
%- ot :~
2016-01-31 06:37:03 +03:00
sources+(as (su parn))
caption+so
2014-12-06 04:18:31 +03:00
:- %cordon
2016-01-31 06:37:03 +03:00
(ot posture+(ci (soft posture) so) list+(as (su fed:ag)) ~)
2014-12-06 04:18:31 +03:00
==
--
-- --