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

View File

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

View File

@ -69,11 +69,13 @@
:: ::
++ stam ++ stam
^- $+(json (unit statement)) ^- $+(json (unit statement))
=- (ot now/di speech/(of -) ~) =- (ot now/di speech/(of -) ~)
:~ own/so :~ own/so
say/so say/so
lin/(ot say/bo txt/so ~)
exp/(cu |=(a=cord [a ~]) 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 ++ spec
|= a=speech |= a=speech
%+ joba -.a %+ joba -.a
?- -.a ?+ -.a !!
?(%own %say) [%s p.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)) ~) %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 ++ huma

View File

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