Basic radio service now active.

This commit is contained in:
C. Guy Yarvin 2015-01-05 15:59:57 -08:00
parent 3713e95d7c
commit 4917dc9e59
5 changed files with 106 additions and 57 deletions

View File

@ -130,6 +130,14 @@
=. +> $(gel r.gel)
(ra-house n.gel)
::
++ ra-init :: initialize radio
=+ sir=(sein our.hid)
%+ ra-apply our.hid
:+ %design (main our.hid)
:- ~
:_ [%| ~]
?:(=(sir our.hid) ~ [[%& sir (main sir)] ~ ~])
::
++ ra-apply :: apply command
|= [her=ship cod=command]
^+ +>
@ -219,7 +227,7 @@
++ ra-subscribe :: listen to
|= [her=ship pax=path]
^+ +>
:: ~& [%ra-subscribe pax]
:: ~& [%ra-subscribe her pax]
?: ?=(~ pax)
(ra-house(general (~(put in general) ost)) ost)
?: ?=([%am @ ~] pax)
@ -411,9 +419,10 @@
::
[%g %rust %radio-report *]
:: ~& [%pa-friend-report +>+.sih]
?+ -.+>+.sih ~&([%radio-odd-friend sih] !!)
%grams
(pa-lesson q.+.+>+.sih)
?+ -.+>+.sih ~&([%radio-odd-friend sih] !!)
%config +>.$
%group +>.$
%grams (pa-lesson q.+.+>+.sih)
==
==
::
@ -476,7 +485,7 @@
%| ~& tweet-acquire/p.p.tay
!!
::
%& :: ~& [%pa-acquire [our.hid man] [p.p.tay q.p.tay]]
%& ~& [%pa-acquire [our.hid man] [p.p.tay q.p.tay]]
:~ :- /friend/show/[man]
[%g %show [p.p.tay /radio] our.hid /fm/[q.p.tay]/(scot %ud num)]
==
@ -578,6 +587,7 @@
?. ?=([~ %$ ?(%ud %da) @] say) ~
?. ?=([~ %$ ?(%ud %da) @] den) ~
`[(point +>.say) (point +>.den)]
:: ~& [%pa-listen her pax ruv]
?~ ruv
(pa-sauce ost [[%mean ~ %radio-malformed ~] ~])
(pa-start u.ruv)
@ -588,6 +598,7 @@
=+ ^= moy
|- ^- (pair (list bone) (list move))
?~ guests [~ ~]
:: ~& [%pa-refresh num n.guests]
=+ lef=$(guests l.guests)
=+ rit=$(guests r.guests)
=+ old=[p=(welp p.lef p.rit) q=(welp q.lef q.rit)]
@ -659,9 +670,9 @@
++ pour
|= [ost=bone pax=path sih=*]
^- [(list move) _+>]
:: ~& [%radio-pour ost pax sih]
:: ~& sih=sih
=+ sih=((hard sign) sih)
:: ~& [%radio-pour ost pax sih]
?+ pax ~& [%radio-strange-path pax] !!
::
[%provoke ~] [~ +>.$]
@ -718,16 +729,16 @@
|= old=(unit (unit house-any))
^- [(list move) _+>]
?> ?=(^ old)
:- ?^ u.old ~
[0 %pass /time %t %wait (add ~s10 lat.hid)]~
=+ moz=`(list move)`[0 %pass /time %t %wait (add ~s10 lat.hid)]~
|-
?~ u.old
=+ paf=/(scot %p our.hid)/try/(scot %da lat.hid)/radio/backlog/jam
?. ?=([%0 %0 %0] [.^(%cy paf)])
$(u.old (some ((hard house-any) (cue ((hard ,@) .^(%cx paf))))))
:: ~& %radio-prep-new
+:ra-abet:(~(ra-apply ra 0 ~) our.hid %design (main our.hid) `[~ [%| ~]])
:: ~& %radio-prep-old
~& %radio-prep-new
ra-abet:~(ra-init ra 0 moz)
~& %radio-prep-old
:- moz
|-
?- -.u.u.old
%1 %_(+>.^^$ +<+ u.u.old)

View File

@ -27,7 +27,7 @@
++ story :: persona
$: link=(grip bridge) :: connection
count=@ud :: message counter
mike=(pair ,? (set station)) :: active/voice
mike=(pair ,? (set station)) :: passive/voice
quiet=? :: !verbose
past=(list station) :: past received auds
== ::
@ -101,24 +101,7 @@
!:
::::
::
=> |%
++ swatch :: print station set
|= [our=ship tou=(set station)]
=+ tuo=(~(tap in tou))
|- ^- tape
?~ tuo ~
=+ ted=$(tuo t.tuo)
=+ ^= ind ^- tape
?- -.i.tuo
%& =+ sip=(scow %p p.p.i.tuo)
?: =((main our) q.p.i.tuo)
sip
(welp sip (trip q.p.i.tuo))
%| ['^' '@' (trip p.p.i.tuo)]
==
?~ ted ind
(welp ind `tape`[',' ' ' ted])
::
=> |% :: tools
++ parse :: command parser
|= our=ship
=+ vag=(vang | [&1:% &2:% '0' |3:%])
@ -213,6 +196,24 @@
(stag %say tome)
==
--
::
++ swatch :: print station set
|= [our=ship tou=(set station)]
=+ tuo=(~(tap in tou))
|- ^- tape
?~ tuo ~
=+ ted=$(tuo t.tuo)
=+ ^= ind ^- tape
?- -.i.tuo
%& =+ sip=(scow %p p.p.i.tuo)
?: =((main p.p.i.tuo) q.p.i.tuo)
sip
:(welp sip "/" (trip q.p.i.tuo))
%| ['^' '@' (trip p.p.i.tuo)]
==
?~ ted ind
(welp ind `tape`[',' ' ' ted])
::
++ stog :: toggle set
|* [tog=(set) tag=(set)]
=+ got=(~(tap in tog))
@ -279,9 +280,10 @@
[(flop moz) +>(stories (~(put by stories) man +<+))]
::
++ sy-subscribe :: story subscribe
~& [%subscribe-link link]
?> =(%cold -.link)
%_ .
?> =(%cold link)
=+ cub=?.(=(0 count) (scot %ud count) (scot %da (sub lat.hid ~d1)))
=. + (sy-message "subscribe <{(trip cub)}>")
%_ +
link %cool
moz ^- (list move)
:: %^ subscribe /xm/[man] /xm/[man]
@ -294,11 +296,11 @@
(scot %da (sub lat.hid ~d1))
(scot %ud count)
==
~
moz
==
::
++ sy-unsubscribe :: story unsubscribe
?: =(& ?=(?(%cold %dead) -.link)) .
?: =(& ?=(?(%cold %dead) link)) .
%_ .
link %cold
moz :: %+ unsubscribe /xm/[man]
@ -317,12 +319,29 @@
::
++ sy-message :: print message
|= msg=tape
%_(+> moz (display [%leaf "{(trip man)}: {msg}"]~ moz))
%_(+> moz (display [%leaf ":{(trip man)}: {msg}"]~ moz))
::
++ sy-present
|= [msg=tape tay=(list tank)]
=. tay (welp tay `(list tank)`[%leaf "::"]~)
=. tay :_(tay [%leaf ":{(trip man)}: {msg}:: "])
%_(+>.$ moz (display (flop tay) moz))
::
++ sy-prompt
|= tou=(set station)
^- tape
;: welp
(scow %p our.hid)
"/"
(trip man)
?~ tou "& "
:(welp "(" (swatch our.hid tou) ")& ")
==
::
++ sy-voice :: set targets
|= [act=? tou=(set station)]
?: &(p.mike !act) +>
%_(+> mike [act tou], moz (accept (crip (swatch our.hid tou)) moz))
|= [pas=? tou=(set station)]
?: &(!p.mike pas) +>
%_(+>.$ mike [pas tou], moz (accept (crip (sy-prompt tou)) moz))
::
++ sy-rollback
|= lon=@dr
@ -374,7 +393,7 @@
::
%say [%txt (rap 3 (scot %p p.gam) ': ' p.q.sta ~)]
%own [%txt (rap 3 (scot %p p.gam) ' ' p.q.sta ~)]
%lin [%txt (rap 3 (scot %p p.gam) ?:(p.q.sta ' ' ': ') q.q.sta ~)]
%lin [%txt (rap 3 (scot %p p.gam) ?:(p.q.sta ': ' ' ') q.q.sta ~)]
%inv !!
%exp
:- %tang
@ -390,13 +409,15 @@
++ sy-grams :: apply telegrams
|= [num=@ud gaz=(list telegram)]
^+ +>
?: (gth num count)
(sy-message(count 0) "message gap: {<num>} at {<count>}")
=. .
~? (gth num count) [%sy-grams-gap num count]
?: =(num count) .
.(num count, gaz (slag (sub count num) gaz))
=+ las=(add count (lent gaz))
|- ^+ +>.^$
?~ gaz +>.^$
$(gaz t.gaz, +>.^$ (sy-gram i.gaz))
?~ gaz +>.^$(count las)
$(gaz t.gaz, count +(count), +>.^$ (sy-gram i.gaz))
::
++ sy-error :: report error
|= ars=ares
@ -404,13 +425,13 @@
moz
%- display :_ moz
?~ ars [%leaf "connection error"]~
[leaf/"error: (trip p.u.ars)" q.u.ars]
[leaf/"disaster: (trip p.u.ars)" q.u.ars]
==
::
++ sy-sign :: subscription sign
|= res=gall-sign
^+ +>
~& [%sy-sign res]
:: ~& [%sy-sign res]
?- -.res
%mean
=. link %dead
@ -418,7 +439,7 @@
::
%nice :: misordered, ignore
:: ?. ?=(%cool link)
:: ~& [%sy-sign-nice-bad -.link]
:: ~& [%sy-sign-nice-bad link]
:: +>.$
::+>(link %warm)
+>.$
@ -428,7 +449,7 @@
::
%rust :: direct update
?: ?=(?(%cold %dead) link)
~& [%sy-sign-rust-bad `@tas`-.link]
~& [%sy-sign-rust-bad `@tas`link]
+>.$
?> ?=(%radio-report +<.res)
?: ?=(%cool link)
@ -476,7 +497,9 @@
::
++ sz-config :: apply config
|= cof=config
%_(+> xm.big cof, +> (sy-voice %| sources.cof))
=. +>+> (sy-present "config" >cof< ~)
:: ~& [%sz-config cof]
%_(+> xm.big cof, +> (sy-voice %& sources.cof))
::
++ sz-group :: apply register
|= rex=register
@ -513,7 +536,7 @@
+>(moz (show "no story {(trip man)}" moz))
=. +> ny-stop
=. live `man
~& [%tune-start man]
:: ~& [%tune-start man]
(ny-amid sy-subscribe:(need (novel moz)))
::
++ ny-stop :: disconnect story
@ -555,6 +578,11 @@
?~ live ~
`~(. sy [u.live moz] (~(got by stories) u.live))
::
++ peer
|= [ost=bone you=ship pax=path]
^- [(list move) _+>]
[~ +>.$]
::
++ pour-shell
|= txt=cord
^- [(list move) _+>]
@ -573,11 +601,18 @@
=> .(sih ((hard sign) sih))
:: ~& talk-pour/sih
?~ pax ~& talk-pour-strange-path/pax !!
?+ i.pax ~& talk-pour-strange-path/pax !!
?+ i.pax ~& talk-pour-strange-path/pax
~& sign/sih
!!
%command
?+ +<.sih !!
%nice [~ +>.$]
%mean ~&([%pour-mean-cmd-in +>.sih] !!)
==
%cmd-in
?+ +<.sih !!
%nice [~ +>.$]
%mean ~&(%talk-input-crash !!)
%mean ~&([%pour-mean-cmd-in +>.sih] !!)
?(%rush %rust)
?> ?=(%txt -.p.sih)
(pour-shell p.p.sih)
@ -597,7 +632,7 @@
::
%time
:_ +>.$
~& [%talk-pour-time lat.hid `@da`(add ~s10 lat.hid)]
:: ~& [%talk-pour-time lat.hid `@da`(add ~s10 lat.hid)]
:~ [0 %pass /time %t %wait (add ~s10 lat.hid)]
==
::

View File

@ -69,11 +69,13 @@
::
++ stam
^- $+(json (unit statement))
=- (ot now/di speech/(of -) ~)
:~ own/so
say/so
lin/(ot say/bo txt/so ~)
exp/(cu |=(a=cord [a ~]) so)
inv/(ot ship/(su fed:ag) party/(su urs:ab) ~)
:: inv/(ot ship/(su fed:ag) party/(su urs:ab) ~)
==
::
::

View File

@ -64,10 +64,11 @@
++ spec
|= a=speech
%+ joba -.a
?- -.a
?+ -.a !!
?(%own %say) [%s p.a]
%lin (jobe say/[%b p.a] txt/[%s q.a] ~)
%exp (jobe code/[%s p.a] done/?~(q.a ~ (joke u.q.a)) ~)
%inv (jobe ship/(jope p.a) party/[%s q.a] ~)
:: %inv (jobe ship/(jope p.a) party/[%s q.a] ~)
==
::
++ huma

View File

@ -45,8 +45,8 @@
$% [%own p=@t] :: XX @ or /me
[%exp p=@t q=(unit tank)] :: program output
[%ext p=@tas q=*] :: extended action
[%inv p=station] :: invite station
[%irt p=serial q=speech] :: in-reply-to
:: [%inv p=station] :: invite station
[%ire p=serial q=speech] :: in-reply-to
[%lin p=? q=@t] :: no=@, text line
[%mor p=(list speech)] :: multi-line etc
[%say p=@t] :: XX normal line