From e9b6ebae2b186a9a474e1ecbaaf2ccf474a26c98 Mon Sep 17 00:00:00 2001 From: Anton Dyudin Date: Sat, 6 Dec 2014 00:12:52 -0800 Subject: [PATCH] report grow:json compiles --- main/app/radio-test/core.hook | 5 +- main/mar/radio-command/door.hook | 2 +- main/mar/radio-report/door.hook | 90 ++++++++++++++++++++++++++++++++ main/sur/radio/core.hook | 4 +- 4 files changed, 98 insertions(+), 3 deletions(-) create mode 100644 main/mar/radio-report/door.hook diff --git a/main/app/radio-test/core.hook b/main/app/radio-test/core.hook index aeb863c014..d6b3b22e1c 100644 --- a/main/app/radio-test/core.hook +++ b/main/app/radio-test/core.hook @@ -4,7 +4,9 @@ :: |_ [hide ~] ++ peek - |= ^ + |= [@ pax=path] +:: ?: | +:: radio-report/(report grams/[7 "foo" ~]) =+ :+ dat=(trip '{ping: {party:"rom", presence:"talk"}}') =- dat2=(trip -) ''' @@ -36,6 +38,7 @@ } ''' :- %hymn + ^- manx ;html ;head ;script(src "/gen/main/lib/urb.js"); diff --git a/main/mar/radio-command/door.hook b/main/mar/radio-command/door.hook index 898802d9b5..914bc4473b 100644 --- a/main/mar/radio-command/door.hook +++ b/main/mar/radio-command/door.hook @@ -72,7 +72,7 @@ :~ own/so say/so exp/(cu |=(a=cord [a ~]) so) - inv/(ot ship/(su fed:ag) room/(su urs:ab) ~) + inv/(ot ship/(su fed:ag) party/(su urs:ab) ~) == :: :: diff --git a/main/mar/radio-report/door.hook b/main/mar/radio-report/door.hook new file mode 100644 index 0000000000..9c790ee946 --- /dev/null +++ b/main/mar/radio-report/door.hook @@ -0,0 +1,90 @@ +:: +:::: /hook/door/radio-report/mar + :: +/? 314 +/- *radio +!: +=< ~& json:~(grow . (report grams/[7 "foo" ~])) . +|_ rep=report +:: +++ grab :: convert from + |% + ++ noun report :: clam from %noun + -- +++ grow + |% + ++ mime [/text/json (taco (crip (pojo json)))] + ++ json + |^ %+ joba -.rep + ?- -.rep + %config ~! rep (conf +.rep) + %house [%a (turn (~(tap by +.rep)) joce)] + %grams (jobe num/(jone p.rep) tele/[%a (turn q.rep gram)] ~) + %group %.(+.rep (jome phon stas)) + == + ++ joce |=(a=span [%s a]) + ++ jope |=(a=ship (jape +:)) + ++ joke |=(a=tank [%s (role (turn (wash 0^80 a) crip))]) + ++ jode |=(a=time (jone (div (mul (sub a ~1970.1.1) 1.000) ~s1))) +:: ++ jase +:: |* a=,json +:: |= b=(set ,_+<.a) ^- json +:: ~! b +:: [%a (turn (~(tap in b)) a)] + :: + ++ jome :: stringify keys + |* [a=_cord b=_json] + |= c=(map ,_+<.a ,_+<.b) + (jobe (turn (~(tap by c)) (both a b))) + :: + ++ both :: cons two gates + |* [a=_,* b=_,*] + |=(c=_[+<.a +<.b] [(a -.c) (b +.c)]) + :: + :: + ++ phon |=(a=ship (scot %p a)) + ++ gram |=(telegram (jobe ship/(jope p) thought/(thot q) ~)) + ++ thot + |= thought + (jobe serial/(jape

) audience/(audi q) statement/(stam r) ~) + :: + ++ audi (jome stan joce) + ++ stan + |= a=station ^- cord + %- crip + ?~ -.a "{}/{(trip q.p.a)}" + ?- -.p.a + %twitter "{(trip -.p.a)}/{(trip p.p.a)}" + == + :: + ++ stam |=(statement (jobe time/(jode p) speech/(spec q) ~)) + ++ spec + |= a=speech + %+ joba -.a + ?- -.a + ?(%own %say) [%s p.a] + %exp (jobe code/[%s p.a] done/?~(q.a ~ (joke u.q.a)) ~) + %inv (jobe ship/(jope p.a) party/[%s q.a] ~) + == + :: + ++ stas |=(status (jobe presence/(joce p) time/(jode q) human/(huma r) ~)) + ++ huma + |= human + %^ jobe + hand/?~(hand ~ [%s u.hand]) + :- %true + ?~ true ~ + =+ u.true + (jobe first/[%s p] middle/?~(q ~ [%s u.q]) last/[%s r] ~) + ~ + :: + ++ conf + |= config + %- jobe :~ + sources/[%a (turn (~(tap in sources)) |=(a=station [%s (stan a)]))] + =- cordon/(jobe white/[%b -.cordon] list/[%a -] ~) + (turn (~(tap in p.cordon)) jope) :: XX jase + == + -- +-- -- + diff --git a/main/sur/radio/core.hook b/main/sur/radio/core.hook index 2c9158fa3d..746eb22137 100644 --- a/main/sur/radio/core.hook +++ b/main/sur/radio/core.hook @@ -9,6 +9,8 @@ [%publish (list thought)] :: originate [%review (list thought)] :: deliver [%ping (pair span presence)] :: declare status +:: ping:{room:"foo" presence:"hear"} +:: ping:["foo", "hear"] == :: ++ config :: party configuration $: sources=(set station) :: pulls from @@ -24,7 +26,7 @@ == :: ++ presence ?(%hear %talk) :: status type ++ report :: unified rush/rust - $: [%house (set span)] :: meta-changes + $% [%house (set span)] :: meta-changes [%grams (pair ,@ud (list telegram))] :: thoughts [%group (map ship status)] :: presence [%config config] :: reconfigure