mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-09-22 16:09:13 +03:00
Merge branch 'master' of github.com:urbit/urbit
Conflicts: urb/urbit.pill
This commit is contained in:
commit
ffad1ede43
@ -51,9 +51,6 @@
|
||||
$? $: %a :: from %ames
|
||||
$% [%went p=ship q=cape] ::
|
||||
== == ::
|
||||
$: %g :: from %gall
|
||||
$% [%rasp p=(unit (pair logo noun))] ::
|
||||
== == ::
|
||||
$: @tas ::
|
||||
$% [%crud p=@tas q=(list tank)] :: by any
|
||||
[%send p=lane q=@] :: transmit packet
|
||||
@ -1688,8 +1685,6 @@
|
||||
^- [(list move) _+>]
|
||||
?- +<.sih
|
||||
%crud [[[hen [%slip %d %flog +.sih]] ~] +>]
|
||||
%rasp ~& %knap-rasp
|
||||
[~ +>]
|
||||
%send [[hen %give +.sih]~ +>]
|
||||
%went [~ +>]
|
||||
==
|
||||
|
@ -86,6 +86,9 @@
|
||||
[%hail ~] :: by any
|
||||
[%helo p=path q=prod] :: by %ames
|
||||
[%init p=@p] :: by %ames
|
||||
[%lean ~] ::
|
||||
[%mean p=(list tank)] ::
|
||||
[%nice ~] ::
|
||||
[%note p=@tD q=tank] :: by %clay
|
||||
[%pipe p=(unit ,[p=tutu q=(list)])] :: by %batz
|
||||
[%rush p=logo q=*] ::
|
||||
@ -274,6 +277,9 @@
|
||||
%hail [[[hen %give sin] ~] +<.^^$]
|
||||
%helo [~ +<.^^$]
|
||||
%init [[[hen %give sin] ~] +<.^^$]
|
||||
%lean [~ +<.^^$]
|
||||
%mean [~ +<.^^$]
|
||||
%nice [~ +<.^^$]
|
||||
%note [[[hen %give sin] ~] +<.^^$]
|
||||
%pipe !!
|
||||
%rush ?. (fear tea) :: legit
|
||||
|
@ -76,7 +76,9 @@
|
||||
== == ::
|
||||
$: %g :: by %gall
|
||||
$% [%dumb ~] ::
|
||||
[%rasp p=(unit (pair logo noun))] ::
|
||||
[%lean ~] ::
|
||||
[%mean p=(list tank)] ::
|
||||
[%nice ~] ::
|
||||
[%rush p=logo q=*] ::
|
||||
[%rust p=logo q=*] ::
|
||||
== == ::
|
||||
@ -319,25 +321,7 @@
|
||||
%crud
|
||||
+>.$(mow [[hen %slip %d %flog +.sih] mow])
|
||||
::
|
||||
%dumb
|
||||
?> ?=([%hoop @ @ @ @ ~] tea)
|
||||
=+ ^= ouy
|
||||
%- yolk:(gale (slav %p i.t.tea) i.t.t.tea)
|
||||
(slav %ud i.t.t.t.tea)
|
||||
?~ ouy
|
||||
+>.$
|
||||
abet:work:abet:dumb:(yule:u.ouy (slav %ud i.t.t.t.t.tea))
|
||||
::
|
||||
%made
|
||||
?. ?=([%honk @ @ @ ~] tea)
|
||||
+>.$
|
||||
%- galt
|
||||
[(slav %p i.t.tea) i.t.t.tea (slav %ud i.t.t.t.tea) p.+.sih]
|
||||
::
|
||||
%rasp
|
||||
=+ ^= cuy ^- (unit cage)
|
||||
?~ p.+.sih ~
|
||||
`[p.u.p.+.sih (slot 15 [typ +.sih])]
|
||||
?(%dumb %lean %mean %nice %rush %rust)
|
||||
?> ?=([%hoop @ @ @ @ ~] tea)
|
||||
=+ ^= ouy
|
||||
%- yolk:(gale (slav %p i.t.tea) i.t.t.tea)
|
||||
@ -346,20 +330,37 @@
|
||||
+>.$
|
||||
=+ woy=(yule:u.ouy (slav %ud i.t.t.t.t.tea))
|
||||
=< abet =< work =< abet
|
||||
?~ cuy
|
||||
dumb:woy
|
||||
(hear:woy `[%& u.cuy])
|
||||
?- -.+.sih
|
||||
%dumb
|
||||
dumb:woy
|
||||
%lean
|
||||
%^ hear:woy ~ %&
|
||||
:- %json !>((jobe ~[[%ok %b |] [%res %s 'subscription ended']]))
|
||||
%mean
|
||||
=+ ^= jso
|
||||
%- jobe
|
||||
:+ [%ok %b |]
|
||||
:+ %res %s
|
||||
%- crip
|
||||
%+ slag 2
|
||||
^- tape
|
||||
%+ roll p.+.sih
|
||||
|= [p=tank q=tape]
|
||||
:(weld q "\\n" ~(ram re p))
|
||||
~
|
||||
(hear:woy ~ %& %json !>(jso))
|
||||
%nice
|
||||
(hear:woy ~ %& %json !>((joba %ok %b &)))
|
||||
?(%rust %rush)
|
||||
=+ cay=`cage`[p.+.sih (slot 3 (spec (slot 3 [typ +.sih])))]
|
||||
(hear:woy ~ ?:(?=(%rust -.+.sih) [%& cay] [%| cay]))
|
||||
==
|
||||
::
|
||||
?(%rush %rust)
|
||||
=+ cay=`cage`[p.+.sih (slot 3 (spec (slot 3 [typ +.sih])))]
|
||||
=+ heq=?:(?=(%rust -.+.sih) [%& cay] [%| cay])
|
||||
?> ?=([%hoop @ @ @ @ ~] tea)
|
||||
=+ ^= ouy
|
||||
%- yolk:(gale (slav %p i.t.tea) i.t.t.tea)
|
||||
(slav %ud i.t.t.t.tea)
|
||||
?~ ouy
|
||||
%made
|
||||
?. ?=([%honk @ @ @ ~] tea)
|
||||
+>.$
|
||||
abet:work:abet:(hear:(yule:u.ouy (slav %ud i.t.t.t.t.tea)) `heq)
|
||||
%- galt
|
||||
[(slav %p i.t.tea) i.t.t.tea (slav %ud i.t.t.t.tea) p.+.sih]
|
||||
::
|
||||
%thou :: remote return
|
||||
?> ?=([@ @ *] tea)
|
||||
|
124
arvo/gall.hoon
124
arvo/gall.hoon
@ -2,7 +2,7 @@
|
||||
!? 164
|
||||
::::
|
||||
|= pit=vase
|
||||
=> =~
|
||||
=> =~
|
||||
|% :::::::::::::::::::::::::::::::::::::::::::::::::::::: structures
|
||||
++ axle :: all %gall state
|
||||
$: %0 :: state version
|
||||
@ -14,8 +14,10 @@
|
||||
$% [%back p=?] :: %mess ack good/bad
|
||||
[%crud p=@tas q=(list tank)] :: physical error
|
||||
[%dumb ~] :: close duct
|
||||
[%rasp ~] :: message failure
|
||||
[%lean ~] :: subscription done
|
||||
[%mean p=(list tank)] :: message failure
|
||||
[%meta p=vase] :: meta-gift
|
||||
[%nice ~] :: message success
|
||||
== ::
|
||||
++ hasp ,[p=ship q=term] :: app identity
|
||||
++ kiss :: in request ->$
|
||||
@ -57,7 +59,7 @@
|
||||
[%mess p=hasp q=ship r=cage] ::
|
||||
[%nuke p=hasp q=ship] ::
|
||||
== == ::
|
||||
$: @tas :: to any
|
||||
$: @tas :: to any
|
||||
$% [%meta p=vase] ::
|
||||
== == == ::
|
||||
++ rapt |*(a=$+(* *) (qual path path ,@da a)) :: versioned result
|
||||
@ -75,13 +77,13 @@
|
||||
$: p=@ud :: bone sequence
|
||||
q=(map duct ,[p=bone q=(unit cuff)]) :: by duct
|
||||
r=(map bone duct) :: by bone
|
||||
== ::
|
||||
== ::
|
||||
++ roon :: foreign response
|
||||
$% [%d p=logo q=*] :: diff
|
||||
$% [%d p=logo q=*] :: diff
|
||||
[%e p=(list tank)] :: error
|
||||
[%f p=logo q=*] :: full refresh
|
||||
[%k ~] :: message response
|
||||
[%n ~] :: cancel subscription
|
||||
[%r p=(unit (pair logo noun))] :: message response
|
||||
== ::
|
||||
++ rook :: foreign request
|
||||
$% [%m p=logo q=*] :: message
|
||||
@ -108,7 +110,9 @@
|
||||
$? [?(%a %b %c %d %e) @tas *] ::
|
||||
$: %g :: by %gall
|
||||
$% [%dumb ~] ::
|
||||
[%rasp p=(unit (pair logo noun))] ::
|
||||
[%lean ~] :: cancel subscription
|
||||
[%mean p=(list tank)] :: message failure
|
||||
[%nice ~] :: message success
|
||||
[%rush p=logo q=*] ::
|
||||
[%rust p=logo q=*] ::
|
||||
== == ::
|
||||
@ -117,7 +121,7 @@
|
||||
== == == ::
|
||||
++ toil (pair duct knob) :: work in progress
|
||||
-- ::::::::::::::::::::::::::::::::::::::::::::::::::::::
|
||||
|% :::::::::::::::::::::::::::::::::::::::::::::::::::::: functions
|
||||
|% :::::::::::::::::::::::::::::::::::::::::::::::::::::: functions
|
||||
++ byby :: double bind
|
||||
|* [a=(unit (unit)) b=$+(* *)]
|
||||
?~ a ~
|
||||
@ -166,7 +170,7 @@
|
||||
|= pax=path
|
||||
^- [p=[p=ship q=term] q=path]
|
||||
?> ?=([@ @ *] pax)
|
||||
:- :- (need (slaw %p i.pax))
|
||||
:- :- (need (slaw %p i.pax))
|
||||
(need ((sand %tas) i.t.pax))
|
||||
t.t.pax
|
||||
--
|
||||
@ -200,7 +204,7 @@
|
||||
%nuke [law p.q.hic %nuke q.q.hic]
|
||||
==
|
||||
((goad hen law) p.hap q.hap kon)
|
||||
::
|
||||
::
|
||||
++ take :: accept response
|
||||
|= [pax=path hen=duct hin=(hypo sign)] ::
|
||||
^- [p=(list move) q=_..^$]
|
||||
@ -216,9 +220,9 @@
|
||||
++ scry
|
||||
|= $: use=(unit (set monk))
|
||||
ren=@tas
|
||||
who=ship
|
||||
syd=desk
|
||||
lot=coin
|
||||
who=ship
|
||||
syd=desk
|
||||
lot=coin
|
||||
tyl=path
|
||||
==
|
||||
^- (unit (unit (pair logo ,*)))
|
||||
@ -252,7 +256,7 @@
|
||||
..^$(all old)
|
||||
::
|
||||
++ stay `axle`+>-.$
|
||||
--
|
||||
--
|
||||
|% :: inner core
|
||||
::
|
||||
++ best :: cage to gift
|
||||
@ -260,21 +264,10 @@
|
||||
^- gift
|
||||
:- %meta
|
||||
^- vase
|
||||
:- :+ %cell [%cube %rust %atom %tas]
|
||||
:- :+ %cell [%cube sem %atom %tas]
|
||||
[%cell [%atom %tas] p.q.cay]
|
||||
[sem p.cay q.q.cay]
|
||||
::
|
||||
++ besp :: best for rasp grr
|
||||
|= cuy=(unit cage)
|
||||
^- gift
|
||||
?~ cuy [%rasp ~]
|
||||
:- %meta
|
||||
^- vase
|
||||
:- :+ %cell [%cube %rasp %atom %tas]
|
||||
:+ %cell [%cube 0 [%atom %n]]
|
||||
[%cell [%atom %tas] p.q.u.cuy]
|
||||
[%rasp ~ p.u.cuy q.q.u.cuy]
|
||||
::
|
||||
++ gaff :: take and go
|
||||
|= [our=@p app=@tas]
|
||||
=+ mat=(need (~(get by pol.all) our))
|
||||
@ -294,7 +287,7 @@
|
||||
?^ nym [u.nym sad]
|
||||
:- p.sad
|
||||
:+ +(p.sad)
|
||||
(~(put by q.sad) hen p.sad)
|
||||
(~(put by q.sad) hen p.sad)
|
||||
(~(put by r.sad) p.sad hen)
|
||||
:- =+ ^= roc ^- rook
|
||||
?- -.kon
|
||||
@ -304,12 +297,12 @@
|
||||
==
|
||||
^- (list move)
|
||||
:~ :- hen
|
||||
:+ %pass
|
||||
:+ %pass
|
||||
~[%x -.roc (scot %p you) app (scot %p our) (scot %ud num)]
|
||||
`note`[%a [%want [you our] [%q %ge app ~] [num roc]]]
|
||||
==
|
||||
%= ..^^$
|
||||
pol.all
|
||||
pol.all
|
||||
%+ ~(put by pol.all)
|
||||
you
|
||||
mat(sap (~(put by sap.mat) our sad))
|
||||
@ -319,11 +312,11 @@
|
||||
|= [hen=duct pax=path sih=sign]
|
||||
^- [(list move) _..^$]
|
||||
?. ?=(%f -.sih) ?>(?=(%a -.sih) [~ ..^$])
|
||||
:_ ..^$
|
||||
:_ ~
|
||||
:_ ..^$
|
||||
:_ ~
|
||||
:- hen
|
||||
?- -.p.+.sih
|
||||
%|
|
||||
%|
|
||||
[%give %crud %gasp-crud p.p.+.sih]
|
||||
::
|
||||
%&
|
||||
@ -331,7 +324,6 @@
|
||||
?+ -.pax !!
|
||||
%d [%give (best %rush cay)]
|
||||
%f [%give (best %rust cay)]
|
||||
%r [%give (besp ~ cay)]
|
||||
==
|
||||
==
|
||||
::
|
||||
@ -361,7 +353,9 @@
|
||||
%g
|
||||
?- -.+.sih
|
||||
%dumb !!
|
||||
%rasp (rod %r p.+.sih)
|
||||
%lean !!
|
||||
%mean (rod %e p.+.sih)
|
||||
%nice (rod %k ~)
|
||||
%rush !!
|
||||
%rust !!
|
||||
==
|
||||
@ -372,13 +366,15 @@
|
||||
:_ ~ :- hen
|
||||
:+ %pass [%r pax]
|
||||
^- note
|
||||
?- -.+.sih
|
||||
?- -.+.sih
|
||||
%dumb !!
|
||||
%rasp !!
|
||||
%lean (rod %n ~)
|
||||
%mean !!
|
||||
%nice !!
|
||||
%rush (rod %d p.+.sih q.+.sih)
|
||||
%rust (rod %f p.+.sih q.+.sih)
|
||||
==
|
||||
==
|
||||
==
|
||||
%u !!
|
||||
==
|
||||
::
|
||||
@ -392,12 +388,10 @@
|
||||
^- move :- neh
|
||||
?- -.ron
|
||||
%d [%pass /x/d `note`[%f %exec p.saq ~ %vale p.ron saq q.ron]]
|
||||
%e !!
|
||||
%e [%give %mean p.ron]
|
||||
%f [%pass /x/f `note`[%f %exec p.saq ~ %vale p.ron saq q.ron]]
|
||||
%n !!
|
||||
%r ?~ p.ron
|
||||
[%give %rasp ~]
|
||||
[%pass /x/r `note`[%f %exec p.saq ~ %vale p.u.p.ron saq q.u.p.ron]]
|
||||
%k [%give %nice ~]
|
||||
%n [%give %lean ~]
|
||||
==
|
||||
::
|
||||
++ gawk :: %r call/request
|
||||
@ -439,7 +433,7 @@
|
||||
|= [our=@p app=@tas kon=knob]
|
||||
^- [(list move) _..^^$]
|
||||
=+ mut=(~(get by pol.all) our)
|
||||
?^ mut
|
||||
?^ mut
|
||||
abet:work:(quem:(boar:(gent our app u.mut) hen law) kon)
|
||||
((gape hen law) our app kon)
|
||||
::
|
||||
@ -469,7 +463,7 @@
|
||||
%_ ..$
|
||||
all
|
||||
%_ all
|
||||
pol %+ ~(put by pol.all) our
|
||||
pol %+ ~(put by pol.all) our
|
||||
mat(bum (~(put by bum.mat) app sat))
|
||||
==
|
||||
==
|
||||
@ -654,7 +648,7 @@
|
||||
::
|
||||
++ mack :: apply standard
|
||||
|= sih=sign
|
||||
?> ?=(%f -.sih)
|
||||
?> ?=(%f -.sih)
|
||||
^- [(unit (list tank)) _+>]
|
||||
?- -.p.+.sih
|
||||
& :- ~
|
||||
@ -666,7 +660,7 @@
|
||||
++ meek :: apply peek
|
||||
|= sih=sign
|
||||
^- [(unit cage) _+>]
|
||||
?> ?=(%f -.sih)
|
||||
?> ?=(%f -.sih)
|
||||
?- -.p.+.sih
|
||||
& =+ vax=`vase`q.q.p.p.+.sih
|
||||
?. &(?=(^ q.vax) ?=(@ -.q.vax))
|
||||
@ -691,7 +685,7 @@
|
||||
++ murk :: apply park
|
||||
|= sih=sign
|
||||
^- [(unit cage) _+>]
|
||||
?> ?=(%f -.sih)
|
||||
?> ?=(%f -.sih)
|
||||
?- -.p.+.sih
|
||||
& [`q.p.p.+.sih +>.$]
|
||||
| [~ (give %crud %made p.p.+.sih)]
|
||||
@ -714,7 +708,7 @@
|
||||
?> ?& ?=([@ *] t.pax)
|
||||
!=(~ qic.sat)
|
||||
=(`[hen pax] onz.sat)
|
||||
==
|
||||
==
|
||||
=: onz.sat ~
|
||||
qic.sat ~
|
||||
==
|
||||
@ -726,12 +720,12 @@
|
||||
+>.$
|
||||
(quen %load u.gyd)
|
||||
::
|
||||
%peek
|
||||
%peek
|
||||
?> ?=([@ *] t.t.pax)
|
||||
=+ you=(need (slaw %p i.t.t.pax))
|
||||
=^ gyd +>.$ (meek q.hin)
|
||||
?~ gyd
|
||||
(give [%dumb ~])
|
||||
(give [%dumb ~])
|
||||
=+ kee=[you t.t.t.pax]
|
||||
=+ ash=(sham q.q.u.gyd)
|
||||
?: =(`ash (~(get by peq.sat) ost))
|
||||
@ -743,11 +737,11 @@
|
||||
==
|
||||
(best %rust u.gyd)
|
||||
::
|
||||
%peer
|
||||
%peer
|
||||
?> ?=([@ *] t.t.pax)
|
||||
=+ you=(need (slaw %p i.t.t.pax))
|
||||
=^ gud +>.$ (mack q.hin)
|
||||
?^ gud
|
||||
?^ gud
|
||||
(give [%dumb ~])
|
||||
%= +>.$
|
||||
sup.sat (~(put by sup.sat) ost [you t.t.t.pax])
|
||||
@ -756,7 +750,7 @@
|
||||
::
|
||||
%poke
|
||||
=^ gud +>.$ (mack q.hin)
|
||||
?^ gud (give %rasp ~)
|
||||
?^ gud (give %mean leaf/"mack-fail" ~)
|
||||
+>.$
|
||||
::
|
||||
%pour
|
||||
@ -778,21 +772,21 @@
|
||||
pus.sat (~(del ju pus.sat) pax ost)
|
||||
==
|
||||
==
|
||||
::
|
||||
::
|
||||
%u :: user request
|
||||
%_ +>.$
|
||||
vey.sat
|
||||
vey.sat
|
||||
(~(put to vey.sat) [hen [%take t.pax hin]])
|
||||
==
|
||||
::
|
||||
%w :: autoboot
|
||||
?> ?=([%drug @ @ ~] t.pax)
|
||||
?> ?=([%drug @ @ ~] t.pax)
|
||||
=+ :* sin=((hard ,[%c %writ p=riot]) q.hin)
|
||||
our=(need (slaw %p i.t.t.pax))
|
||||
syd=(need ((sand %tas) i.t.t.t.pax))
|
||||
syd=(need ((sand %tas) i.t.t.t.pax))
|
||||
==
|
||||
=. ped.sat (~(del by ped.sat) [our syd])
|
||||
?~ p.+.sin
|
||||
?~ p.+.sin
|
||||
+>.$
|
||||
+>.$(vey.sat (~(put to vey.sat) hen %boot ~))
|
||||
==
|
||||
@ -815,7 +809,7 @@
|
||||
[%show (need (~(get by sup.sat) p.i.pex))]
|
||||
==
|
||||
::
|
||||
++ mort :: failed boot
|
||||
++ mort :: failed boot
|
||||
|= tan=(list tank)
|
||||
(give %crud %boot-lost tan)
|
||||
::
|
||||
@ -827,11 +821,11 @@
|
||||
++ quem :: queue action
|
||||
|= kon=knob :: content
|
||||
^+ +>
|
||||
=. +> ?. ?=(%nuke -.kon) +>
|
||||
=. +> ?. ?=(%nuke -.kon) +>
|
||||
?. &(?=(^ onz.sat) =(hen p.u.onz.sat)) +>
|
||||
%= +>
|
||||
onz.sat ~
|
||||
mow
|
||||
mow
|
||||
:_(mow [hen %pass (away q.u.onz.sat) %f [%exec our ~]])
|
||||
==
|
||||
+>.$(vey.sat (~(put to vey.sat) hen kon))
|
||||
@ -852,7 +846,7 @@
|
||||
|= [you=ship pax=path] :: subscription
|
||||
%_(+> vey.sat (~(put to vey.sat) hen %show you pax))
|
||||
::
|
||||
++ sumo :: standard gift
|
||||
++ sumo :: standard gift
|
||||
|= vig=vase
|
||||
^- gift
|
||||
[%meta vig]
|
||||
@ -874,7 +868,7 @@
|
||||
==
|
||||
::
|
||||
++ warm :: vase has arm
|
||||
|= cog=@tas
|
||||
|= cog=@tas
|
||||
^- ?
|
||||
?~ huv.sat |
|
||||
!=(~ q:(~(fino ut p.u.huv.sat) 0 %free cog))
|
||||
@ -937,7 +931,7 @@
|
||||
=+ goc=(cat 3 'poke-' p.q.kon)
|
||||
?:((warm goc) goc %poke)
|
||||
?. (warm cog)
|
||||
(give(qic.sat ~) %rasp ~)
|
||||
(give(qic.sat ~) %mean leaf/"poke-fail" ~)
|
||||
?> ?=(^ huv.sat)
|
||||
=+ sam=:(slop [[%atom %ud] ost] [[%atom %p] p.kon] q.q.kon)
|
||||
:: ~& [%mess-poke cog]
|
||||
@ -950,7 +944,7 @@
|
||||
?> ?=(^ huv.sat)
|
||||
=. peq.sat (~(del by peq.sat) ost)
|
||||
(yawl [%peer (scot %p p.kon) q.kon] u.huv.sat sam)
|
||||
?: (warm %peek)
|
||||
?: (warm %peek)
|
||||
=+ sam=!>([p.kon q.kon])
|
||||
?> ?=(^ huv.sat)
|
||||
(yawl [%peek (scot %p p.kon) q.kon] u.huv.sat sam)
|
||||
|
@ -9744,8 +9744,10 @@
|
||||
^- [p=(list move) q=vase]
|
||||
=+ ^= pru
|
||||
?~ pux
|
||||
~| [%swim-call-vane lal]
|
||||
%+ slur (slap rig [%cnzy %call])
|
||||
(slid [%& duc.vil hen] (slix hil))
|
||||
~| [%swim-take-vane lal]
|
||||
%+ slur (slap rig [%cnzy %take])
|
||||
;: slid
|
||||
[%& pah.vil u.pux]
|
||||
|
@ -5,8 +5,7 @@
|
||||
++ poke
|
||||
|= [ost=bone *]
|
||||
:_ +>(p.vat +(p.vat))
|
||||
:~ [ost %give %rasp ~ %json *json]
|
||||
[%c %pass]
|
||||
:~ [ost %give %nice ~]
|
||||
==
|
||||
::
|
||||
++ peek
|
||||
|
@ -16,7 +16,7 @@
|
||||
++ gift
|
||||
$% [%rush blitz]
|
||||
[%rust iron]
|
||||
[%rasp ~]
|
||||
[%nice ~]
|
||||
==
|
||||
++ mess :: message
|
||||
$% [%do p=@t] :: act
|
||||
@ -87,6 +87,7 @@
|
||||
%backlog
|
||||
=+ ya=(grab p.zig)
|
||||
:_ +>.$
|
||||
:- [ost give/nice//]
|
||||
%^ yend you (welp p.zig /mensajes)
|
||||
:* %give %rust %zongs
|
||||
?: ?=(%ud q.zig)
|
||||
@ -108,6 +109,7 @@
|
||||
(send (welp p.zig /amigos) %give %rush %user %out p.p (ident p.p))
|
||||
=. p.vat (~(put by p.vat) p.zig [p.ya (~(put by q.ya) you [& lat.hid])])
|
||||
:_ +>.$
|
||||
:- [ost give/nice//]
|
||||
?: (~(has by q.ya) you)
|
||||
outs
|
||||
%+ welp outs
|
||||
@ -116,7 +118,9 @@
|
||||
=+ zog=`zong`[%mess lat.hid you q.zig]
|
||||
=+ ya=(grab p.zig)
|
||||
=. p.vat (~(put by p.vat) p.zig [[zog p.ya] q.ya])
|
||||
[(send (welp p.zig /mensajes) %give %rush %zong zog) +>.$]
|
||||
:_ +>.$
|
||||
:- [ost give/nice//]
|
||||
(send (welp p.zig /mensajes) %give %rush %zong zog)
|
||||
==
|
||||
::
|
||||
++ send
|
||||
|
@ -219,10 +219,10 @@
|
||||
%= $
|
||||
duz t.duz
|
||||
+>
|
||||
%- show
|
||||
^- tank
|
||||
?- -.i.duz
|
||||
%mess (rend [q.i.duz (iden q.i.duz)] r.i.duz "")
|
||||
%mess
|
||||
?: =(who q.i.duz) +>
|
||||
(show (rend [q.i.duz (iden q.i.duz)] r.i.duz ""))
|
||||
== ==
|
||||
::
|
||||
++ shew |=(tax=(list tank) +>(giz [[%lo tax] giz])) :: print to screen
|
||||
|
113
main/lib/urb.js
Normal file
113
main/lib/urb.js
Normal file
@ -0,0 +1,113 @@
|
||||
window.urb = {
|
||||
ship: ship,
|
||||
port: port,
|
||||
auto: auto,
|
||||
oryx: oryx,
|
||||
user: user,
|
||||
appl: appl,
|
||||
seqn: 0,
|
||||
seqp: 1,
|
||||
seqs: 2,
|
||||
dely: 0,
|
||||
|
||||
req: function(method,url,data,json,cb) {
|
||||
var xhr = new XMLHttpRequest()
|
||||
xhr.open(method.toUpperCase(), url)
|
||||
if(json)
|
||||
xhr.setRequestHeader("content-type", "text/json")
|
||||
if(data)
|
||||
xhr.send(JSON.stringify({oryx: oryx, xyro: data}))
|
||||
else
|
||||
xhr.send({oryx: oryx})
|
||||
if(cb) {
|
||||
xhr.onload = function() {
|
||||
cb(null,{
|
||||
"status":this.status,
|
||||
"data":JSON.parse(this.responseText)
|
||||
})
|
||||
}
|
||||
xhr.onerror = function() {
|
||||
cb({
|
||||
"status":this.status,
|
||||
"data":this.responseText
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
subscribe: function(path,cb) {
|
||||
if(!cb)
|
||||
throw new Error("You must supply a callback to urb.subscribe.")
|
||||
|
||||
var method, perm, url, $this
|
||||
|
||||
method = "put"
|
||||
perm = "tis"
|
||||
url = [perm,this.user,this.appl,this.port]
|
||||
if(path) {
|
||||
url.push(this.seqs)
|
||||
url.push(path)
|
||||
}
|
||||
console.log(url)
|
||||
url = "/"+url.join("/")
|
||||
|
||||
|
||||
$this = this
|
||||
this.req(method,url,{},true,function(err,data) {
|
||||
cb.apply(this,arguments)
|
||||
if(!err) { $this.poll($this.seqs++,cb); }
|
||||
})
|
||||
},
|
||||
|
||||
send: function(data,cb) {
|
||||
if(!data) { data = {}; }
|
||||
if(!cb) { cb = function() {}; }
|
||||
|
||||
var method, perm, url, $this
|
||||
|
||||
method = "put"
|
||||
perm = "tim"
|
||||
url = [perm,this.user,this.appl,this.port,this.seqn]
|
||||
url = "/"+url.join("/")
|
||||
|
||||
this.seqn++
|
||||
|
||||
$this = this
|
||||
this.req(method,url,data,true,function(err,data) {
|
||||
if(err) { $this.seqn--; }
|
||||
cb.apply(this,arguments)
|
||||
})
|
||||
},
|
||||
|
||||
poll: function(stream,cb) {
|
||||
if(!stream)
|
||||
throw new Error("You must supply a stream to urb.poll.")
|
||||
if(!cb)
|
||||
throw new Error("You must supply a callback to urb.poll.")
|
||||
|
||||
var method, perm, url, $this
|
||||
|
||||
method = "get"
|
||||
perm = "gie"
|
||||
if(!stream) { return false; }
|
||||
url = [perm,this.user,this.appl,this.port,stream,this.seqp]
|
||||
url = "/"+url.join("/")
|
||||
console.log(url)
|
||||
|
||||
$this = this
|
||||
this.req(method,url,null,false,function(err,data) {
|
||||
if(cb.apply(this,arguments) === false) { return; }
|
||||
|
||||
if(err)
|
||||
$this.dely += 1000
|
||||
else {
|
||||
$this.dely = 0
|
||||
$this.seqp++
|
||||
}
|
||||
|
||||
setTimeout(function() {
|
||||
$this.poll(stream,cb)
|
||||
},$this.dely)
|
||||
})
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user