Merge branch 'master' into typedclay

Conflicts:
	urb/urbit.pill
	urb/zod/arvo/ford.hoon
	urb/zod/main/app/cat/core.hook
	urb/zod/main/app/ls/core.hook
	urb/zod/main/app/reload/core.hook
	urb/zod/main/app/shell/core.hook
	urb/zod/main/app/solid/core.hook
This commit is contained in:
Philip C Monk 2015-01-15 16:21:11 -05:00
commit 0e82a9a1f1
49 changed files with 2722 additions and 1147 deletions

View File

@ -322,7 +322,7 @@
0w2g.gLmg4.MtrHQ.A5VmH.WPk6G :: 150, ~ryg, Dan Haffey (fortuna)
0w0 :: 151, ~ryx, Tlon (gleba)
0w0 :: 152, ~fep, Tlon (gleba)
0w3q.4RDyP.CTcbc.ZX4Hj.BH6Hu :: 153, ~tyr, ~hobmed-hinrym (fidelis)
0w2j.T1u2s.BfXjV.ldOGR.aiZrQ :: 153, ~tyr, ~hobmed-hinrym (fidelis)
0w0 :: 154, ~tus, Tlon (gleba)
0w0 :: 155, ~tyc, Tlon (gleba)
0w0 :: 156, ~leg, Tlon (gleba)
@ -546,11 +546,6 @@
?~ dyv ~
[~ u.dyv ..kuch]
::
++ trox :: trox:lax:as:go
|= [now=@da] :: expire by date
^+ +>
+> :: XX
::
++ wasc :: wasc:lax:as:go
|= key=code :: hear foreign code
^+ +>
@ -1705,19 +1700,20 @@
?> ?=([@ @ *] t.q.q.bon)
:_ fox
=+ [cak=i.t.q.q.bon ven=i.t.t.q.q.bon]
:~ =+ neh=(claw p.p.bon)
?> ?=(^ neh)
=+ ton=[%waft p.bon r.bon]
:: ~& [%milk-waft [[ven `path`t.t.t.q.q.bon] t.neh]]
:- ?: =(%c ven)
?> =(%re cak)
[[%c `path`t.t.t.q.q.bon] hen]
?: =(%e ven)
?> |(=(%pr cak) =(%pc cak))
[[%e `path`t.t.t.q.q.bon] hen]
[[ven `path`t.t.t.q.q.bon] t.neh]
[%sick ton]
==
:_ ~
=+ neh=(claw p.p.bon)
?> ?=(^ neh)
?: ?=(%e ven)
?> |(=(%pr cak) =(%pc cak))
:_ [%sick %wart p.bon cak `path`t.t.t.q.q.bon r.bon]
[[%e `path`t.t.t.q.q.bon] hen]
=+ ton=[%waft p.bon r.bon]
:: ~& [%milk-waft [[ven `path`t.t.t.q.q.bon] t.neh]]
:_ [%sick ton]
?: =(%c ven)
?> =(%re cak)
[[%c `path`t.t.t.q.q.bon] hen]
[[ven `path`t.t.t.q.q.bon] t.neh]
?> ?=(%q i.q.q.bon)
?> ?=([@ *] t.q.q.bon)
?+ i.t.q.q.bon
@ -1759,7 +1755,7 @@
%+ turn paz
|= him=ship
:- hen
[%pass /ye %g %mess [him ye/~] p.p.bon [%txt !>(;;(,@t r.bon))]]
[%pass /ye %g %mess [him ye/~] p.p.bon [%txt !>(((hard ,@t) r.bon))]]
==
::
%mulk

View File

@ -91,7 +91,7 @@
++ term-in ::
$: pax=path ::
$= jof ::
$% [%line p=span] ::
$% [%line p=cord] ::
[%res p=span] ::
[%cmd p=char] ::
[%type p=?] ::
@ -374,7 +374,7 @@
==
::
%wake
?: (lte q.s.yar (sub now ~s15))
?: (lte (sub now ~s15) q.s.yar)
%_ +>.$
mos
:_ mos

View File

@ -1,5 +1,4 @@
!:
:: :: %eyre, http servant
!: :: %eyre, http servant
!? 164
::::
|= pit=vase
@ -133,7 +132,6 @@
== ::
++ dual ,[p=@ud q=(each ,[p=ship q=hole] ship)] :: request handle
++ dude ,[p=@tas q=@] :: client identity
++ loco ,[p=? q=(unit ,@tas) r=path] :: logical construct
++ pest :: request in progress
$| $? %new :: virgin
%way :: waiting
@ -564,7 +562,7 @@
?> ?=([~ @ ~] hot)
[[sec (rash i.u.hot thor:epur)] p.ryp q.ryp]
==
=. p.p.pul |(p.p.pul =([& /localhost] r.p.pul))
=. p.p.pul |(p.p.pul ?=(hoke r.p.pul))
(hell pul +.kyz [p.heq mah s.heq])
::
%thud :: cancel request
@ -650,12 +648,12 @@
++ haji :: send %pc login
|= [our=ship him=ship ses=hole]
^+ +>
+>.$(mow :_(mow [hen %pass ~ %a [%want [our him] [%r %pc ~] ses]]))
+>.$(mow :_(mow [hen %pass ~ %a [%want [our him] [%r %pc %e ~] ses]]))
::
++ hajj :: send %pr response
|= [our=ship him=ship tus=path har=httr]
^+ +>
+>.$(mow :_(mow [hen %pass ~ %a [%want [our him] [%r %pr tus] har]]))
+>.$(mow :_(mow [hen %pass ~ %a [%want [our him] [%r %pr %e tus] har]]))
::
++ hare :: receive request
|= [our=ship tus=path him=ship hor=*]
@ -868,14 +866,15 @@
[~ u=~(. ya [our ses] u.suf u.cuz)]
::
++ noon :: login page
|= [our=ship whu=(unit ship) rul=tape ruf=tape]
|= [our=ship ses=hole whu=(unit ship) rul=tape ruf=tape]
^- manx
=+ ^= sic ^- manx
;script:'''
var seal = {
who: goal,
url: burl,
pas: null
pas: null,
ses: sesh
}
var hist = []
var hind = 0
@ -909,12 +908,13 @@
}
if(seal.who !== host) {
var foreign = {oth: host, ses: session};
var all = $.extend({}, seal, foreign);
var all = $.extend({}, seal, {oth:host});
delete all.pas;
console.log('redirect')
window.location="http://"+seal.who+".urbit.org/gul"
+ $.params(all);
window.location= // "http://"+seal.who+".urbit.org/gul?"
"http://0:8445/gul?"
+ $.param(all);
return false;
}
@ -928,10 +928,14 @@
login = function() {
seal.pas = $input.val()
var oth = /[&?]oth=[^&]*/.exec(location.search)
if(oth && oth.length)
seal.oth = oth[0].slice(5)
output = $output.html()
console.log($output.html())
$output.html(output.replace('sorry. please try again.<br>',''))
$output.html(output.replace(
'sorry. please try again.<br>',''))
$.post(form, seal, function(data,xhr,status) {
console.log(data);
@ -986,6 +990,7 @@
; var goal = '{?~(whu ~ (trip (rsh 3 1 (scot %p u.whu))))}';
; var burl = '{rul}';
; var form = '{ruf}';
; var sesh = '{(trip ses)}';
==
=> .(+.sic (weld `marl`cof `marl`+.sic))
=+ jqu="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"
@ -1421,9 +1426,7 @@
++ foal :: url from query
|= [nam=@t yaq=(map ,@t ,@t)]
^- (unit purl)
=+ uru=(~(get by yaq) %url)
?~ uru ~
(rush u.uru auri:epur)
(biff (~(get by yaq) %url) epur)
::
++ folk :: seal from query
|= quy=quay
@ -1587,20 +1590,16 @@
^- (unit seam)
:+ ~
%red
:: :+ [& q.p.pul r.p.pul]
%+ earl our
:+ [p.p.pul q.p.pul r.p.pul]
:: :+ [p.p.pul q.p.pul r.p.pul]
:+ [| q.p.pul r.p.pul] :: XX https
[~ /gul]
:- [%url (crip (urle (earn (earl our pul))))]
:- [%url (crip (earn pul(p.p |)))]
?~ whu ~
[%who (rsh 3 1 (scot %p u.whu))]~
::
++ holy :: structured request
|= [pul=purl moh=moth]
^- (unit seam)
?: &(=(%get p.moh) ?=([~ [@ ~]] q.pul)) :: app shortcut
:: XX use credential to figure out gog/gig
$(q.pul [`%html [%gog i.q.q.pul ~]])
?~ q.q.pul ~
=* nep i.q.q.pul
=+ paw=t.q.q.pul
@ -1642,7 +1641,17 @@
::
!&(=(%c tri) !=(%o two))
=(3 (met 3 nep))
==
==
?: &(=(%get p.moh) ?=([~ [@ ~]] q.pul)) :: app shortcut
=- $(q.pul [`%html -])
=+ ato=(~(tap in (~(get ju aut.ced) %$)))
=+ att=`(list ship)`(murn ato |=(a=span (slaw %p a)))
?~ att [%geg i.q.q.pul ~]
?: (~(has in (sa att)) our)
[%gog i.q.q.pul ~]
:+ %gig
(rsh 3 1 (scot %p (snag 0 (sort att lth))))
/[i.q.q.pul]
~
=^ yun paw
?+ two ~
@ -1651,10 +1660,10 @@
[(slav %p (cat 3 '~' i.paw)) t.paw]
%o [our paw]
==
:: ?: &(=(%i two) =(~ aut.ced))
:: (holt ~ pul)
:: ?: &(=(%o two) !(~(has ju aut.ced) %$ (scot %p our)))
:: (holt [~ our] pul)
?: &(=(%i two) !(lash yun) !=(yun (shaf %fake ses)))
(holt [~ yun] pul)
?: &(=(%o two) !(lash our))
(holt [~ our] pul)
?+ one ~
%g
?+ tri ~
@ -1724,6 +1733,16 @@
u.pup(pez [%fin %raw cod *mess `*octs])
==
::
++ erle :: url localize
|= [his=ship pul=purl] ^- purl
=+ pod=(mo (turn (~(tap by dop)) |=([p=host q=ship] [q p])))
?: (~(has by pod) his)
pul(p [& ~ (~(got by pod) his)])
?: ?=(hoke r.p.pul)
~| %no-port
pul(q.p [~ ?+(his !! %~zod 8.443)]) :: XX
pul(p [& ~ [~ /org/urbit/(rsh 3 1 (scot %p his))]])
::
++ inch :: function built
|= [num=@ud mez=(each bead (list tank))]
^+ +>
@ -1765,8 +1784,12 @@
::
++ lass :: load secret
^- @ta
=+ pax=/(scot %p our)/code/(scot %da now)/(scot %p our)
%^ rsh 3 1
(scot %p (,@ (need (sky %a (scot %p our) %code (scot %da now) ~))))
(scot %p (,@ (need (sky %a pax))))
::
++ lash :: user is authorized
|=(a=ship (~(has ju aut.ced) %$ (scot %p a)))
::
++ step :: step in work
|- ^+ +
@ -1784,6 +1807,7 @@
++ wink :: advance request
|= [num=@ud pip=pimp]
^- [(unit pimp) _+>]
:: ~& wink-do/[?@(pez.pip pez.pip -.pez.pip) -.som.pip]
?- pez.pip
%way [[~ pip] +>.$]
%new
@ -1854,43 +1878,47 @@
+>.$(..ya (honk our num ses kas))
::
%lon
?^ pus.p.som.pip
?. =(lass u.pus.p.som.pip)
:_ +>.$
:- ~
%= pip
pez
[%fin %mid /text/json (tact (pojo (jobe [%ok [%b |]]~)))]
^- [(unit pimp) _+>.$]
?~ pus.p.som.pip
:_ +>.$
?: ?~ whu.p.som.pip |
(lash u.whu.p.som.pip)
[~ pip(som [%red pul.p.som.pip])]
?: wit.p.som.pip
[~ pip(pez [%who %$ (scot %p (need whu.p.som.pip))])]
=+ rul=(earn pul.p.som.pip)
=+ ruf=(earn (erle our pul.p.som.pip(q.q /pul, r ~)))
=+ sus=?~(foy.p.som.pip ses q.u.foy.p.som.pip)
=+ ham=(noon our sus whu.p.som.pip rul ruf)
[~ pip(pez [%fin %ham ham])]
?. =(lass u.pus.p.som.pip)
:_ +>.$
:- ~
%= pip
pez
[%fin %mid /text/json (tact (pojo (jobe [%ok [%b |]]~)))]
==
=. aut.ced (~(put ju aut.ced) %$ (scot %p (need whu.p.som.pip)))
?~ foy.p.som.pip
=+ ^= jon
%- jobe
:~ [%ok [%b &]]
[%next (jape (earn pul.p.som.pip))]
==
=. aut.ced (~(put ju aut.ced) %$ (scot %p (need whu.p.som.pip)))
?~ foy.p.som.pip
=+ ^= jon
%- jobe
:~ [%ok [%b &]]
[%next (jape (earn pul.p.som.pip))]
==
:_(+>.$ [~ pip(pez [%fin %mid /text/json (tact (pojo jon))])])
=. ..ya (haji our u.foy.p.som.pip)
=+ ^= lup ^- purl
:+ ^- hart
:+ & ~
[%& ~[%org %urbit (rsh 3 1 (scot %p p.u.foy.p.som.pip))]]
^- pork
[~ /gul]
^- quay
:~ [%who (rsh 3 1 (scot %p (need whu.p.som.pip)))]
[%url (crip (earn pul.p.som.pip))]
[%wit %yes]
==
=+ jon=(jobe ~[[%ok [%b &]] [%next (jape (earn lup))]])
:_(+>.$ [~ pip(pez [%fin %mid /text/json (tact (pojo jon))])])
:_ +>.$
?: wit.p.som.pip
[~ pip(pez [%who %$ (scot %p (need whu.p.som.pip))])]
=+ rul=(earn pul.p.som.pip)
=+ ruf=(earn (earl our pul.p.som.pip(q.q /pul, r ~)))
=+ ham=(noon our whu.p.som.pip rul ruf)
[~ pip(pez [%fin %ham ham])]
=. ..ya (haji our u.foy.p.som.pip)
=+ ^= lup ^- purl
%+ erle p.u.foy.p.som.pip
:+ `hart`p.pul.p.som.pip
^- pork
[~ /gul]
^- quay
:~ [%who (rsh 3 1 (scot %p (need whu.p.som.pip)))]
[%url (crip (earn pul.p.som.pip))]
[%wit %yes]
==
=+ jon=(jobe ~[[%ok [%b &]] [%next (jape (earn lup))]])
:_(+>.$ [~ pip(pez [%fin %mid /text/json (tact (pojo jon))])])
::
%red
:_ +>.$
@ -1899,7 +1927,7 @@
pez
:- %fin
:- %raw
:+ 301
:+ 307
[%location (crip (earn p.som.pip))]~
~
==
@ -2129,7 +2157,7 @@
|= [num=@ud hap=hasp pax=path]
^- [(unit pimp) _+>]
=. +>.$
%+ ~(rep by can.sub.siq) +>.$
%- ~(rep by can.sub.siq)
|= [p=[p=@ud q=stem] q=_+>.$]
?. =([hap pax] [hap.q.p pax.q.p]) q
=. q q(can.sub.siq (~(del by can.sub.siq:q) p.p))

View File

@ -37,9 +37,10 @@
[%dub p=term q=horn] :: /= apply face
[%fan p=(list horn)] :: /. list
[%for p=path q=horn] :: /, descend
[%hel p=horn] :: /% propogate heel
[%hub p=horn] :: /@ list by @ud
[%man p=(map span horn)] :: /* hetero map
[%nap p=horn] :: /% homo map
[%nap p=horn] :: /_ homo map
[%now p=horn] :: /& list by @da
[%saw p=twig q=horn] :: /; operate on
[%see p=beam q=horn] :: /: relative to
@ -116,6 +117,8 @@
== ::
++ calx :: concrete cache line
$% [%hood p=calm q=(pair beam cage) r=hood] :: compile
[%slit p=calm q=[p=type q=type] r=type] :: slam type
[%slim p=calm q=[p=type q=twig] r=(pair type nock)]:: mint
[%slap p=calm q=[p=vase q=twig] r=vase] :: compute
[%slam p=calm q=[p=vase q=vase] r=vase] :: compute
== ::
@ -133,6 +136,8 @@
%hood ?>(?=(%hood -.cax) r.cax)
%slap ?>(?=(%slap -.cax) r.cax)
%slam ?>(?=(%slam -.cax) r.cax)
%slim ?>(?=(%slim -.cax) r.cax)
%slit ?>(?=(%slit -.cax) r.cax)
==
::
++ calk :: cache lookup
@ -153,16 +158,6 @@
^- cafe ::
[(grom p.a p.b) (grum q.a q.b)] ::
:: ::
++ colt :: reduce to save
|= lex=axle ::
^- axle
%= lex
pol
%- ~(run by pol.lex)
|= bay=baby
bay(jav ~)
==
::
++ faun |=([a=cafe b=vase] (fine a `cage`noun/b)) :: vase to cage
++ feel |=([a=cafe b=cage] (fine a q.b)) :: cage to vase
++ fest |*([a=cafe b=*] (fine a [~ u=b])) :: bolt to unit
@ -193,7 +188,6 @@
::
++ za :: per event
=| $: $: $: our=ship :: computation owner
tea=wire :: event place
hen=duct :: event floor
== ::
$: now=@da :: event date
@ -226,6 +220,12 @@
==
~(exec zo [num `task`[hen u.kus 0 ~]])
::
++ apel :: stateless
|= [hen=duct kus=silk]
^- (unit gift)
=+ num=0 :: XX
~(exit zo [num `task`[hen kus 0 ~]])
::
++ axon :: take
|= [num=@ud tik=@ud sih=sign]
^+ +>
@ -425,10 +425,19 @@
(fine cof u.for dif)
==
::
++ exit :: stateless exec
^- (unit gift)
=+ bot=(make [~ jav.bay] kas)
:: =. ..exec (dash p.bot)
?- -.q.bot
%0 `[%made %& p.q.bot q.q.bot]
%2 `[%made %| p.q.bot]
%1 ~
==
::
++ exec :: execute app
^+ ..zo
?: !=(~ q.kig) ..zo
|- ^+ ..zo
=+ bot=(make [~ jav.bay] kas)
=. ..exec (dash p.bot)
?- -.q.bot
@ -552,9 +561,10 @@
(stag %dub ;~(pfix tis dub:read))
(stag %fan ;~(pfix dot fan:read))
(stag %for ;~(pfix com for:read))
(stag %hel ;~(pfix cen day:read))
(stag %hub ;~(pfix pat day:read))
(stag %man ;~(pfix tar man:read))
(stag %nap ;~(pfix cen day:read))
(stag %nap ;~(pfix cab day:read))
(stag %now ;~(pfix pam day:read))
(stag %saw ;~(pfix sem saw:read))
(stag %see ;~(pfix col see:read))
@ -698,6 +708,7 @@
++ lamp :: normalize version
|= [cof=cafe bem=beam]
^- (bolt beam)
?: ?=(%ud -.r.bem) (fine cof bem)
=+ von=(ska %cw (tope bem(s ~)))
?~ von [p=cof q=[%1 [%w bem ~] ~ ~]]
(fine cof bem(r [%ud ((hard ,@) +:(need u.von))]))
@ -849,18 +860,24 @@
|= [cof=cafe yed=vase]
^$(cof cof, for i.yaw, yaw t.yaw, vax yed)
::
++ mail :: cached mint
|= [cof=cafe sut=type gen=twig]
^- (bolt (pair type nock))
%+ (clef %slim) (fine cof sut gen)
|= [cof=cafe sut=type gen=twig]
=+ puz=(mule |.((~(mint ut sut) [%noun gen])))
?- -.puz
| (flaw cof p.puz)
& (fine cof p.puz)
==
::
++ maim :: slap
|= [cof=cafe vax=vase gen=twig]
^- (bolt vase)
%+ (clef %slap) (fine cof vax gen)
|= [cof=cafe vax=vase gen=twig]
=+ puz=(mule |.((~(mint ut p.vax) [%noun gen])))
?- -.puz
| (flaw cof p.puz)
& %+ (coup cof) (mock [q.vax q.p.puz] (mole ska))
|= val=*
`vase`[p.p.puz val]
==
%+ cope (mail cof p.vax gen)
|= [cof=cafe typ=type fol=nock]
%+ (coup cof) (mock [q.vax fol] (mole ska))
|=(val=* `vase`[typ val])
::
++ make :: reduce silk
|= [cof=cafe kas=silk]
@ -955,18 +972,24 @@
(fine cof `cage`[p.kas vax])
==
::
++ malt :: cached slit
|= [cof=cafe gat=type sam=type]
^- (bolt type)
%+ (clef %slit) (fine cof gat sam)
|= [cof=cafe gat=type sam=type]
=+ top=(mule |.((slit gat sam)))
?- -.top
| (flaw cof p.top)
& (fine cof p.top)
==
::
++ maul :: slam
|= [cof=cafe gat=vase sam=vase]
^- (bolt vase)
%+ (clef %slam) (fine cof gat sam)
|= [cof=cafe gat=vase sam=vase]
=+ top=(mule |.((slit p.gat p.sam)))
?- -.top
| (flaw cof p.top)
& %+ (coup cof) (mong [q.gat q.sam] (mole ska))
|= val=*
`vase`[p.top val]
==
%+ cope (malt cof p.gat p.sam)
|= [cof=cafe typ=type]
%+ (coup cof) (mong [q.gat q.sam] (mole ska))
|=(val=* `vase`[typ val])
::
++ meow :: assemble
|= [how=beam arg=heel]
@ -1111,6 +1134,7 @@
(slop i.tev $(tev t.tev))
::
%for $(hon q.hon, s.how (weld (flop p.hon) s.how))
%hel $(hon p.hon, arg /, s.how (weld arg s.how))
%hub (chad cof bax %ud p.hon)
%man
|- ^- (bolt vase)
@ -1145,7 +1169,7 @@
(flaw cof [%leaf "type error: {<p.hon>} {<q.hon>}"]~)
(fine cof [p.tug q.vax])
::
%toy (cope (make cof %bake p.hon how arg) feel)
%toy (cope (make cof %boil p.hon how ~) feel)
==
::
++ head :: consume structures
@ -1297,12 +1321,14 @@
exec(q.kig (~(del by q.kig) tik))
--
--
::
--
. ==
=| axle
=* lex -
|= [now=@da eny=@ ski=sled] :: activate
^? :: opaque core
~% %ford-d +>+>+>+>+>+> ~
|% ::
++ call :: request
|= [hen=duct hic=(hypo (hobo kiss))]
@ -1317,7 +1343,7 @@
=+ buy=(~(get by pol.lex) our)
?~(buy *baby u.buy)
=^ mos bay
abet:(~(apex za [[our ~ hen] [now eny ska] ~] bay) q.q.hic)
abet:(~(apex za [[our hen] [now eny ska] ~] bay) q.q.hic)
[mos ..^$(pol (~(put by pol) our bay))]
::
++ doze
@ -1345,7 +1371,7 @@
++ scry
|= [fur=(unit (set monk)) ren=@tas who=ship syd=desk lot=coin tyl=path]
^- (unit (unit (pair mark ,*)))
~
[~ ~]
::
++ stay :: save w/o cache
`axle`+>-.$(pol (~(run by pol) |=(a=baby [tad.a dym.a ~])))
@ -1359,8 +1385,8 @@
num=(need (slaw %ud i.t.tea))
tik=(need (slaw %ud i.t.t.tea))
==
=+ bay=(need (~(get by pol.lex) our))
=+ bay=(~(got by pol.lex) our)
=^ mos bay
abet:(~(axon za [[our tea hen] [now eny ska] ~] bay) num tik q.hin)
abet:(~(axon za [[our hen] [now eny ska] ~] bay) num tik q.hin)
[mos ..^$(pol (~(put by pol) our bay))]
--

View File

@ -71,7 +71,6 @@
$: @tas :: to any
$% [%meta p=vase] ::
== == == ::
++ rapt |*(a=$+(* *) (qual path path ,@da a)) :: versioned result
++ rave :: see %clay
$% [& p=mood] :: single request
[| p=moat] :: change range
@ -158,16 +157,6 @@
++ toil (pair duct knob) :: work in progress
-- ::::::::::::::::::::::::::::::::::::::::::::::::::::::
|% :::::::::::::::::::::::::::::::::::::::::::::::::::::: functions
++ byby :: double bind
|* [a=(unit (unit)) b=$+(* *)]
?~ a ~
?~ u.a [~ u=~]
[~ u=[~ u=(b u.u.a)]]
:: ::
++ colt :: reduce to save
|= all=axle ::
all
::
++ read :: read permission
|= law=(unit cuff)
^- (unit (set monk))
@ -202,23 +191,12 @@
:- ?~(p.u.a ~ ?~(p.u.b ~ `(grom u.p.u.b u.p.u.a)))
(grom q.u.b q.u.a)
::
++ lamp
|= con=(unit coin)
^- (unit path)
?: ?=([~ %$ %tas @] con)
(some [q.p.u.con]~)
?. ?=([~ %many *] con) ~
%- zl:jo
%+ turn p.u.con
|= tem=coin
?.(?=([%$ %ta @] tem) ~ (some q.p.tem))
::
++ lump :: position
|= pax=path
^- [p=hapt q=path]
?> ?=([@ @ *] pax)
:- :- (slav %p i.pax)
(need (lamp (slay i.t.pax)))
(need (pick i.t.pax))
t.t.pax
--
. == :: end preface
@ -574,10 +552,7 @@
::
++ away :: application path
|= pax=path ^- path
=+ ?: &(?=([@tas ~] imp) ((sane %tas) i.imp))
imc=[%$ %tas i.imp]
imc=[%many (turn imp |=(a=span [%$ %ta a]))]
[%a (scot %p our) ~(rent co imc) pax]
[%a (scot %p our) ?~(imp %$ (pack imp)) pax]
::
++ bear :: write backward
|= hen=duct
@ -1092,7 +1067,7 @@
%boot
=. orm.sat `now
%+ ford /s/park
:+ %dude leaf/"booting"
:: :+ %dude leaf/"booting"
^- silk
:- home
?~ huv.sat nile
@ -1151,17 +1126,22 @@
(yawl [%pull ~] leaf/"pulling" u.huv.sat [[%atom %ud] ost])
::
%mess
=+ ^- [hyp=? cog=term]
=- ?^(- - ?:((warm %pock) [& %pock] [| %poke]))
=+ ^- cog=term
=- |- ?~ goz %poke
?: (warm i.goz) i.goz
$(goz t.goz)
^- goz=(list term)
?: =(%$ p.q.kon)
~
=+ guc=(cat 3 'pock-' p.q.kon)
?: (warm guc)
[& guc]
=+ goc=(cat 3 'poke-' p.q.kon)
?: (warm goc)
[| goc]
~
/pock
=+ ^= goc
|= [a=term b=(list term)]
[(cat 3 'pock-' a) (cat 3 'poke-' a) b]
=+ ofs=(met 3 app.sat)
?. .= (cat 3 app.sat '-') :: XX temporary, until /=main=/bin
(end 3 +(ofs) p.q.kon)
(goc p.q.kon /pock)
:(goc p.q.kon (rsh 3 ofs p.q.kon) /pock)
=+ hyp=?=(%pock (end 3 4 cog))
?. (warm cog)
(give(qic.sat ~) %mean ~ %poke-find-fail ~)
?> ?=(^ huv.sat)

View File

@ -25,6 +25,7 @@
~
|% ::
++ abel typo :: original sin: type
++ ache |*([a=$+(* *) b=$+(* *)] $%([| p=b] [& p=a])) :: each, b default
++ axis ,@ :: tree address
++ also ,[p=term q=wing r=type] :: alias
++ base ?([%atom p=odor] %noun %cell %bean %null) :: axils, @ * ^ ? ~
@ -62,9 +63,6 @@
++ cord ,@t :: text atom (UTF-8)
++ date ,[[a=? y=@ud] m=@ud t=tarp] :: parsed date
++ dime ,[p=@ta q=@] ::
++ dram $% [| p=(map ,@tas dram)] :: simple unix dir
[& p=@ud q=@] ::
== ::
++ each |*([a=$+(* *) b=$+(* *)] $%([& p=a] [| p=b])) :: either a or b
++ edge ,[p=hair q=(unit ,[p=* q=nail])] :: parsing output
++ foot $% [%ash p=twig] :: dry arm, geometric
@ -274,7 +272,7 @@
[%smdt p=twig q=tusk] ::
[%smdq p=(list beer)] :: assemble string
[%smsg p=twig q=tusk] :: gonads
[%smsm p=twig q=twig] :: make sure q is a p
[%smsm p=tile q=twig] :: make sure q is a p
:: :::::: compositions
[%tsbr p=tile q=twig] :: push bunt: =+(_p q)
[%tscl p=tram q=twig] :: p changes, then q
@ -416,7 +414,11 @@
[%unit p=term q=wine] ::
== ::
++ wonk |*(veq=edge ?~(q.veq !! p.u.q.veq)) ::
:: ::
++ worm :: compiler cache
$: nes=(set ,^) :: ++nest
pay=(map (pair type twig) type) :: ++play
mit=(map (pair type twig) (pair type nock)) :: ++mint
== ::
:: ::
++ map |* [a=_,* b=_,*] :: associative tree
$|(~ [n=[p=a q=b] l=(map a b) r=(map a b)]) ::
@ -1383,9 +1385,6 @@
:: black magic values
++ vl
|%
++ uzer |= [b=@u p=@u]
(szer b p %.y)
++ szer |= [b=@u p=@u s=?]
[s=s e=`@s`(dec (^mul b 2)) a=(lia p 0b1)]
@ -1911,11 +1910,11 @@
[n.a l.a c]
[n.c [n.a l.a l.c] r.c]
::
+- rep :: replace by tile
|* [b=* c=_,*]
+- rep :: replace by product
|* b=_|=([* *] +<+)
|-
?~ a b
$(a r.a, b $(a l.a, b (c n.a b)))
?~ a +<+.b
$(a r.a, +<+.b $(a l.a, +<+.b (b n.a +<+.b)))
::
+- tap :: list tiles a set
~/ %tap
@ -2127,10 +2126,10 @@
[n.d [n.a l.a l.d] r.d]
::
+- rep :: replace by product
|* [b=* c=_,*]
|* b=_|=([* *] +<+)
|-
?~ a b
$(a r.a, b $(a l.a, b (c n.a b)))
?~ a +<+.b
$(a r.a, +<+.b $(a l.a, +<+.b (b n.a +<+.b)))
::
+- rib :: transform + product
|* [b=* c=_,*]
@ -2707,9 +2706,9 @@
::
++ plus |*(fel=_rule ;~(plug fel (star fel)))
++ slug
|* [rud=* raq=_|*([a=* b=*] [a b])]
|* raq=_|*([a=* b=*] [a b])
|* [bus=_rule fel=_rule]
;~((comp raq) fel (stir rud raq ;~(pfix bus fel)))
;~((comp raq) fel (stir +<+.raq raq ;~(pfix bus fel)))
::
++ star :: 0 or more times
|* fel=_rule
@ -3031,16 +3030,20 @@
::
++ wick :: span format
|= a=@
^- @ta
^- (unit ,@ta)
=+ b=(rip 3 a)
%+ rap 3
|- ^- tape
?~ b
~
?: =('~' i.b)
?~ t.b !!
[?:(=('~' i.t.b) '~' ?>(=('-' i.t.b) '_')) $(b t.t.b)]
[i.b $(b t.b)]
=- ?^(b ~ (some (rap 3 (flop c))))
=| c=tape
|- ^- [b=tape c=tape]
?~ b [~ c]
?. =('~' i.b)
$(b t.b, c [i.b c])
?~ t.b [b ~]
?- i.t.b
%'~' $(b t.t.b, c ['~' c])
%'-' $(b t.t.b, c ['_' c])
@ [b ~]
==
::
++ woad :: cord format
|= a=@ta
@ -3094,7 +3097,7 @@
:- '~'
=+ e=(met 2 c)
|- ^- tape
?: =(0 c)
?: =(0 e)
['.' d]
=. e (dec e)
=+ f=(rsh 2 e c)
@ -3153,14 +3156,14 @@
%rose
?: fit
(rig ram)
=+ ^= gyl
=. lug
|- ^- wall
?~ q.tac
?:(=(%$ r.p.tac) lug (rig r.p.tac))
^$(tac i.q.tac, lug $(q.tac t.q.tac), tab din)
?: =(%$ q.p.tac)
gyl
(wig(lug gyl) q.p.tac)
lug
(wig q.p.tac)
==
::
++ din (mod (add 2 tab) (mul 2 (div edg 3)))
@ -3313,7 +3316,7 @@
=> ^+(. .(rex ?~(f.yug rex ['.' (s-co f.yug)])))
:- '~'
?: &(=(0 d.yug) =(0 m.yug) =(0 h.yug) =(0 s.yug))
['.' 's' '0' rex]
['s' '0' rex]
=> ^+(. ?:(=(0 s.yug) . .(rex ['.' 's' (a-co s.yug)])))
=> ^+(. ?:(=(0 m.yug) . .(rex ['.' 'm' (a-co m.yug)])))
=> ^+(. ?:(=(0 h.yug) . .(rex ['.' 'h' (a-co h.yug)])))
@ -3397,7 +3400,6 @@
%t
?: =('a' hay)
?: =('s' (cut 3 [2 1] p.p.lot))
(weld (rip 3 q.p.lot) rex)
['~' '.' (weld (rip 3 q.p.lot) rex)]
['~' '~' (weld (rip 3 (wood q.p.lot)) rex)]
@ -3562,7 +3564,7 @@
:- '~' ;~(pfix sig ;~(pose twid (easy [~ %n 0])))
==
++ nusk
(sear |=(a=@ta (rush (wick a) nuck)) urt:ab)
:(sear |=(a=@ta (rush a nuck)) wick urt:ab)
++ perd
;~ pose
(stag ~ zust)
@ -4195,6 +4197,77 @@
df4d.225e.2d56.7fd6.1395.a3f8.c582
(cut 3 [a 1] b)
--
::
++ ob
|%
++ feen :: conceal structure v2
|= pyn=@ ^- @
?: &((gte pyn 0x1.0000) (lte pyn 0xffff.ffff))
(add 0x1.0000 (fice (sub pyn 0x1.0000)))
?: &((gte pyn 0x1.0000.0000) (lte pyn 0xffff.ffff.ffff.ffff))
=+ lo=(dis pyn 0xffff.ffff)
=+ hi=(dis pyn 0xffff.ffff.0000.0000)
%+ con hi
(add 0x1.0000 (fice (sub lo 0x1.0000)))
pyn
::
++ fend :: restore structure v2
|= cry=@ ^- @
?: &((gte cry 0x1.0000) (lte cry 0xffff.ffff))
(add 0x1.0000 (teil (sub cry 0x1.0000)))
?: &((gte cry 0x1.0000.0000) (lte cry 0xffff.ffff.ffff.ffff))
=+ lo=(dis cry 0xffff.ffff)
=+ hi=(dis cry 0xffff.ffff.0000.0000)
%+ con hi
(add 0x1.0000 (teil (sub lo 0x1.0000)))
cry
::
++ fice :: adapted from
|= nor=@ :: black and rogaway
^- @ :: "ciphers with
=+ ^= sel :: arbitrary finite
%+ rynd 2 :: domains", 2002
%+ rynd 1
%+ rynd 0
[(mod nor 65.535) (div nor 65.535)]
(add (mul 65.535 -.sel) +.sel)
::
++ teil :: reverse ++fice
|= vip=@
^- @
=+ ^= sel
%+ rund 0
%+ rund 1
%+ rund 2
[(mod vip 65.535) (div vip 65.535)]
(add (mul 65.535 -.sel) +.sel)
::
++ rynd :: feistel round
|= [n=@ l=@ r=@]
^- [@ @]
:- r
?~ (mod n 2)
(~(sum fo 65.535) l (en:aesc (snag n raku) r))
(~(sum fo 65.536) l (en:aesc (snag n raku) r))
::
++ rund :: reverse round
|= [n=@ l=@ r=@]
^- [@ @]
:- r
?~ (mod n 2)
(~(dif fo 65.535) l (en:aesc (snag n raku) r))
(~(dif fo 65.536) l (en:aesc (snag n raku) r))
::
++ raku
^- (list ,@ux)
:~ 0x15f6.25e3.083a.eb3e.7a55.d4db.fb99.32a3.
43af.2750.219e.8a24.e5f8.fac3.6c36.f968
0xf2ff.24fe.54d0.1abd.4b2a.d8aa.4402.8e88.
e82f.19ec.948d.b1bb.ed2e.f791.83a3.8133
0xa3d8.6a7b.400e.9e91.187d.91a7.6942.f34a.
6f5f.ab8e.88b9.c089.b2dc.95a6.aed5.e3a4
==
--
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: section 2eO, virtualization ::
::
@ -4451,22 +4524,6 @@
$(hol t.hol, +> (merg (flop `(list ,@ud)`?~(guy ~ u.guy))))
--
::
++ locz :: trivial algorithm
|= [hel=tape hev=tape]
^- tape
=+ [leh=(lent hel) veh=(lent hev)]
=- (flop q.yun)
^= yun
|- ^- [p=@ud q=tape]
~+
?: |(=(0 leh) =(0 veh)) [0 ~]
=+ [dis=(snag (dec leh) hel) dat=(snag (dec veh) hev)]
?: =(dis dat)
=+ say=$(leh (dec leh), veh (dec veh))
[+(p.say) [dis q.say]]
=+ [lef=$(leh (dec leh)) rig=$(veh (dec veh))]
?:((gth p.lef p.rig) lef rig)
::
++ lore :: atom to line list
~/ %lore
|= lub=@
@ -6017,16 +6074,12 @@
++ sell :: tank pretty-print
|= vax=vase ^- tank
~| %sell
(dish:ut ~(dole ut p.vax) q.vax)
(~(deal ut p.vax) q.vax)
::
++ pave :: tape pretty-print
|= vax=vase ^- tape
~(ram re (sell vax))
::
++ loot :: cord pretty-print
|= vax=vase ^- @ta
(rap 3 (pave vax))
::
++ slam :: slam a gate
|= [gat=vase sam=vase] ^- vase
=+ :- ^= typ ^- type
@ -6099,19 +6152,74 @@
|= [axe=@ vax=vase] ^- vase
[(~(peek ut p.vax) %free axe) .*(q.vax [0 axe])]
::
++ slum
|= [vax=vase wad=(map term vase)] ^- vase
?- wad
~ vax
[* ~ ~] [[%cell p.vax [%face p.n.wad p.q.n.wad]] [q.vax q.q.n.wad]]
[* ~ *] $(wad [n.wad ~ ~], vax $(wad r.wad))
[* * ~] $(wad [n.wad ~ ~], vax $(wad l.wad))
[* * *] $(wad [n.wad ~ r.wad], vax $(wad l.wad))
==
::
++ wash :: render tank at width
|= [[tab=@ edg=@] tac=tank] ^- wall
(~(win re tac) tab edg)
::
++ wa :: cached compile
!:
|_ worm
++ nell |=(ref=type (nest [%cell %noun %noun] ref)) :: nest in cell
++ nest :: nest:ut
|= [sut=type ref=type]
^- [? worm]
?: (~(has in nes) [sut ref]) [& +>+<]
?. (~(nest ut sut) | ref) [| +>+<]
[& +>+<(nes (~(put in nes) [sut ref]))]
::
++ nets :: typeless nest
|= [sut=type ref=*]
^- [? worm]
?: (~(has in nes) [sut ref]) [& +>+<]
=+ gat=|=([a=type b=type] (~(nest ut a) | b))
?. (,? .*(gat(+< [sut ref]) -.gat))
[| +>+<.$]
[& +>+<.$(nes (~(put in nes) [sut ref]))]
::
++ play :: play:ut
|= [sut=type gen=twig]
^- [type worm]
=+ old=(~(get by pay) [sut gen])
?^ old [u.old +>+<.$]
=+ new=(~(play ut sut) gen)
[new +>+<.$(pay (~(put by pay) [sut gen] new))]
::
++ mint :: mint:ut to noun
|= [sut=type gen=twig]
^- [(pair type nock) worm]
=+ old=(~(get by mit) [sut gen])
?^ old [u.old +>+<.$]
=+ new=(~(mint ut sut) %noun gen)
[new +>+<.$(mit (~(put by mit) [sut gen] new))]
::
++ slap :: ++slap, cached
|= [vax=vase gen=twig]
^- [vase worm]
=^ gun +>+< (mint p.vax gen)
[[p.gun .*(q.vax q.gun)] +>+<.$]
::
++ slot :: ++slot, cached
|= [axe=@ vax=vase]
^- [vase worm]
=^ gun +>+< (mint p.vax [%$ axe])
[[p.gun .*(q.vax [0 axe])] +>+<.$]
::
++ spec :: specialize vase
|= vax=vase
^- [vase worm]
=+ ^= gen ^- twig
?@ q.vax [%wtts [%axil [%atom %$]] [%$ 1]~]
?@ -.q.vax [%wtts [%leaf %tas -.q.vax] [%$ 2]~]
[%wtts [%axil %cell] [%$ 1]~]
=^ typ +>+<.$ (play p.vax [%wtgr gen [%$ 1]])
[[typ q.vax] +>+<.$]
::
++ spot :: slot and spec
|= [axe=@ vax=vase]
^- [vase worm]
=^ xav +>+< (slot axe vax)
(spec xav)
--
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: section 2fB, macro expansion ::
::
@ -6459,7 +6567,11 @@
r.gen
::
[%sgts *] [%sggr [%germ p.gen] q.gen]
[%sgwt *] [%tsgl s.gen %wtdt q.gen [~ 1] %sgpm p.gen r.gen [~ 1]]
[%sgwt *]
:+ %tsls [%wtdt q.gen [%bczp %null] [[%bczp %null] r.gen]]
:^ %wtsg [~ 2]~
[%tsgr [~ 3] s.gen]
[%sgpm p.gen [~ 5] [%tsgr [~ 3] s.gen]]
[%smcl *]
?- q.gen
~ [%zpzp ~]
@ -6550,7 +6662,8 @@
::
[%smsm *] :: ;;
:+ %tsgr [%ktts %v ~ 1] :: => v=.
:+ %tsls [%ktts %a [%tsgr [%cnzy %v] p.gen]] :: =+ a==>(v {p.gen})
:+ %tsls :+ %ktts %a :: =+ ^= a
[%tsgr [%cnzy %v] [%bccm p.gen]] :: =>(v ,{p.gen})
:+ %tsls [%ktts %b [%tsgr [%cnzy %v] q.gen]] :: =+ b==>(v {q.gen})
:+ %tsls :: =+ c=(a b)
[%ktts %c [%cnhp [%cnzy %a] [%cnzy %b] ~]] ::
@ -6881,7 +6994,16 @@
==
::
++ dank |=(pax=path ^-(tank (dish [~ %path] pax)))
++ dart |=(pax=path ^-(tape ~(ram re (dank pax))))
++ dash
|= [mil=tape lim=char] ^- tape
:- lim
|- ^- tape
?~ mil [lim ~]
?: =(lim i.mil) ['\\' i.mil $(mil t.mil)]
?: =('\\' i.mil) ['\\' i.mil $(mil t.mil)]
?: (lte ' ' i.mil) [i.mil $(mil t.mil)]
['\\' ~(x ne (rsh 2 1 i.mil)) ~(x ne (end 2 1 i.mil)) $(mil t.mil)]
::
++ deal |=(lum=* (dish dole lum))
++ dial
|= ham=calf
@ -6991,7 +7113,7 @@
[(need ^$(q.ham %yarn, lum -.lum)) $(lum +.lum)]
::
%yarn
[~ %leaf '"' (weld (tape lum) `tape`['"' ~])]
[~ %leaf (dash (tape lum) '"')]
::
%void
~
@ -7001,10 +7123,11 @@
~
:+ ~
%leaf
?: =(%$ p.q.ham) ~(rend co [~ %ud lum])
?: =(%t p.q.ham) ['\'' (weld (rip 3 lum) `tape`['\'' ~])]
?: =(%tas p.q.ham) ['%' ?.(=(0 lum) (rip 3 lum) ['$' ~])]
~(rend co [~ p.q.ham lum])
?+ p.q.ham ~(rend co [~ p.q.ham lum])
%$ ~(rend co [~ %ud lum])
%t (dash (rip 3 lum) '\'')
%tas ['%' ?.(=(0 lum) (rip 3 lum) ['$' ~])]
==
::
[%core *]
:: XX needs rethinking for core metal
@ -7074,6 +7197,8 @@
[%pear *]
?. =(lum q.q.ham)
~
?: ?=([%tas ~] +.q.ham)
[~ %leaf '%' '$' ~]
=+ fox=~(rend co [~ p.q.ham q.q.ham])
[~ %leaf ?:(=(['~' ~] fox) fox ['%' fox])]
::
@ -8822,7 +8947,7 @@
=+ rev=(plex b)
?~ rev ~
%- some
:+ %smsm ~(clam al a)
:+ %smsm a
[%dtkt %dtzz %$ %cx u.rev]
;~(plug hill rood)
==
@ -9070,7 +9195,7 @@
:~ [':' (rune col %smcl expi)]
['.' (rune dot %smdt expi)]
['~' (rune sig %smsg expi)]
[';' (rune sem %smsm expb)]
[';' (rune sem %smsm expo)]
==
==
:- '='
@ -9231,7 +9356,7 @@
++ expq |.(;~(gunk rope loaf loaf)) :: wing and two twigs
++ expr |.(;~(gunk loaf wisp)) :: twig and core tail
++ exps |.((butt hank)) :: closed gapped twigs
++ expt |.((butt ;~(gunk loaf race))) :: twig, [tile twig]s
:: expt
++ expu |.(;~(gunk lobe wisp)) :: tile, core tail
++ expv |.(lobe) :: tile
++ expw |.(;~(gunk lobe teak)) :: tile and tiki
@ -9239,8 +9364,6 @@
++ expy |.((butt ;~(gunk teak loaf race))) :: tiki twig [tile twig]s
++ expz |.(loaf(bug &)) :: twig with tracing
:: Hint syntaces (nock 10)
++ hina |. :: unused
;~(gunk (ifix [sel ser] ;~(gunk dem dem)) loaf)
++ hinb |.(;~(gunk bont loaf)) :: hint and twig
++ hinc |. :: optional =en, twig
;~(pose ;~(gunk bony loaf) ;~(plug (easy ~) loaf))
@ -9336,15 +9459,13 @@
++ rope :: wing form
%+ knee *wing
|. ~+
%+ (slug `wing`~ |=([a=wing b=wing] (weld a b)))
%+ (slug |=([a=limb b=wing] [a b]))
dot
;~ pose
%+ cook
|=([a=(list) b=term] [?~(a b [%| (lent a) b]) ~])
|=([a=(list) b=term] ?~(a b [%| (lent a) b]))
;~(plug (star ket) ;~(pose sym (cold %$ buc)))
::
%+ cook
|=(a=limb [a ~])
%+ cook
|=(a=axis [%& a])
;~ pose
@ -9467,6 +9588,8 @@
glu=@ud :: samples in glue
mal=@ud :: samples in alloc
far=@ud :: samples in frag
coy=@ud :: samples in copy
euq=@ud :: samples in equal
== ::
::
++ hump
@ -9510,10 +9633,12 @@
%glu mon(glu +(glu.mon))
%mal mon(mal +(mal.mon))
%far mon(far +(far.mon))
%coy mon(coy +(coy.mon))
%euq mon(euq +(euq.mon))
==
++ pi-moth :: count sample
|= mon=moan ^- @ud
:(add fun.mon noc.mon glu.mon mal.mon far.mon)
:(add fun.mon noc.mon glu.mon mal.mon far.mon coy.mon euq.mon)
::
++ pi-mumm :: print sample
|= mon=moan ^- tape
@ -9538,6 +9663,14 @@
^- tape
?: =(0 far.mon) ~
(welp (scow %ud (div (mul 100 far.mon) tot)) "f ")
::
^- tape
?: =(0 coy.mon) ~
(welp (scow %ud (div (mul 100 coy.mon) tot)) "y ")
::
^- tape
?: =(0 euq.mon) ~
(welp (scow %ud (div (mul 100 euq.mon) tot)) "e ")
==
::
++ pi-tell :: produce dump
@ -9613,7 +9746,6 @@
== ::
++ curd ,[p=@tas q=*] :: typeless card
++ duct (list wire) :: causal history
++ herd (hypo curd) :: typed card
++ hide :: standard app state
$: $: our=ship :: owner/operator
app=term :: app identity
@ -9626,7 +9758,6 @@
eny=@uvI :: entropy
lat=@da :: date of last tick
== == ::
++ hilt ?(0 1 2) :: lead iron gold
++ hypo |*(a=$+(* *) (pair type a)) :: type associated
++ hobo |* a=$+(* *) :: kiss wrapper
$? $% [%soft p=*] ::
@ -9664,7 +9795,7 @@
++ sled $+ [(unit (set monk)) term beam] :: namespace function
(unit (unit cage)) ::
++ slut $+(* (unit (unit))) :: old namespace
++ vile :: reflexive constants
++ vile :: reflexive constants
$: typ=type :: -:!>(*type)
duc=type :: -:!>(*duct)
pah=type :: -:!>(*path)
@ -9699,21 +9830,21 @@
:: section 3bE, Arvo core ::
::
++ vent :: vane core
|= [lal=@tas vil=vile bud=vase ves=vase]
|= [lal=@tas vil=vile bud=vase sew=(pair worm vase)]
~% %vent +>+ ~
|%
++ ruck :: update vase
|= [pax=path txt=@ta]
^+ +>
=+ arg=[~2000.1.1 0 =>(~ |+(* ~))]
=+ rig=(slym ves arg)
=+ rig=(slym q.sew arg)
=+ rev=(slym (slap bud (rain pax txt)) bud)
=+ syg=(slym rev arg)
+>.$(ves (slam (slap syg [%cnzy %load]) (slap rig [%cnzy %stay])))
+>.$(q.sew (slam (slap syg [%cnzy %load]) (slap rig [%cnzy %stay])))
::
++ wink :: deploy
|= [now=@da eny=@ ski=sled]
=+ rig=(slym ves +<) :: activate vane
=+ rig=(slym q.sew +<) :: activate vane
~% %wink +>+> ~
|%
++ doze
@ -9721,14 +9852,6 @@
^- (unit ,@da)
((hard (unit ,@da)) q:(slym (slap rig [%cnzy %doze]) +<))
::
++ sike :: check metatype
~/ %sike
|= [sub=type ref=*]
^- ?
:: ?: =(~ ~) &
=+ gat=|=([a=type b=type] (~(nest ut a) | b))
(,? .*(gat(+< [sub ref]) -.gat))
::
++ slid
|= [hed=mill tal=mill]
^- mill
@ -9744,56 +9867,74 @@
| [%| [%cell typ.vil p.p.hil] p.hil]
==
::
++ slur
++ slur :: call gate on
|= [gat=vase hil=mill]
^- (unit vase)
^- (unit (pair vase worm))
=+ sam=(slot 6 gat)
?. ?- -.hil
& (souk p.sam p.p.hil)
| (sike p.sam p.p.hil)
== ~
`(slym gat +>.hil)
=+ ^= hig
?- -.hil
& (~(nest wa p.sew) p.sam p.p.hil)
| (~(nets wa p.sew) p.sam p.p.hil)
==
?.(-.hig ~ `[(slym gat +>.hil) +.hig])
::
++ souk :: check type
~/ %souk
|= [sub=type ref=type]
:: ?: =(~ ~) &
(~(nest ut sub) | ref)
++ slur-a ~/(%slur-a |=([gat=vase hil=mill] (slur gat hil)))
++ slur-b ~/(%slur-b |=([gat=vase hil=mill] (slur gat hil)))
++ slur-c ~/(%slur-c |=([gat=vase hil=mill] (slur gat hil)))
++ slur-d ~/(%slur-d |=([gat=vase hil=mill] (slur gat hil)))
++ slur-e ~/(%slur-e |=([gat=vase hil=mill] (slur gat hil)))
++ slur-f ~/(%slur-f |=([gat=vase hil=mill] (slur gat hil)))
++ slur-g ~/(%slur-g |=([gat=vase hil=mill] (slur gat hil)))
++ slur-z ~/(%slur-z |=([gat=vase hil=mill] (slur gat hil)))
::
++ sunk :: type is cell
|= ref=type
:: ?: =(~ ~) &
(souk [%cell %noun %noun] ref)
++ slur-pro :: profiling slur
~/ %slur-pro
|= [lal=@tas gat=vase hil=mill]
?+ lal (slur-z gat hil)
%a (slur-a gat hil)
%b (slur-b gat hil)
%c (slur-c gat hil)
%d (slur-d gat hil)
%e (slur-e gat hil)
%f (slur-f gat hil)
%g (slur-g gat hil)
==
::
++ song :: reduce metacard
~/ %song ::
|= mex=vase :: mex: vase of card
^- (unit mill) ::
?. (sunk p.mex) ~ :: a card is a cell
?. ?=(%meta -.q.mex) `[%& mex] :: ordinary card
=+ tiv=(slot 3 mex) :: tiv: vase of vase
?. (sunk p.tiv) ~ :: a vase is a cell
?. (souk typ.vil p:(slot 2 tiv)) ~ :: vase head is type
%- biff :_ |=(a=milt `[%| a]) :: milt to mill
^- (unit (pair mill worm)) ::
=^ hip p.sew (~(nell wa p.sew) p.mex) ::
?. hip ~ :: a card is a cell
?. ?=(%meta -.q.mex) `[[%& mex] p.sew] :: ordinary card
=^ tiv p.sew (~(slot wa p.sew) 3 mex) ::
=^ hip p.sew (~(nell wa p.sew) p.tiv) ::
?. hip ~ :: a vase is a cell
=^ vax p.sew (~(slot wa p.sew) 2 tiv) ::
=^ hip p.sew (~(nest wa p.sew) typ.vil p.vax) ::
?. hip ~ :: vase head is type
%- biff ::
:_ |=(a=(pair milt worm) `[[%| p.a] q.a]) :: milt to mill
=+ mut=(milt q.tiv) :: card type, value
|- ^- (unit milt) ::
?. ?=([%meta p=* q=milt] q.mut) `mut :: ordinary metacard
?. (sike mev.vil p.mut) ~ :: meta-metacard
|- ^- (unit (pair milt worm)) ::
?. ?=([%meta p=* q=milt] q.mut) `[mut p.sew] :: ordinary metacard
=^ hip p.sew (~(nets wa p.sew) mev.vil p.mut) ::
?. hip ~ :: meta-metacard
$(mut +.q.mut) :: descend into meta
::
++ sump :: vase to move
~/ %sump
|= wec=vase
^- (unit move)
^- (unit (pair move worm))
%+ biff ((soft duct) -.q.wec)
|= a=duct
%- bind :_ |=(b=arvo `move`[a b])
%- bind :_ |=(b=(pair arvo worm) [`move`[a p.b] q.b])
=- ?- -.har
| ~& [%dead-card p.har] ~ :: XX properly log?
& (some p.har)
==
^= har ^- (each arvo term)
=+ caq=(spec (slot 3 wec))
^= har ^- (each (pair arvo worm) term)
=^ caq p.sew (~(spot wa p.sew) 3 wec)
?+ q.caq [%| (cat 3 %funk (,@tas q.caq))]
::
[%pass p=* q=@tas r=[p=@tas q=*]]
@ -9803,37 +9944,45 @@
?. ((sane %tas) lal) ~
%+ biff ((soft path) p.q.caq)
|= pax=path
%+ bind (song (spec (slot 15 caq)))
|= hil=mill
[%& %pass pax lal hil]
=^ yav p.sew (~(spot wa p.sew) 15 caq)
%+ bind (song yav)
|= [hil=mill vel=worm]
[%& [%pass pax lal hil] vel]
::
[%give p=[p=@tas q=*]]
%- (bond |.([%| p.p.q.caq]))
%+ bind (song (spec (slot 3 caq)))
|= hil=mill
[%& %give hil]
=^ yav p.sew (~(spot wa p.sew) 3 caq)
%+ bind (song yav)
|= [hil=mill vel=worm]
[%& [%give hil] vel]
::
[%sick p=[p=@tas q=*]]
%- (bond |.([%| p.p.q.caq]))
%+ bind (song (spec (slot 3 caq)))
|= hil=mill
[%& %sick hil]
=^ yav p.sew (~(spot wa p.sew) 3 caq)
%+ bind (song yav)
|= [hil=mill vel=worm]
[%& [%sick hil] vel]
::
[%slip p=@tas q=[p=@tas q=*]]
%- (bond |.([%| p.q.q.caq]))
%+ biff ((soft ,@) p.q.caq)
|= lal=@tas
?. ((sane %tas) lal) ~
%+ bind (song (spec (slot 7 caq)))
|= hil=mill
[%& %slip lal hil]
=^ yav p.sew (~(spot wa p.sew) 7 caq)
%+ bind (song yav)
|= [hil=mill vel=worm]
[%& [%slip lal hil] vel]
==
::
++ said :: vase to (list move)
|= vud=vase
|- ^- (list move)
?: =(~ q.vud) ~
[(need (sump (slot 2 vud))) $(vud (slot 3 vud))]
|- ^- (pair (list move) worm)
?: =(~ q.vud) [~ p.sew]
=^ hed p.sew (~(slot wa p.sew) 2 vud)
=^ tal p.sew (~(slot wa p.sew) 3 vud)
=^ mov p.sew (need (sump hed))
=^ moz p.sew $(vud tal)
[[mov moz] p.sew]
::
++ scry :: read namespace
~/ %scry
@ -9847,7 +9996,7 @@
:* fur
ren
p.bed
q.bed
q.bed
`coin`[%$ r.bed]
(flop s.bed)
==
@ -9861,8 +10010,8 @@
++ soar :: scrub vane
|= sev=vase
^- vase
?: &(=(-.q.ves -.q.sev) =(+>.q.ves +>.q.sev))
ves :: unchanged, use old
?: &(=(-.q.q.sew -.q.sev) =(+>.q.q.sew +>.q.sev))
q.sew :: unchanged, use old
sev(+<.q [*@da *@ =>(~ |+(* ~))]) :: clear to stop leak
::
++ swim
@ -9872,14 +10021,17 @@
hen=duct
hil=mill
==
^- [p=(list move) q=vase]
^- [[p=(list move) q=worm] q=vase]
:: ~& [%swim-wyt `@ud`~(wyt in p.sew)]
=+ ^= pru
?~ pux
~| [%swim-call-vane lal]
%+ slur (slap rig [%cnzy %call])
=^ vax p.sew (~(slap wa p.sew) rig [%cnzy %call])
%^ slur-pro lal vax
(slid [%& duc.vil hen] (slix hil))
~| [%swim-take-vane lal]
%+ slur (slap rig [%cnzy %take])
=^ vax p.sew (~(slap wa p.sew) rig [%cnzy %take])
%^ slur-pro lal vax
;: slid
[%& pah.vil u.pux]
[%& duc.vil hen]
@ -9887,16 +10039,17 @@
==
?~ pru
~& [%swim-lost lal (,@tas +>-.hil)]
[~ ves]
=+ pro=(need pru)
:- (said (slap pro [%cnzy %p]))
(soar (slap pro [%cnzy %q]))
[[~ p.sew] q.sew]
=^ pro p.sew (need pru)
=^ moz p.sew (~(slap wa p.sew) pro [%cnzy %p])
=^ vem p.sew (~(slap wa p.sew) pro [%cnzy %q])
[(said moz) (soar vem)]
--
--
::
++ vint :: create vane
|= [lal=@tas vil=vile bud=vase pax=path txt=@ta] ::
(vent lal vil bud (slym (slap bud (rain pax txt)) bud))
(vent lal vil bud *worm (slym (slap bud (rain pax txt)) bud))
::
++ viol :: vane tools
|= but=type
@ -9909,7 +10062,7 @@
==
::
++ is :: operate in time
|= [vil=vile eny=@ bud=vase fan=(list ,[p=@tas q=vase])]
|= [vil=vile eny=@ bud=vase niz=(pair worm (list ,[p=@tas q=vase]))]
|_ now=@da
++ beck
^- sled
@ -9919,14 +10072,14 @@
=+ lal=(end 3 1 ron)
=+ ren=(care (rsh 3 1 ron))
|- ^- (unit (unit cage))
?~ fan ~
?. =(lal p.i.fan) $(fan t.fan)
%- scry:(wink:(vent lal vil bud q.i.fan) now (shax now) ..^$)
?~ q.niz ~
?. =(lal p.i.q.niz) $(q.niz t.q.niz)
%- scry:(wink:(vent lal vil bud p.niz q.i.q.niz) now (shax now) ..^$)
[fur ren bed]
::
++ dink :: vase by char
|= din=@tas ^- vase
?~(fan !! ?:(=(din p.i.fan) q.i.fan $(fan t.fan)))
?~(q.niz !! ?:(=(din p.i.q.niz) q.i.q.niz $(q.niz t.q.niz)))
::
++ dint :: input routing
|= hap=path ^- @tas
@ -9942,12 +10095,12 @@
++ doos :: sleep until
|= hap=path ^- (unit ,@da)
=+ lal=(dint hap)
(doze:(wink:(vent lal vil bud (dink lal)) now 0 beck) now [hap ~])
(doze:(wink:(vent lal vil bud p.niz (dink lal)) now 0 beck) now [hap ~])
::
++ hurl :: start loop
|= [lac=? ovo=ovum]
~? &(!lac !=(%belt -.q.ovo)) [%unix -.q.ovo p.ovo]
^- [p=(list ovum) q=(list ,[p=@tas q=vase])]
^- [p=(list ovum) q=(pair worm (list ,[p=@tas q=vase]))]
?> ?=(^ p.ovo)
%+ kick lac
:~ :* i.p.ovo
@ -9962,27 +10115,28 @@
::
++ race :: take
|= [org=@tas lal=@tas pux=(unit wire) hen=duct hil=mill ves=vase]
^- [p=(list move) q=vase]
=+ ven=(vent lal vil bud ves)
^- [p=[p=(list move) q=worm] q=vase]
=+ ven=(vent lal vil bud [p.niz ves])
=+ win=(wink:ven now (shax now) beck)
(swim:win org pux hen hil)
::
++ fire :: execute
|= [org=term lal=term pux=(unit wire) hen=duct hil=mill]
?: &(?=(^ pux) ?=(~ hen))
[[[[lal u.pux] (curd +>.hil)]~ ~] fan]
=+ naf=fan
|- ^- [[p=(list ovum) q=(list muse)] _fan]
?~ naf [[~ ~] ~]
[[[[lal u.pux] (curd +>.hil)]~ ~] niz]
=+ naf=q.niz
|- ^- [[p=(list ovum) q=(list muse)] _niz]
?~ naf [[~ ~] [p.niz ~]]
?. =(lal p.i.naf)
=+ tuh=$(naf t.naf)
[-.tuh [i.naf +.tuh]]
[-.tuh [+<.tuh [i.naf +>.tuh]]]
=+ fiq=(race org lal pux hen hil q.i.naf)
[[~ (turn p.fiq |=(a=move [lal a]))] [[p.i.naf q.fiq] t.naf]]
[[~ (turn p.p.fiq |=(a=move [lal a]))] [q.p.fiq [[p.i.naf q.fiq] t.naf]]]
::
++ jack :: dispatch card
|= [lac=? gum=muse]
^- [[p=(list ovum) q=(list muse)] _fan]
^- [[p=(list ovum) q=(list muse)] _niz]
=. lac |(lac ?=(?(%g %f) p.gum))
%+ fire
p.gum
?- -.r.gum
@ -10017,9 +10171,9 @@
++ kick :: new main loop
|= [lac=? mor=(list muse)]
=| ova=(list ovum)
|- ^- [p=(list ovum) q=(list ,[p=@tas q=vase])]
?~ mor [(flop ova) fan]
=^ nyx fan (jack lac i.mor)
|- ^- [p=(list ovum) q=(pair worm (list ,[p=@tas q=vase]))]
?~ mor [(flop ova) niz]
=^ nyx niz (jack lac i.mor)
$(ova (weld p.nyx ova), mor (weld q.nyx t.mor))
--
--
@ -10033,7 +10187,7 @@
=+ vil=(viol p.bud) :: cached reflexives
=| $: lac=? :: laconic bit
eny=@ :: entropy
fan=(list ,[p=@tas q=vase]) :: modules
niz=(pair worm (list ,[p=@tas q=vase])) :: modules
== ::
=< |%
++ come |= [@ (list ovum) pone] :: 11
@ -10077,13 +10231,13 @@
++ keep :: wakeup delay
|= [now=@da hap=path]
=> .(+< ((hard ,[now=@da hap=path]) +<))
(~(doos (is vil eny bud fan) now) hap)
(~(doos (is vil eny bud niz) now) hap)
::
++ load :: load compatible
|= [yen=@ ova=(list ovum) nyf=pane]
^+ [ova +>]
=: eny yen
fan nyf
q.niz nyf
==
|- ^+ [ova +>.^$]
?~ ova
@ -10098,7 +10252,7 @@
|= [now=@da hap=path]
^- (unit)
?~ hap [~ hoon]
=+ rob=((slod ~(beck (is vil eny bud fan) now)) hap)
=+ rob=((slod ~(beck (is vil eny bud niz) now)) hap)
?~ rob ~
?~ u.rob ~
[~ u.u.rob]
@ -10108,8 +10262,8 @@
=. eny (mix eny (shax now))
:: ~& [%poke -.q.ovo]
^- [(list ovum) _+>]
=^ zef fan
(~(hurl (is vil eny bud fan) now) lac ovo)
=^ zef niz
(~(hurl (is vil eny bud niz) now) lac ovo)
[zef +>.$]
::
++ vega :: reboot kernel
@ -10128,7 +10282,7 @@
~& [%vega-compiled hoon nex]
?> (lte nex hoon)
=+ gat=.*(ken .*(ken [0 ?:(=(nex hoon) 86 11)]))
=+ sam=[eny ova fan]
=+ sam=[eny ova q.niz]
=+ raw=.*([-.gat [sam +>.gat]] -.gat)
[[[~ %vega hap] ((list ovum) -.raw)] +.raw]
::
@ -10141,15 +10295,17 @@
=+ vax=(slap pit gen)
+>.$(bud vax)
%_ +>
fan
|- ^+ fan
?~ fan
q.niz
|- ^+ q.niz
?~ q.niz
~& [%vane `@tas`lal.fav pax.fav `@p`(mug txt.fav)]
[[lal.fav ves:(vint lal.fav vil bud pax.fav txt.fav)] fan]
?. =(lal.fav p.i.fan)
[i.fan $(fan t.fan)]
[[lal.fav q.sew:(vint lal.fav vil bud pax.fav txt.fav)] q.niz]
?. =(lal.fav p.i.q.niz)
[i.q.niz $(q.niz t.q.niz)]
~& [%vane `@tas`lal.fav pax.fav `@p`(mug txt.fav)]
[[p.i.fan ves:(ruck:(vent lal.fav vil bud q.i.fan) pax.fav txt.fav)] t.fan]
:_ t.q.niz
:- p.i.q.niz
q.sew:(ruck:(vent lal.fav vil bud [p.niz q.i.q.niz]) pax.fav txt.fav)
==
::
++ wish :: external compute

View File

@ -62,7 +62,7 @@
=+ lox=((soft axle) old)
^+ ..^$
?~ lox
~& %lunt-reset
~& %khan-reset
..^$
..^$(+>- u.lox)
::

View File

@ -871,6 +871,18 @@
?. ?=([%o *] jon) ~
(zm (~(run by p.jon) wit))
::
++ op :: parse keys of map
|* [fel=_rule wit=fist]
%+ cu mo
%- ci :_ (om wit)
|= a=(map cord ,_(need *wit))
^- (unit (list ,_[(wonk *fel) (need *wit)]))
=- (zl (turn (~(tap by a)) -))
|* [a=cord b=*]
=+ nit=(rush a fel)
?~ nit ~
(some [u.nit b])
::
++ pe :: prefix
|* [pre=* wit=fist]
(cu |*(a=* [pre a]) wit)
@ -915,7 +927,7 @@
::
++ zm :: collapse unit map
|* lum=(map term (unit))
?: (~(rep by lum) | |=([[@ a=(unit)] b=?] |(b ?=(~ a))))
?: (~(rep by lum) |=([[@ a=(unit)] b=_|] |(b ?=(~ a))))
~
(some (~(run by lum) need))
--
@ -942,6 +954,11 @@
?: =(0 a) '0'
(crip (flop |-(^-(tape ?:(=(0 a) ~ [(add '0' (mod a 10)) $(a (div a 10))])))))
::
++ jode :: ms timestamp
|= a=time
=- (jone (div (mul - 1.000) ~s1))
(add (div ~s1 2.000) (sub a ~1970.1.1))
::
++ jesc
|= a=@ ^- tape
?+ a [a ~]
@ -998,10 +1015,6 @@
=+ buf=(rap 3 (turn wol |=(a=tape (crip (weld a `tape`[`@`10 ~])))))
[(met 3 buf) buf]
::
::
++ txml :: string to xml
|= tep=tape ^- mars
[[%$ [%$ tep] ~] ~]
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: section 3bE, tree sync ::
::
@ -2020,11 +2033,6 @@
==
[p.one [%& [*cart (weld q.p.q.one q.p.q.two)]]]
::
++ meat :: kite to .^ path
|= kit=kite
^- path
[(cat 3 'c' p.kit) (scot %p r.kit) s.kit (scot `dime`q.kit) t.kit]
::
++ tame :: parse kite path
|= hap=path
^- (unit kite)
@ -2081,16 +2089,6 @@
[~ [i.rax ~]]
[q.u.raf [p.u.raf ~]]
::
++ fain :: path restructure
|= [hom=path raw=path]
=+ bem=(need (tome raw))
=+ [mer=(flop s.bem) moh=(flop hom)]
|- ^- (pair beam path)
?~ moh
[bem(s hom) (flop mer)]
?> &(?=(^ mer) =(i.mer i.moh))
$(mer t.mer, moh t.moh)
::
++ fuel :: parse fcgi
|= [bem=beam but=path]
^- epic
@ -2196,7 +2194,7 @@
|= har=hart
^- tape
;: weld
?:(&(p.har !=([& /localhost] r.har)) "https://" "http://")
?:(&(p.har !?=(hoke r.har)) "https://" "http://")
::
?- -.r.har
| (trip (rsh 3 1 (scot %if p.r.har)))
@ -2232,7 +2230,7 @@
++ auri :: 2396 URL
%+ cook
|= a=purl
?.(=([& /localhost] r.p.a) a a(p.p &))
?.(?=(hoke r.p.a) a a(p.p &))
;~ plug
;~ plug
%+ sear
@ -2667,6 +2665,15 @@
?: ?=(| -.mud) mud
(mule |.((slam p.mud sam)))
::
++ pack :: light path encoding
|= [a=term b=path] ^- span
%+ rap 3 :- (wack a)
(turn b |=(c=span (cat 3 '_' (wack c))))
::
++ pick :: light path decoding
|= a=span ^- (unit ,[p=term q=path])
(rush a (most cab (sear wick urt:ab)))
::
++ saxo :: autocanon
|= who=ship
^- (list ship)
@ -2717,7 +2724,6 @@
q=(unit ,[p=cash q=cage]) :: file
r=(map ,@ta ankh) :: folders
== ::
++ ankz ,[p=@ (map ,@ta ankz)] :: trimmed ankh
++ apex ,[p=@uvI q=(map ,@ta ,@uvI) r=(map ,@ta ,~)] :: node report (old)
++ ares (unit ,[p=term q=(list tank)]) :: possible error
++ ball ,@uw :: statement payload
@ -2851,7 +2857,6 @@
ton=town :: security
zac=(map ship corn) :: flows by server
== ::
++ frog ,[p=@da q=nori] :: time and change
++ gank (each vase (list tank)) :: abstract result
++ gift :: one-way effect
$% [%$ p=vase] :: trivial output
@ -2943,6 +2948,8 @@
++ hoot ,[p=? q=(unit ,@ud) r=host] :: secure/port/host
++ hort ,[p=(unit ,@ud) q=host] :: http port/host
++ host $%([& p=(list ,@t)] [| p=@if]) :: http host
++ hoke %+ each ,[%localhost ~] :: local host
?(%.0.0.0.0 %.127.0.0.1) ::
++ httq :: raw http request
$: p=meth :: method
q=@t :: unparsed url
@ -2964,10 +2971,6 @@
[%n p=@ta] :: number
[%s p=@t] :: string
== ::
++ jsot :: strict json top
$% [%a p=(list json)] :: array
[%o p=(map ,@t json)] :: object
== ::
++ lamb :: short path
$% [& p=@tas] :: auto
[| p=twig] :: manual
@ -2997,10 +3000,8 @@
[%wan p=wain] :: text lines
[%zap p=@ud q=(list tank)] :: status/error
== ::
++ luge ,[p=mark q=*] :: fully typed content
++ maki ,[p=@ta q=@ta r=@ta s=path] ::
++ mace (list ,[p=life q=ring]) :: private secrets
++ marv ?(%da %tas %ud) :: release form
++ math (map ,@t (list ,@t)) :: semiparsed headers
++ meal :: payload
$% [%back p=cape q=flap r=@dr] :: acknowledgment
@ -3173,7 +3174,6 @@
++ suba ,[p=cart q=(list ,[p=path q=misu])] :: delta
++ tako ,@ :: yaki ref
++ tart $+([@da path note] bowl) :: process core
++ taxi ,[p=lane q=rock] :: routed packet
++ tick ,@ud :: process id
++ toro ,[p=@ta q=nori] :: general change
++ town :: all security state
@ -3198,6 +3198,5 @@
[%chan (list $|(@ud [p=@ud q=@ud]))] ::
++ wund (list ,[p=life q=ring r=acru]) :: mace in action
++ will (list deed) :: certificate
++ worm ,* :: vase of tart
++ zuse %314 :: hoon/zuse kelvin
--

View File

@ -1,13 +1,21 @@
:: Bang: send cards to arvo
::
:::: /hook/core/bang/app
::
/+ sh-utils
!:
::::
::
|_ [hide ~]
++ lima |*(a=(pole) ?~(a ~ [i t]=a(+ (..$ +.a))))
++ poke-bang-args
++ poke--args
|* [ost=bone @ a=[* (pole)]]
=> .(a ^.(lima a))
:_(+> (turn a |*(b=_i.a [ost %pass / b])))
::
++ pour
|= [ost=bone * sih=*]
~& bang-resp/;;(,[term term] [&1 &2]:sih)
:_(+> [ost %pass / %g %cide %$]~)
%- add-exit
|= [@ * sih=*]
~& bang-resp/(,[term term] [&1 &2]:sih)
`+>.$
--

View File

@ -8,7 +8,10 @@
--
::
!:
::::
::
|_ [hid=hide %0 ust=bone his=@p mac=mace]
++ peer ,_`.
++ poke-began-args
|= [ost=bone you=ship began-args]
=+ bur=(shax :(mix (jam ges) eny))
@ -42,8 +45,4 @@
%went ~
==
::
++ peer
|=
*
`+>
--

View File

@ -17,7 +17,10 @@
--
::
!:
::::
::
|_ [hid=hide sat=state form]
++ peer ,_`.
++ done
|= ost=bone
:_ +>.$
@ -430,10 +433,6 @@
[%leaf "begin failed"]
==
++ peer
|=
*
`+>
::
++ spam
|* git=*

View File

@ -1,28 +1,35 @@
:: ConCATenate file listings
::
:::: /hook/core/cat/app
::
/+ sh-utils
// /%%%/ls/subdir
!:
::::
::
|_ [hid=hide ~]
++ poke-cat-args
|= [ost=bone you=ship arg=(list path)]
:_ +>.$
:* [ost %pass / %g %cide %$]
[ost %give %nice ~]
%+ turn (~(tap by sup.hid))
|= [ost=bone *]
:^ ost %give %rush
:- %tang
%- flop
^- (list tank)
%- zing
%+ turn arg
|= pax=path
=+ ark=;;(arch +:.^(%cy pax))
?~ q.ark ~[leaf/"file {<pax>} not available"]
:- leaf/(spud pax)
%+ turn (lore ;;(,@t +:.^(%cx pax)))
|= a=cord
leaf/(trip a)
++ peer ,_`.
++ poke--args
%+ args-into-gate .
|= [arg=(list path)]
=- tang/(flop `(list tank)`(zing -))
%+ turn arg
|= pax=path
^- (list tank)
=+ ark=;;(arch +:.^(%cy pax))
?^ q.ark
:- leaf/(spud pax)
%+ turn (lore ;;(@t +:.^(%cx pax)))
|=(a=cord leaf/(trip a))
?- r.ark :: handle ambiguity
~
[rose/[" " `~]^~[leaf/"~" (smyt pax)]]~
[[@t ~] ~ ~]
$(pax (welp pax /[p.n.r.ark]))
*
=- [palm/[": " ``~]^-]~
:~ rose/[" " `~]^~[leaf/"*" (smyt pax)]
`tank`(subdir pax r.ark)
==
==
++ peer
|=
*
`+>
--

View File

@ -1,5 +1,8 @@
!:
::::
::
|_ [hid=hide ~]
++ peer ,_`.
++ poke-cp-args
|= [ost=bone you=ship input=path output=path ~]
:_ +>.$
@ -12,8 +15,4 @@
:- %tang :_ ~
leaf/"copied"
==
++ peer
|=
*
`+>
--

View File

@ -10,6 +10,8 @@
--
::
!:
::::
::
|_ [hid=hide arg=cord]
++ poke-grep-args
|= [ost=bone you=ship arg=cord ~]

View File

@ -1,6 +1,10 @@
:: Hi
:: Hi, send optional message to a ship
::
:::: /hook/gate/hi/bin
:::: /hook/core/hi/bin
::
/+ sh-utils
::
::::
::
|%
++ sign ::
@ -13,39 +17,33 @@
[%text p=tape] ::
== ::
--
::
!:
::::
::
|_ [hid=hide ~]
++ poke-hi-args
|= [ost=bone you=ship her=ship mes=?(~ [tex=tape ~])]
:_ +>.$
=+ mez=[%txt !>(?~(mes '' (crip tex.mes)))]
:~ [ost %pass /hi/(scot %p her) %g %mess [her /hi] you mez]
[ost %give %nice ~]
==
++ peer ,_`.
++ poke--args
|= [bone you=ship her=ship mes=?(~ [tex=tape ~])]
%. +<
%+ add-resp
=+ mez=[%txt !>(?~(mes '' (crip tex.mes)))]
[%pass /hi/(scot %p her) %g %mess [her /hi] you mez]
(add-nice ,_`+>.$)
::
++ poke-txt
%- add-nice
|= [ost=bone him=ship cor=@t]
:_ +>.$
:~ [ost %pass /di %d %flog %text "< {<him>}: {(trip cor)}"]
[ost %give %nice ~]
==
[ost %pass /di %d %flog %text "< {<him>}: {(trip cor)}"]~
::
++ pour
|= [ost=bone pax=path sih=sign]
?> ?=([%hi @t ~] pax)
:_ +>.$
:- [ost %pass / %g %cide %$]
%+ turn (~(tap by sup.hid))
|= [ost=bone *]
:^ ost %give %rush
:- %tang :_ ~
?: ?=(%nice +<.sih)
leaf/"hi {(trip i.t.pax)} successful"
leaf/"hi {(trip i.t.pax)} unsuccessful"
%. +<
%- add-exit
%^ add-output +>.$
=+ ack=?+(+<.sih "unsuccesful" %nice "succesful")
rush/tang/[leaf/"hi {(trip i.t.pax)} {ack}"]~
,_`+>.$
::
++ peer
|=
*
`+>
--

View File

@ -1,5 +1,8 @@
!:
::::
::
|_ [hid=hide ~]
++ peer ,_`.
++ poke-into-args
|= [ost=bone you=ship pax=path dat=@ ~]
:_ +>.$
@ -12,8 +15,4 @@
:- %tang :_ ~
leaf/"written"
==
++ peer
|=
*
`+>
--

View File

@ -1,4 +1,6 @@
!:
::::
::
|_ [hid=hide ~]
++ poke-label-args
|= [ost=bone you=ship syd=@tas lab=@tas ~]

View File

@ -1,21 +1,17 @@
:: LiSt directory subnodes
::
::::
::
/+ sh-utils
// /%%/subdir
!:
::::
::
|_ [hid=hide ~]
++ peer ,_`.
++ poke-ls-args
|= [ost=bone you=ship arg=path ~]
%+ args-into-gate .
|= [arg=path ~]
=+ lon=((hard arch) +:.^(%cy arg))
:_ +>.$
:* [ost %pass / %g %cide %$]
[ost %give %nice ~]
%+ turn (~(tap by sup.hid))
|= [ost=bone *]
:^ ost %give %rush
:- %tang
:_ ~
:+ %rose [" " ~ ~]
(turn (~(tap by r.lon) ~) |=([a=@ta b=*] leaf/(trip a)))
==
++ peer
|=
*
`+>
tang/[?~(r.lon leaf/"~" (subdir arg r.lon))]~
--

20
main/app/ls/subdir.hoon Normal file
View File

@ -0,0 +1,20 @@
|%
++ subdir
|= [pax=path des=(map ,@t ,~)]
^- tank
:+ %rose [" " `~]
%+ turn (sort (~(tap by des)) aor)
|= [kid=@ta ~]
=+ paf=`path`/[kid]
=- :+ %rose ["/" ~ ?:(dir "/" ~)]
(turn paf |=(a=span leaf/(trip a)))
|- ^- [dir=? paf=path]
=+ arf=;;(arch .^(%cy (weld pax paf)))
?^ q.arf
[| paf]
?~ r.arf
[& paf] :: !!
?. ?=([^ ~ ~] r.arf)
[& paf]
$(paf (welp paf /[p.n.r.arf]))
--

View File

@ -1,21 +1,17 @@
:: MoVe file from one location to another
::
:::: /hook/core/mv/app
::
/+ sh-utils
!:
::::
::
|_ [hid=hide ~]
++ poke-mv-args
|= [ost=bone you=ship input=path output=path ~]
:_ +>.$
:* :^ ost %pass /mv
:^ %c %info our.hid
(furl (foal output .^(%cx input)) (fray input))
[ost %pass / %g %cide %$]
[ost %give %nice ~]
%+ turn (~(tap by sup.hid))
|= [ost=bone *]
:^ ost %give %rush
:- %tang :_ ~
leaf/"moved"
==
++ peer
|=
*
`+>
++ peer ,_`.
++ poke--args
%+ gate-bang
|= [input=path output=path ~]
:^ %c %info our.hid
(furl (foal output .^(%cx input)) (fray input))
(args-into-gate . ,_[%txt 'moved'])
--

1
main/app/nop/core.hook Normal file
View File

@ -0,0 +1 @@
|_ ^ ++ poke-nop-args ,_`. --

View File

@ -1,4 +1,7 @@
:: Poke path [mark *] || Poke ship path [mark *]. Send message to an app.
!:
::::
::
|_ [hide ~]
++ mess ,[p=path q=[@ *] ~]
++ pock-poke-args
@ -9,6 +12,6 @@
::
++ pour
|= [ost=bone * sih=*]
~& poke-resp/;;(,[term term] [&1 &2]:sih)
~& poke-resp/;;([term term] [&1 &2]:sih)
:_(+> [ost %pass / %g %cide %$]~)
--

48
main/app/pope/core.hook Normal file
View File

@ -0,0 +1,48 @@
:: Pope, generate key for carrier
::
:::: /hook/core/pope/app
::
/+ sh-utils
!:
::::
::
|%
++ gilt $%([%tang (list tank)] [%prompt @t prom @t])
++ sign
$% [%t %wake ~]
[%g $%([%nice ~] [%rush %txt p=cord])]
==
--
!:
::::
::
=+ cryp=bruw :: XX change to ec2 ++brew eventually
|_ [hide who=@p fra=@t]
++ peer ,_`.
++ poke--args
|= [@ @ who=ship ~]
?> ?=(%czar (clan who))
=. ^who who
=- %.(+<.$ (add-nice (gate-bang ,_noe (return git))))
:- noe=[%g %show our^+.imp our /in/[-.imp]] :: request input
git=prompt/['passphrase: ' %pass '']
::
++ return |=(a=gilt (add-output +> rush/a ,_`+>))
++ pour
|= [@ * sih=*]
=+ sih=;;(sign sih)
?- -.sih
%g ?. ?=(%rush +<.sih) `+>.$
=. fra p.sih
=- %.(+<.$ (gate-bang ,_noe (return tang/~[leaf/msg])))
:- noe=[%t %wait (add ~s1 lat)] :: set print timeout
msg="generating carrier {(scow %p who)} (#{(scow %ud who)})"
::
%t =- %.(+<.$ (add-exit (return tang/-)))
=+ bur=(shax (add who (shax fra)))
=+ arc=(cryp 2.048 bur)
%- flop ^- (list tank)
:~ leaf/"generator: {(scow %uw bur)}"
leaf/"fingerprint: {(scow %uw fig:ex:arc)}"
== ==
--

38
main/app/reboot/core.hook Normal file
View File

@ -0,0 +1,38 @@
:: Reboot %zuse and all kernel vanes
::
:::: /hook/core/reboot/app
::
/+ sh-utils
!:
::::
::
|_ [hid=hide ~]
++ peer ,_`.
++ poke--args
%^ add-output .
rush/tang/[leaf/"done"]~
%+ args-into-resp .
|= arg=~
%- turn
:_ |= [tip=@tasD nam=@tas]
=+ pax=[(scot %p our.hid) %arvo (scot %da lat.hid) nam %hoon ~]
[%veer tip pax (,@ .^(%cx pax))]
%- flop
^- (list ,[p=@tas q=@tas])
:~ [%$ %zuse]
[%a %ames]
[%c %clay]
[%d %dill]
[%e %eyre]
[%f %ford]
[%g %gall]
[%t %time]
==
++ pour
%+ gate-bang
=+ pax=/(scot %p our.hid)/=/(scot %da lat.hid)/==count/txt
=+ nuf=(file pax)
=+ num=?~(nuf 0 +((fall (slaw %ud (,@t u.nuf)) 0)))
,_[%c %info our.hid (foal pax num)] :: touch clay to reload apps
,_`.
--

View File

@ -1,22 +1,30 @@
:: Reload kernel vanes, specified by name or letter
::
:::: /hook/core/reload/app
::
/+ sh-utils
!:
::::
::
|_ [hid=hide ~]
++ poke-reload-args
|= [ost=bone you=ship all=(list ,@tas)]
:_ +>.$
%+ welp
%+ turn all
|= nam=@tas
=+ tip=(end 3 1 nam)
=+ pax=[(scot %p our.hid) %arvo (scot %da lat.hid) nam %hoon ~]
[ost %give %veer ?:(=('z' tip) %$ tip) pax (,@ +.+.+:.^(%cx pax))]
:- [ost %give %nice ~]
%+ turn (~(tap by sup.hid))
|= [ost=bone *]
:^ ost %give %rush
:- %tang :_ ~
leaf/"done"
++ peer
|=
*
`+>
++ peer ,_`.
++ poke--args
%^ add-output .
rush/tang/[leaf/"done"]~
%+ args-into-resp .
|= all=(list ,@tas)
%+ turn (flop all)
=+ ark=(arch +:.^(%cy /(scot %p our.hid)/arvo/(scot %da lat.hid)))
=+ van=(~(tap by r.ark))
|= nam=@tas
=. nam
?. =(1 (met 3 nam))
nam
=+ ^- zaz=(list ,[p=span ~])
(murn van (flit |=([a=term ~] =(nam (end 3 1 a)))))
?> ?=([[@ ~] ~] zaz)
`term`p.i.zaz
=+ tip=(end 3 1 nam)
=+ pax=[(scot %p our.hid) %arvo (scot %da lat.hid) nam %hoon ~]
[%veer ?:(=('z' tip) %$ tip) pax (,@ +:.^(%cx pax))]
--

View File

@ -1,13 +1,16 @@
:: Reset: recompile arvo, from hoon/hoon up
!:
::::
::
|_ [hid=hide ~]
++ peer ,_`.
++ poke-reset-args
|= [ost=bone you=ship ~]
|= [ost=bone you=ship arg=$|(~ [_| ~])]
:_ +>.$
=+ top=`path`/(scot %p our.hid)/arvo/(scot %da lat.hid)
=+ pax=`path`(weld top `path`[%hoon ~])
:+ [ost %give %nice ~]
[ost %pass / %t %wait lat.hid]
%- welp :_ [ost %give %vega pax]~
[ost %pass ?~(arg /refresh /) %t %wait lat.hid]
%- welp :_ [ost %give %vega (weld top `path`/hoon)]~
%+ turn
%- flop
^- (list ,[p=@tas q=@tas])
@ -21,21 +24,16 @@
[%t %time]
==
|= [p=@tas q=@tas]
=+ pax=(weld top `path`[q ~])
=+ txt=((hard ,@) .^(%cx (weld pax `path`[%hoon ~])))
=+ pax=`path`(welp top /[q])
=+ txt=((hard ,@) .^(%cx (welp pax /hoon)))
[ost %give %veer p pax txt]
++ pour
|= [ost=bone pax=path *]
:_ +>.$ :_ ~
=+ paf=/(scot %p our.hid)/main/(scot %da lat.hid)/app/reset/count/txt
=+ ^= num
?: ?=([%0 %0 %0] [.^(%cy paf)]) '0'
%+ scot %ud
.+
(fall (slaw %ud (,@t .^(%cx paf))) 0)
:_ +>.$
?~ pax ~
:_ ~
=+ paf=/(scot %p our.hid)/=/(scot %da lat.hid)/==count/txt
=+ nuf=(file paf)
=+ num=?~(nuf 0 +((fall (slaw %ud (,@t u.nuf)) 0)))
[ost %pass /touch %c %info our.hid (foal paf num)]
++ peer
|=
*
`+>
--

View File

@ -1,5 +1,8 @@
!:
::::
::
|_ [hid=hide ~]
++ peer ,_`.
++ poke-rm-args
|= [ost=bone you=ship pax=path ~]
:_ +>.$
@ -12,8 +15,4 @@
:- %tang :_ ~
leaf/"removed"
==
++ peer
|=
*
`+>
--

793
main/app/rodeo/core.hook Normal file
View File

@ -0,0 +1,793 @@
::
:::: /hook/core/rodeo/app
::
/? 314
/- *rodeo
/+ rodeo
::
::::
::
!:
=> |% :: data structures
++ house ,[%1 house-1] :: full state
++ house-any :: app history
$% [%1 house-1] :: 1: rodeo
[%0 house-0] :: 0: initial version
== ::
++ house-1 ::
$: stories=(map span story) :: conversations
general=(set bone) :: meta-subscribe
outbox=(pair ,@ud (map ,@ud thought)) :: urbit outbox
sent=(map ,@ud serial) :: own tweets
folks=(map ship human) :: human identities
== ::
++ house-0 :: legacy state
%+ map path ::
,[p=(list zong) q=(map ship ,?)] ::
:: ::
++ zong :: legacy messages
$% $: %mess p=@da q=ship ::
$= r ::
$% [%do p=@t] ::
[%exp p=@t q=tank] ::
[%say p=@t] ::
== == == ::
++ story :: a conversation
$: count=@ud :: (lent grams)
grams=(list telegram) :: all history
locals=(map ship (pair ,@da status)) :: local presence
remotes=(map station atlas) :: remote presence
sequence=(map station ,@ud) :: stations heard
shape=config :: configuration
known=(map serial ,@ud) :: messages heard
guests=(map bone river) :: message followers
viewers=(set bone) :: presence followers
owners=(set bone) :: config followers
== ::
++ river (pair point point) :: stream definition
++ point :: stream endpoint
$% [%ud p=@ud] :: by number
[%da p=@da] :: by date
== ::
++ gift :: result
$% [%rust %rodeo-report report] :: refresh
[%mean ares] :: cancel
[%nice ~] :: accept
== ::
++ sign :: response
$% $: %e :: from %eyre
$% [%thou p=httr] :: HTTP response
== == ::
$: %g :: application
$% [%mean p=ares] :: cancel
[%nice ~] :: acknowledge
[%rust %rodeo-report report] :: refresh
== == ::
$: %t ::
$% [%wake ~] :: timer wakeup
== == == ::
++ move ,[p=bone q=(mold note gift)] :: all actions
++ hapt ,[p=ship q=path] :: app instance
++ note :: requests
$% $: %c ::
$% [%info p=@p q=@tas r=nori] ::
== == ::
$: %e :: through %eyre
$% [%them p=(unit hiss)] :: HTTP request
== == ::
$: %g :: network
$% [%mess p=hapt q=ship r=cage] :: message
[%nuke p=hapt q=ship] :: cancel
[%show p=hapt q=ship r=path] :: subscribe
== == ::
$: %t ::
$% [%wait p=@da] ::
== == == ::
++ twim :: twitter endpoints
$%([%mine p=span] [%stat p=@uv]) ::
--
|_ [hid=hide house]
++ ra :: transaction core
|_ [ost=bone moves=(list move)]
++ ra-abet :: resolve core
^- [(list move) _+>]
[(flop moves) +>]
::
++ ra-emil :: ra-emit move list
|= mol=(list move)
%_(+> moves (welp (flop mol) moves))
::
++ ra-emit :: emit a move
|= mov=move
%_(+> moves [mov moves])
::
++ ra-ever :: emit success
(ra-emit ost %give %nice ~)
::
++ ra-evil :: emit error
|= msg=cord
~& [%ra-evil msg]
(ra-emit ost %give %mean ~ msg ~)
::
++ ra-hiss :: emit http request
|= [pax=path hiz=hiss]
(ra-emit ost %pass pax %e %them ~ hiz)
::
++ ra-house :: emit stations
|= ost=bone
%+ ra-emit ost
:^ %give %rust %rodeo-report
:- %house
%- ~(gas in *(set span))
^- (list span)
(turn (~(tap by stories) ~) |=([a=span *] a))
::
++ ra-homes :: update stations
=+ gel=general
|- ^+ +>
?~ gel +>
=. +> $(gel l.gel)
=. +> $(gel r.gel)
(ra-house n.gel)
::
++ ra-init :: initialize rodeo
=+ 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]
^+ +>
:: ~& [%ra-apply cod]
?- -.cod
%design
?. =(her our.hid)
(ra-evil %rodeo-no-owner)
?~ q.cod
?. (~(has by stories) p.cod)
(ra-evil %rodeo-no-story)
=. +>.$ (ra-config p.cod *config)
ra-ever(stories (~(del by stories) p.cod))
=. +>.$ (ra-config p.cod u.q.cod)
ra-ever
::
%review ra-ever:(ra-think | her +.cod)
%publish ra-ever:(ra-think & her +.cod)
%ping (ra-notice her +.cod)
==
::
++ ra-config :: configure story
|= [man=span con=config]
^+ +>
=+ :- neu=(~(has by stories) man)
pur=(fall (~(get by stories) man) *story)
=. +>.$ pa-abet:(~(pa-reform pa man pur) con)
?:(neu +>.$ ra-homes)
::
++ ra-friend :: %friend response
|= [man=span sih=sign]
^+ +>
=+ pur=(~(get by stories) man)
?~ pur ~& [%ra-friend-none man] +>.$
pa-abet:(~(pa-friend pa man u.pur) sih)
::
++ ra-stalk :: %stalk response
|= [man=span tay=station sih=sign]
^+ +>
=+ pur=(~(get by stories) man)
?~ pur ~& [%ra-stalk-none man] +>.$
pa-abet:(~(pa-stalk pa man u.pur) tay sih)
::
++ ra-timer :: timeout
^+ .
=+ paz=stories
|- ^+ +>
?~ paz +>.$
=. +>.$ $(paz l.paz)
=. +>.$ $(paz r.paz)
pa-abet:~(pa-timer pa p.n.paz q.n.paz)
::
++ ra-twitter :: %twitter response
|= [met=twim sih=sign]
^+ +>
!!
::
++ ra-repeat :: %repeat response
|= [num=@ud her=ship man=span sih=sign]
=+ oot=(~(get by q.outbox) num)
?~ oot ~& [%ra-repeat-none num] +>.$
=. q.outbox (~(del by q.outbox) num)
=. q.u.oot
%+ ~(put by q.u.oot)
[%& her man]
?+ sih !!
[%g %mean *] ~&([%rodeo-repeat-rejected num her man sih] %rejected)
[%g %nice ~] %received
==
(ra-think | our.hid u.oot ~)
::
++ ra-cancel :: drop a bone
%_ .
general (~(del in general) ost)
stories
|- ^- (map span story)
?~ stories ~
:- :- p.n.stories
%= q.n.stories
guests (~(del by guests.q.n.stories) ost)
viewers (~(del in viewers.q.n.stories) ost)
owners (~(del in owners.q.n.stories) ost)
==
[$(stories l.stories) $(stories r.stories)]
==
::
++ ra-subscribe :: listen to
|= [her=ship pax=path]
^+ +>
:: ~& [%ra-subscribe her pax]
?: ?=(~ pax)
(ra-house(general (~(put in general) ost)) ost)
?. ?=([@ @ *] pax)
(ra-evil %rodeo-bad-path)
=+ ^= vab ^- (set ,@tas)
=| vab=(set ,@tas)
|- ^+ vab
?: =(0 i.pax) vab
$(i.pax (rsh 3 1 i.pax), vab (~(put in vab) (end 3 1 i.pax)))
=+ pur=(~(get by stories) i.t.pax)
?~ pur
~& [%bad-subscribe-story-c i.t.pax]
(ra-evil %rodeo-no-story)
=+ soy=~(. pa i.t.pax u.pur)
=. soy ?.((~(has in vab) %a) soy (pa-watch:soy her))
=. soy ?.((~(has in vab) %x) soy (pa-master:soy her))
=. soy ?.((~(has in vab) %f) soy (pa-listen:soy her t.t.pax))
pa-abet:soy
::
++ ra-think :: publish/review
|= [pub=? her=ship tiz=(list thought)]
^+ +>
?~ tiz +>
$(tiz t.tiz, +> (ra-consume pub her i.tiz))
::
++ ra-consume :: consume thought
|= [pub=? her=ship tip=thought]
=+ aud=`(list (pair station delivery))`(~(tap by q.tip) ~)
|- ^+ +>.^$
?~ aud +>.^$
$(aud t.aud, +>.^$ (ra-conduct pub her p.i.aud tip))
::
++ ra-notice :: declare presence
|= [her=ship vig=(map station presence)]
^+ +>
=+ sul=(~(tap by vig) ~)
|- ^+ +>.^$
?~ sul ra-ever
=. +>.^$ $(sul t.sul)
?- -.p.i.sul
%| +>.^$
%& ?: =(`ship`p.p.p.i.sul our.hid)
(ra-appear her q.p.p.i.sul q.i.sul)
?: =(her our.hid)
(ra-provoke p.p.p.i.sul i.sul)
(ra-evil %rodeo-unauthorized-presence)
==
::
++ ra-appear :: review presence
|= [her=ship man=span per=presence]
=^ who folks
=+ who=(~(get by folks) her)
?^ who [u.who folks]
=+ who=`human`[~ `(scot %p her)] :: XX do right
[who (~(put by folks) her who)]
=+ pur=(~(get by stories) man)
?~ pur
~& [%bad-appear man]
(ra-evil %rodeo-no-story)
pa-abet:(~(pa-notify pa man u.pur) her per who)
::
++ ra-provoke :: forward presence
|= [him=ship tay=station per=presence]
%+ ra-emit ost
:* %pass
/provoke
%g
%mess
[him /rodeo]
our.hid
[%rodeo-command !>(`command`[%ping [[tay per] ~ ~]])]
==
::
++ ra-conduct :: thought to station
|= [pub=? her=ship tay=station tip=thought]
^+ +>
:: ~& [%ra-conduct pub her tay]
?- -.tay
%& ?: pub
=. her our.hid :: XX security!
?: =(her p.p.tay)
(ra-record q.p.tay p.p.tay tip)
(ra-transmit p.tay tip)
?. =(our.hid p.p.tay)
+>
(ra-record q.p.tay her tip)
%| ?. pub +>
?- -.p.tay
%twitter
!!
== ==
::
++ ra-record :: add to story
|= [man=span gam=telegram]
^+ +>
=+ pur=(~(get by stories) man)
?~ pur
~& [%no-story man]
+>.$
pa-abet:(~(pa-learn pa man u.pur) gam)
::
++ ra-transmit :: send to neighbor
|= [cuz=cousin tip=thought]
^+ +>
=. +>
%+ ra-emit ost
:* %pass
/repeat/(scot %ud p.outbox)/(scot %p p.cuz)/[q.cuz]
%g
%mess
[p.cuz /rodeo]
our.hid
[%rodeo-command !>(`command`[%review tip ~])]
==
+>(p.outbox +(p.outbox), q.outbox (~(put by q.outbox) p.outbox tip))
::
++ pa :: story core
|_ $: man=span
story
==
++ pa-abet
^+ +>
+>(stories (~(put by stories) man `story`+<+))
::
++ pa-admire :: accept from
|= her=ship
^- ?
::?- -.cordon.shape
:: %& (~(has in p.cordon.shape) her)
:: %| !(~(has in p.cordon.shape) her)
::==
&
::
++ pa-timer :: timer expire
^+ .
=+ cul=(~(tap by locals) ~)
=+ ^= hay
%+ skim cul
|= [a=ship b=@da c=status]
(lte lat.hid (add ~m2 b))
?: =(cul hay) +>
%. viewers
pa-display(locals (~(gas by *(map ship (pair ,@da status))) hay))
::
++ pa-watch :: watch presence
|= her=ship
?. (pa-admire her)
(pa-sauce ost [[%mean ~ %rodeo-watch-unauthorized ~] ~])
=. viewers (~(put in viewers) ost)
(pa-display ost ~ ~)
::
++ pa-master :: hear config
|= her=ship
?. (pa-admire her)
(pa-sauce ost [[%mean ~ %rodeo-master-unauthorized ~] ~])
=. owners (~(put in owners) ost)
:: ~& [%pa-master her man shape]
(pa-sauce ost [[%rust %rodeo-report %config shape] ~])
::
++ pa-display :: update presence
|= vew=(set bone)
=+ ^= reg
:_ remotes
|- ^- atlas
?~ locals ~
[[p.n.locals q.q.n.locals] $(locals l.locals) $(locals r.locals)]
:: ~& [%pa-display man reg]
|- ^+ +>.^$
?~ vew +>.^$
=. +>.^$ $(vew l.vew)
=. +>.^$ $(vew r.vew)
(pa-sauce n.vew [[%rust %rodeo-report %group reg] ~])
::
++ pa-monitor :: update config
=+ owe=owners
|- ^+ +>
?~ owe +>
=. +> $(owe l.owe)
=. +> $(owe r.owe)
:: ~& [%pa-monitor man shape]
(pa-sauce n.owe [[%rust %rodeo-report %config shape] ~])
::
++ pa-friend :: subscribed update
|= sih=sign
^+ +>
?+ sih ~&([%rodeo-bad-friend sih] !!)
[%g %nice ~]
:: ~& %pa-friend-nice
+>.$
::
[%g %rust %rodeo-report *]
:: ~& [%pa-friend-report +>+.sih]
?+ -.+>+.sih ~&([%rodeo-odd-friend sih] !!)
%config +>.$
%group +>.$
%grams (pa-lesson q.+.+>+.sih)
==
==
::
++ pa-stalk :: subscribed present
|= [tay=station sih=sign]
^+ +>
?+ sih ~&([%rodeo-bad-friend sih] !!)
[%g %nice ~]
:: ~& %pa-stalk-nice
+>.$
::
[%g %rust %rodeo-report *]
?+ -.+>+.sih ~&([%rodeo-odd-friend sih] !!)
%group
(pa-remind tay +.+>+.sih)
==
==
::
++ pa-scrub :: pass forward
|= [ost=bone bub=(list (pair path note))]
%_ +>.$
moves
(welp (flop (turn bub |=(a=(pair path note) [ost %pass a]))) moves)
==
::
++ pa-sauce :: send backward
|= [ost=bone gub=(list gift)]
%_ +>.$
moves
(welp (flop (turn gub |=(a=gift [ost %give a]))) moves)
==
::
++ pa-abjure :: unsubscribe move
|= tal=(list station)
%+ pa-scrub 0
%- zing
%+ turn tal
|= tay=station
?- -.tay
%| ~& tweet-abjure/p.p.tay
!!
::
%& :: ~& [%pa-abjure [our.hid man] [p.p.tay q.p.tay]]
:~ :- /friend/nuke/[man]
[%g %nuke [p.p.tay /rodeo] our.hid]
:- /stalk/nuke/[man]
[%g %nuke [p.p.tay /rodeo] our.hid]
==
==
::
++ pa-acquire :: subscribe to
|= tal=(list station)
%+ pa-scrub 0
%- zing
%+ turn tal
|= tay=station
^- (list (pair path note))
=+ num=(fall (~(get by sequence) tay) 0)
?- -.tay
%| ~& tweet-acquire/p.p.tay
!!
::
%& ~& [%pa-acquire [our.hid man] [p.p.tay q.p.tay]]
:~ :- /friend/show/[man]
[%g %show [p.p.tay /rodeo] our.hid /af/[q.p.tay]/(scot %ud num)]
==
==
::
++ pa-reform :: reconfigure, ugly
|= cof=config
=+ ^= dif ^- (pair (list station) (list station))
=+ old=`(list station)`(~(tap in sources.shape) ~)
=+ new=`(list station)`(~(tap in sources.cof) ~)
:- (skip new |=(a=station (~(has in sources.shape) a)))
(skip old |=(a=station (~(has in sources.cof) a)))
=. +>.$ (pa-acquire p.dif)
=. +>.$ (pa-abjure q.dif)
=. shape cof
pa-monitor
::
++ pa-cancel :: unsubscribe from
^+ .
:: ~& [%pa-cancel ost]
=. guests (~(del in guests) ost)
(pa-sauce ost [[%mean ~] ~])
::
++ pa-notify :: local presence
|= [her=ship saz=status]
^+ +>
=+ guz=(~(get by locals) her)
=. locals (~(put by locals) her lat.hid saz)
?. |(?=(~ guz) !=(saz q.u.guz))
+>.$
(pa-display viewers)
::
++ pa-remind :: remote presence
|= [tay=station loc=atlas rem=(map station atlas)]
=+ ^= buk
=+ mer=(turn (~(tap by rem) ~) |=([* a=atlas] a))
|- ^- atlas
?~ mer loc
=. loc $(mer t.mer)
=+ dur=`(list (pair ship status))`(~(tap by i.mer) ~)
|- ^- atlas
?~ dur loc
=. loc $(dur t.dur)
=+ fuy=(~(get by loc) p.i.dur)
?~ fuy (~(put by loc) p.i.dur q.i.dur)
?: =(`presence`p.q.i.dur `presence`p.u.fuy)
loc
?- p.u.fuy
%gone (~(del by loc) p.i.dur q.i.dur)
%talk loc
%hear (~(put by loc) p.i.dur q.i.dur)
==
=+ gub=(~(get by remotes) tay)
:: ~& [%pa-remind tay gub buk]
?. |(?=(~ gub) !=(buk u.gub))
+>.$
=. remotes (~(put by remotes) tay buk)
(pa-display viewers)
::
++ pa-start :: start stream
|= riv=river
^+ +>
=- =. +>.$ (pa-sauce ost [[%rust %rodeo-report %grams q.lab r.lab] ~])
?: p.lab
(pa-sauce ost [[%mean ~] ~])
+>.$(guests (~(put by guests) ost riv))
^= lab
=+ [end=count gaz=grams dun=| zeg=*(list telegram)]
|- ^- (trel ,? ,@ud (list telegram))
?~ gaz [dun end (flop zeg)]
?: ?- -.q.riv :: after the end
%ud (lte p.q.riv end)
%da (lte p.q.riv p.r.q.i.gaz)
==
$(end (dec end), gaz t.gaz)
?: ?- -.p.riv :: before the start
%ud (lth end p.p.riv)
%da (lth p.r.q.i.gaz p.p.riv)
==
[dun end (flop zeg)]
$(end (dec end), gaz t.gaz, zeg [i.gaz zeg])
::
++ pa-listen :: subscribe
|= [her=ship pax=path]
^+ +>
=. +> (pa-watch her)
=. +> (pa-master her)
?. (pa-admire her)
(pa-sauce ost [[%mean ~ %rodeo-listen-unauthorized ~] ~])
=+ ^= ruv ^- (unit river)
?: ?=(~ pax)
`[[%ud count] [%da (dec (bex 128))]]
?: ?=([@ ~] pax)
=+ say=(slay i.pax)
?. ?=([~ %$ ?(%ud %da) @] say) ~
`[(point +>.say) [%da (dec (bex 128))]]
?. ?=([@ @ ~] pax) ~
=+ [say=(slay i.pax) den=(slay i.t.pax)]
?. ?=([~ %$ ?(%ud %da) @] say) ~
?. ?=([~ %$ ?(%ud %da) @] den) ~
`[(point +>.say) (point +>.den)]
:: ~& [%pa-listen her pax ruv]
?~ ruv
(pa-sauce ost [[%mean ~ %rodeo-malformed ~] ~])
(pa-start u.ruv)
::
++ pa-refresh :: update stream
|= [num=@ud gam=telegram]
:: ~& [%pa-refresh num gam]
=+ ^= 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)]
?: ?- -.q.q.n.guests :: after the end
%ud (lte p.q.q.n.guests num)
%da (lte p.q.q.n.guests p.r.q.gam)
==
[[p.n.guests p.old] [[p.n.guests %give %mean ~] q.old]]
?: ?- -.p.q.n.guests :: before the start
%ud (gth p.p.q.n.guests num)
%da (gth p.p.q.n.guests p.r.q.gam)
==
old
:- p.old
[[p.n.guests %give %rust %rodeo-report %grams num gam ~] q.old]
=. moves (welp q.moy moves)
|- ^+ +>.^$
?~ p.moy +>.^$
$(p.moy t.p.moy, guests (~(del by guests) i.p.moy))
::
++ pa-lesson :: learn multiple
|= gaz=(list telegram)
^+ +>
?~ gaz +>
$(gaz t.gaz, +> (pa-learn i.gaz))
::
++ pa-learn :: learn message
|= gam=telegram
^+ +>
?. (pa-admire p.gam)
~& %pa-admire-rejected
+>.$
=. q.q.gam (~(put by q.q.gam) [%& our.hid man] %received)
=+ old=(~(get by known) p.q.gam)
?~ old
(pa-append gam)
(pa-revise u.old gam)
::
++ pa-append :: append new
|= gam=telegram
^+ +>
%+ %= pa-refresh
grams [gam grams]
count +(count)
known (~(put by known) p.q.gam count)
==
count
gam
::
++ pa-revise :: revise existing
|= [num=@ud gam=telegram]
=+ way=(sub count num)
=. grams (welp (scag (dec way) grams) [gam (slag way grams)])
(pa-refresh num gam)
--
--
++ peer
|= [ost=bone her=ship pax=path]
^- [(list move) _+>]
:: ~& [%rodeo-peer ost her pax]
ra-abet:(~(ra-subscribe ra ost ~) her pax)
::
++ poke-rodeo-command
|= [ost=bone her=ship cod=command]
^- [(list move) _+>]
:: ~& [%rodeo-poke-command her cod]
ra-abet:(~(ra-apply ra ost ~) her cod)
::
++ pour
|= [ost=bone pax=path sih=*]
^- [(list move) _+>]
:: ~& sih=sih
=+ sih=((hard sign) sih)
:: ~& [%rodeo-pour ost pax sih]
?+ pax ~& [%rodeo-strange-path pax] !!
::
[%provoke ~] [~ +>.$]
[%time ~]
?> ?=(0 ost)
=^ moz +>.$ ra-abet:~(ra-timer ra 0 ~)
:_(+>.$ :_(moz [0 %pass /time %t %wait (add ~s10 lat.hid)]))
::
[%twitter *]
=- ra-abet:(~(ra-twitter ra ost ~) met sih)
^= met
?+ t.pax ~& [%rodeo-twitter-strange-path pax] !!
[%mine @ @ ~]
[i.t.pax i.t.t.t.pax]
[%stat @ ~]
[i.t.pax (slav %uv i.t.t.pax)]
==
::
[%friend *]
?> ?=([@ @ ~] t.pax)
?. =(%show i.t.pax)
~& [%pour-friend-nuke-nuke pax]
[~ +>.$]
ra-abet:(~(ra-friend ra ost ~) i.t.t.pax sih)
::
[%stalk *]
?> ?=([@ @ @ @ ~] t.pax)
?. =(%show i.t.pax)
~& [%pour-friend-nuke-nuke pax]
[~ +>.$]
=+ [man tay]=[i.t.t.pax [%& (slav %p i.t.t.t.pax) i.t.t.t.t.pax]]
ra-abet:(~(ra-stalk ra ost ~) man tay sih)
::
[%repeat *]
?> ?=([@ @ @ ~] t.pax)
=+ [num her man]=[(slav %ud i.t.pax) (slav %p i.t.t.pax) i.t.t.t.pax]
ra-abet:(~(ra-repeat ra ost ~) num her man sih)
==
::
++ pull
|= ost=bone
^- [(list move) _+>]
:: ~& [%rodeo-pull ost]
ra-abet:~(ra-cancel ra ost ~)
::
++ poke-bit
|= [ost=bone you=ship ~]
^- [(list move) _+>]
:_ +>.$
=+ paf=/(scot %p our.hid)/try/(scot %da lat.hid)/rodeo/backlog/jam
[ost %pass /jamfile %c %info our.hid (foal paf (jam +<+.+>.$))]~
::
++ prep
|= old=(unit (unit house-any))
^- [(list move) _+>]
?> ?=(^ old)
=+ moz=`(list move)`[0 %pass /time %t %wait (add ~s10 lat.hid)]~
|-
?~ u.old
=+ paf=/(scot %p our.hid)/try/(scot %da lat.hid)/rodeo/backlog/jam
?. ?=([%0 %0 %0] [.^(%cy paf)])
$(u.old (some ((hard house-any) (cue ((hard ,@) .^(%cx paf))))))
~& %rodeo-prep-new
ra-abet:~(ra-init ra 0 moz)
~& %rodeo-prep-old
:- moz
|-
?- -.u.u.old
%1 %_(+>.^^$ +<+ u.u.old)
%0 $(u.u.old [%1 (house-0-to-house-1 +.u.u.old)])
==
::
++ house-0-to-house-1
|= vat=house-0
^- house-1
=- :* stories=-
general=~
outbox=[0 ~]
sent=~
folks=~
==
^- (map span story)
=- %- ~(run by -)
|= grams=(list telegram)
^- story
:* count=(lent grams)
grams=grams
locals=~
remotes=~
sequence=~
shape=[.(cordon [%| ~])]:*config
^= known %- mo ^- (list ,[serial @]) =< +
(roll grams |=([telegram a=@ b=(list ,[serial @])] [+(a) [a p.q] b]))
guests=~
viewers=~
owners=~
==
^- (map span (list telegram))
%- mo %+ turn (~(tap by vat))
|= [a=path b=(list zong) c=(map ship ,?)]
=+ ^= par
?: =(/ a) 'hub'
=+ (turn a |=(d=span leaf/(trip d)))
(crip ~(ram re %rose ["_" ~ ~] -))
:- par
=+ aud=`audience`[[[%& our.hid par] %received] `~]
=+ ^= spe
|= r=_r:*zong ^- speech
?- -.r
%say [%lin %& p.r]
%do [%lin %| p.r]
%exp [%fat [%tank q.r ~] [%exp p.r]]
==
%+ turn b
|= d=zong ^- telegram
[q.d (sham eny.hid d) aud p.d (spe r.d)]
--

View File

@ -64,6 +64,7 @@
[%comt ~] :: comment
[%var p=term q=twig] :: set variable
[%rvar p=term] :: unset variable
[%help p=term] :: info about command
== ::
++ sign ::
$% $: %g ::
@ -116,6 +117,7 @@
(stag %del ;~(pfix hep ace loca))
(stag %mut ;~(pfix col ace ;~(plug loca expg)))
(stag %ins ;~(pfix lus ace ;~(plug loca (opts expg))))
(stag %help ;~(pfix wut ace ;~(pfix col sym)))
(stag %path (full ;~(sfix loca(pax paf) (star ace))))
(stag %var ;~(plug ;~(pfix tis sym) expg))
(stag %rvar ;~(pfix ;~(plug tis tis) sym))
@ -139,7 +141,7 @@
::
--
--
!:
::
:::: per event
::
|%
@ -157,12 +159,11 @@
+>.$(mow (welp mof mow))
::
++ chew-file
|= [paf=path msg=tape tor=(unit toro)]
|= [paf=path mor=$|(cord toro)]
^- (list move)
%+ welp
(print palm/[" " ~ ~ ~]^~[leaf/msg (dank:ut paf)])
%+ turn (drop tor)
|=(a=toro [ost %pass writ/paf %c %info our.hid a])
?@ mor
(print palm/[" " ~ ~ ~]^~[leaf/(trip mor) (dank:ut paf)])
[ost %pass writ/paf %c %info our.hid mor]~
::
++ cubs :: tasks with open /in
%- sort :_ |=([a=span b=span] (lth (slav %ud a) (slav %ud b)))
@ -185,6 +186,7 @@
%hoon (eat-hoon +.com)
%ins (eat-ins +.com)
%mut (eat-mut +.com)
%help (eat-help +.com)
%path (eat-path +.com)
%run (eat-run you +.com)
%rvar (eat-rvar +.com)
@ -194,11 +196,10 @@
++ eat-del
|= paf=path
^+ +>
=. &3.paf '='
%- blab
%+ chew-file paf
?^ (file paf) ["! none" ~]
["deleted" `(fray paf)]
?~ (file paf) '! none'
(fray paf)
::
++ eat-end :: XX clean up state
|= poc=(each ,@u cord)
@ -231,21 +232,34 @@
++ eat-ins
|= [paf=path gen=(unit twig)]
^+ +>
=. &3.paf '='
%- blab
%+ chew-file paf
?^ (file paf) ["! exists" ~]
:- "written"
`(foal paf %$ (exec (fall gen [%bczp atom/%t])))
?^ (file paf) '! exists'
(foal paf %$ (exec (fall gen [%bczp atom/%t])))
::
++ eat-mut
|= [paf=path gen=twig]
^+ +>
=. &3.paf '='
%- blab
%+ chew-file paf
?^ (file paf) ["! none" ~]
["changed" `(foal paf %$ (exec gen))]
?~ (file paf) '! none'
(foal paf %$ (exec gen))
::
++ eat-help
|= app=term
^+ +>
%- blab %- print
^- tank
=+ rup=/(scot %p our.hid)/main/(scot %da lat.hid)
=+ paf=`path`(welp rup /app/[app]/core/hook)
=+ src=(file paf)
?. ?=([~ @t] src)
leaf/"app {<app>} does not exist"
=+ cot=;~(pfix col col (plus ace) (star prn))
=+ led=(cot 1^1 (trip u.src))
?^ q.led
leaf/":: {(wonk led)}"
palm/[" " ``~]^~[leaf/"no leading comment in" >paf<]
::
++ eat-path
|= paf=path
@ -257,9 +271,9 @@
|= [you=ship mud=(list mand) mad=mand]
^+ +>
:: =. +>.$ (blab (print leaf/"+ :{(trip p.mad)}"))
?: .= [0 0 0]
+:[.^(%cy /(scot %p our.hid)/main/(scot %da lat.hid)/app/[p.mad])]
(blab (print leaf/"{<p.mad>} does not exist"))
?. =- (~(has by r:(arch -)) %core)
+:.^(%cy /(scot %p our.hid)/main/(scot %da lat.hid)/app/[p.mad])
(blab (print leaf/"app {<p.mad>} does not exist"))
=| inp=(unit span)
=< +>.$
%+ reel
@ -464,7 +478,7 @@
!>([%rush %term-line `term-line`[prompt [a]~ ~]])
--
--
!:
::
:::: formal interface
::
|_ [hid=hide vat=axle]

View File

@ -1,5 +1,8 @@
!:
::::
::
|_ [hid=hide ~]
++ peer ,_`.
++ poke-solid-args
|= [ost=bone you=ship ~]
:_ +>.$
@ -35,8 +38,4 @@
[ost %pass / %g %cide %$]
[ost %give %nice ~]
==
++ peer
|=
*
`+>
--

View File

@ -1,19 +1,16 @@
:: Desk sync
::
:::: /hook/core/sync/app
::
/+ sh-utils
!:
::::
::
|_ [hid=hide ~]
++ poke-sync-args
|= [ost=bone you=ship syd=@tas her=@p sud=@tas ~]
:_ +>.$
:* [ost %pass /sync %c %font our.hid syd her sud]
[ost %pass / %g %cide %$]
[ost %give %nice ~]
%+ turn (~(tap by sup.hid))
|= [ost=bone *]
:^ ost %give %rush
:- %tang :_ ~
leaf/"synced"
==
++ peer
|=
*
`+>
++ peer ,_`.
++ poke--args
%+ gate-bang
|= [syd=@tas her=@p sud=@tas ~]
[%c %font our.hid syd her sud]
(args-into-gate . ,_[%txt 'synced'])
--

File diff suppressed because it is too large Load Diff

View File

@ -63,11 +63,6 @@
::
|%
++ aut %shell
++ encode
|= [a=term b=path] ^- span
(rap 3 a (turn b |=(c=span (cat 3 '_' c))))
::
++ decode |=(a=span `[p=term q=path]`(rash a (most cab sym)))
++ inject
|= [a=[i=mane t=(list mane)] b=marl]
|= man=manx
@ -80,7 +75,7 @@
++ start-shell
|= [our=ship imp=path ost=bone you=ship pax=path]
^- (list move)
=+ auc=(encode aut pax)
=+ auc=(pack aut pax)
:- [ost %pass [%fork pax] %g %sire [aut auc]]
[ost %pass [%resp pax] %g %show [our [auc imp]] you /out]~
--
@ -91,7 +86,7 @@
++ se
|= [hid=hide ost=bone you=ship hiz=(map path term-line) pax=path]
=+ tel=(fall (~(get by hiz) pax) *term-line)
=+ auc=(encode aut pax)
=+ auc=(pack aut pax)
=^ mow tel
?: (~(has by cub.hid) auc)
[~ tel]
@ -124,11 +119,11 @@
?- gal
%term [ost %give %rust %hymn page] :: hymn front end
%lines [ost %give %rust %term-line tel] :: term-line output
==
==
==
::
++ poke
|= jof=$%([%line p=span] [%res p=span] [%cmd p=char] [%type p=?])
|= jof=$%([%line p=cord] [%res p=span] [%cmd p=char] [%type p=?])
^+ +>
?- -.jof
%res :: restart shell
@ -212,7 +207,7 @@
^- (list move)
%+ murn (~(tap by cub.hid))
|= [p=span q=term]
?. =(pax q:(decode p)) ~
?. =(p auc) ~
%- some ^- move
:^ ost %pass [-.mez pax]
[%g %mess [our.hid p imp.hid] you mez]

View File

@ -3,7 +3,7 @@
:::: /hook/hymn/front/twit/app
::
/? 314 :: need urbit 314
/= urbit /:/===/lib/urb:/hymn/ :: urbit library (js)
/= urbit /:/===lib/urb:/hymn/ :: urbit library (js)
/= style /:/%%%/style:/hymn/ :: stylesheet (css)
/= application /:/%%%/app:/hymn/ :: application (js)
!:

View File

@ -1,8 +1,12 @@
/+ sh-utils
!:
::::
::
|_ [hid=hide ~]
++ peer ,_`.
++ poke-ticket-args
|= [ost=bone you=ship her=@p num=?(~ [p=@ud ~])]
:_ +>.$
%+ args-into-gate .
|= [her=@p num=?(~ [p=@ud ~])]
=+ n=?~(num 1 p.num)
=+ ^= sep ^- @
=+ mir=(clan her)
@ -11,25 +15,10 @@
%duke (bex 16)
%earl (bex 32)
==
:* [ost %pass / %g %cide %$]
[ost %give %nice ~]
|-
?: ?=(0 n) ~
=+ ^= tic
(,@p .^(%a (scot %p our.hid) %tick (scot %da lat.hid) (scot %p her) ~))
%+ welp
(spam ost "{<her>}: {<tic>}")
$(her (add sep her), n (dec n))
==
++ spam
|= [ost=bone msg=tape]
%+ turn (~(tap by sup.hid))
|= [ost=bone *]
:^ ost %give %rush
:- %tang :_ ~
leaf/msg
++ peer
|=
*
`+>
:- %tang
|- ^- (list tank)
?: ?=(0 n) ~
=+ tic=/(scot %p our.hid)/tick/(scot %da lat.hid)/(scot %p her)
:- leaf/"{<her>}: {<(,@p .^(%a tic))>}"
$(her (add sep her), n (dec n))
--

26
main/app/tree/core.hook Normal file
View File

@ -0,0 +1,26 @@
:: Tree view recursive directory contents
::
:::: /hook/core/tree/app
::
/+ sh-utils
!:
::::
::
|_ [hid=hide ~]
++ peer ,_`.
++ poke--args
%+ args-into-gate .
|= [pax=path fla=$|(~ [%full ~])]
=+ len=(lent pax)
=+ rend=?^(fla dank:ut |=(a=path (dank:ut (slag len a))))
:- %tang
|- ^- (list tank)
=+ ark=;;(arch +:.^(cy/pax))
=- ?~ q.ark -
[(rend pax) -]
%- zing
%+ turn
(sort (~(tap by r.ark)) aor)
|= [a=@t ~]
^$(pax (welp pax /[a]))
--

19
main/app/type/core.hook Normal file
View File

@ -0,0 +1,19 @@
:: Type, render tpyes of arguments
::
:::: /hook/core/type/app
::
/+ sh-utils
!:
::::
::
|_ [hide ~]
++ peer ,_`.
++ pock--args
%+ args-into-gate .
|= a=vase
:- %tang %- flop
|- ^- (list tank)
=+ nex=(slew 3 a)
?~ nex ~
[(skol p:(slot 2 a)) $(a u.nex)]
--

View File

@ -1,19 +1,16 @@
:: Desk unsync
::
:::: /hook/core/unsync/app
::
/+ sh-utils
!:
::::
::
|_ [hid=hide ~]
++ poke-unsync-args
|= [ost=bone you=ship syd=@tas her=@p sud=@tas ~]
:_ +>.$
:* [ost %pass /sync %c %plug our.hid syd her sud]
[ost %pass / %g %cide %$]
[ost %give %nice ~]
%+ turn (~(tap by sup.hid))
|= [ost=bone *]
:^ ost %give %rush
:- %tang :_ ~
leaf/"unsynced"
==
++ peer
|=
*
`+>
++ peer ,_`.
++ poke--args
%+ gate-bang
|= [syd=@tas her=@p sud=@tas ~]
[%c %plug our.hid syd her sud]
(args-into-gate . ,_[%txt 'unsynced'])
--

View File

@ -1,14 +1,12 @@
:: Verb: toggle verbose mode
::
:::: /hook/core/verb/app
::
/+ sh-utils
!:
::::
::
|_ [hid=hide ~]
++ poke-verb-args
|= [ost=bone you=ship ~]
:_ +>.$
:~ [ost %give %verb ~]
[ost %pass / %g %cide %$]
[ost %give %nice ~]
==
++ peer
|=
*
`+>
++ peer ,_`.
++ poke--args (add-resp [%give %verb ~] (args-done ,_`.))
--

View File

@ -2,6 +2,10 @@
::
:::: /hook/gate/ye/bin
::
/+ sh-utils
::
::::
::
|%
++ sign ::
$% $: %a ::
@ -12,37 +16,32 @@
[%text p=tape] ::
== ::
--
::
!:
::::
::
|_ [hid=hide ~]
++ poke-ye-args
|= [ost=bone you=ship tex=tape ~]
:_ +>.$
=+ mez=(crip "{<our.hid>}: {tex}")
:~ [ost %pass /ye %a %want [our.hid (sein our.hid)] /q/ye mez]
[ost %give %nice ~]
==
++ peer ,_`.
++ poke--args
%+ gate-bang
|= [tex=tape ~]
=+ mez=(crip "{<our.hid>}: {tex}")
[%a %want [our.hid (sein our.hid)] /q/ye mez]
%+ add-resp [%give %nice ~]
,_`.
::
++ poke-txt
|= [ost=bone him=ship cor=@t]
:_ +>.$
~[[ost %give %nice ~] [ost %pass /de %d %flog %text "> {(trip cor)}"]]
%+ add-resp [%give %nice ~]
%+ gate-bang |=(cor=@t [%d %flog `flog`[%text "> {(trip cor)}"]])
,_`.
::
++ pour
|= [ost=bone pax=path sih=sign]
?> ?=([%ye ~] pax)
:_ +>.$
:- [ost %pass / %g %cide %$]
%+ turn (~(tap by sup.hid))
|= [ost=bone *]
:^ ost %give %rush
:- %tang :_ ~
?. ?=(%good q.sih)
leaf/"ye failed"
leaf/"ye received"
?> ?=([%bang ~] pax)
%. +<
%- add-exit
%^ add-output +>.$
=+ ack=?+(q.sih "failed" %good "recieved")
rush/tang/[leaf/"ye {ack}"]~
,_`+>.$
::
++ peer
|=
*
`+>
--

19
main/lib/rodeo/core.hook Normal file
View File

@ -0,0 +1,19 @@
::
:::: /hook/core/rodeo/lib
::
:: This file is in the public domain.
::
/? 314
/- *rodeo
::
::::
::
|%
++ main :: main story
|= our=ship ^- cord
=+ can=(clan our)
?+ can %porch
%czar %court
%king %floor
==
--

View File

@ -0,0 +1,83 @@
:: App construction utilities
::
:::: /hook/core/sh-utils/lib
::
|%
++ append
|* a=*
|* b=*
[b a]
--
::
::::
::
|%
++ args-done |*(ref=_,[(list) ^] (add-exit (add-nice ref))) :: accept args
::
++ add-exit :: add "kill self" kiss
|* ref=_,[(list) ^]
%+ add-resp [%pass / %g %cide %$]
ref
::
++ add-nice :: return "succcess" response
|* ref=_,[(list) ^]
%+ add-resp [%give %nice ~]
ref
::
++ args-into-gate :: poke--args from gate: output and exit
|* [con=[* [hide *] *] gat=_,[@ *]]
%- args-done
%^ gate-outs con
|=(a=_+<.gat [%rush (gat a)])
,_`con
::
++ args-into-resp :: compute gifts with gate and exit
|* [con=[* [hide *] *] gat=_,(pole ,[@ *])]
%- args-done
|* [ost=bone * arg=_+<.gat]
:_ con
%. (gat arg)
|* a=(pole ,[@ *])
?~ a ~
a(- [ost %give -.a], + $(a +.a))
::
++ add-output :: send gift to /out
|* [con=[* [hide *] *] ote=[@ *] ref=_,[(list) ^]]
=> .(+<-.con `hid=hide`+<-.con)
=+ sus=(~(tap in `(set bone)`(~(get ju pus.hid.con) /out)))
=+ mof=(turn sus (append [%give ote]))
|= _+<.ref
=+ neu=(ref +<)
neu(- (welp mof -.neu))
::
++ add-resp :: add response move to requesting bone
|* [mof=[@ @ *] ref=_,[(list) ^]]
|* [ost=bone _?@(+<.ref ~ +<+.ref)]
=+ neu=(ref +<)
neu(- [[ost mof] -.neu])
::
++ gate-give :: respond with computed gift
|* [gat=_,[@ *] ref=_,[(list) ^]]
(gate-move |*(_+<.gat [%give (gat +<)]) ref)
::
++ gate-bang :: respond with computed note
|* [gat=_,[@ @ *] ref=_,[(list) ^]]
(gate-move |*(_+<.gat [%pass /bang (gat +<)]) ref)
::
++ gate-move :: respond with computed move
|* [gat=_,(mold) ref=_,[(list) ^]]
|* [ost=bone * arg=_+<.gat]
((add-resp (gat arg) ref) +<)
::
++ gate-outs :: send computed gift to /out
|* [con=[* [hide *] *] gat=_,[@ *] ref=_,[(list) ^]]
|* [ost=bone * arg=_+<.gat]
((add-output con (gat arg) ref) +<)
::
++ verify :: type-check with context and move
|* [con=^ mof=[@ *]]
|* ref=_,[(list ,_mof) _con]
|* _+<.ref
^- [(list ,_mof) _con]
(ref +<)
--

View File

@ -91,12 +91,15 @@ window.urb.unsubscribe = function(params,cb) {
window.urb.util = {
toDate: function (dat){
var mils = Math.floor((0x10000 * dat.getUTCMilliseconds()) / 1000).toString(16)
function pad(num, str){
return ((new Array(num + 1)).join('0') + str).substr(-num,num)
}
return '~' + dat.getUTCFullYear() +
'.' + (dat.getUTCMonth() + 1) +
'.' + dat.getUTCDate() +
'..' + dat.getUTCHours() +
'.' + dat.getUTCMinutes() +
'.' + dat.getUTCSeconds() +
'..' + ('0000' + mils).substr(-4, 4)
'..' + pad(2, dat.getUTCHours()) +
'.' + pad(2, dat.getUTCMinutes()) +
'.' + pad(2, dat.getUTCSeconds()) +
'..' + pad(4, mils)
}
}

View File

@ -19,14 +19,6 @@
ping/auri
==
|%
++ op :: parse keys of map
|* [fel=_rule wit=fist]
%+ cu mo
%- ci :_ (om wit)
|= a=(map cord ,_(need *wit))
^- (unit (list ,_[(wonk *fel) (need *wit)]))
(zl (turn (~(tap by a)) (head-rush fel)))
::
++ as :: array as set
:: |*(a=fist (cu sa (ar a))) :: XX types
|* a=fist
@ -41,14 +33,6 @@
%. tub
;~(pose (stag %& -.a) (stag %| +.a))
::
++ head-rush
|* a=_rule
|* [b=cord c=*]
=+ nit=(rush b a)
?~ nit ~
(some [u.nit c])
::
::
++ thot
^- $+(json (unit thought))
%- ot :~

View File

@ -0,0 +1,91 @@
::
:::: /hook/door/rodeo-command/mar
::
/? 314
/- *rodeo
!:
|_ cod=command
::
++ grab :: convert from
|%
++ noun command :: clam from %noun
++ json
=> [jo ..command]
|= a=json ^- command
=- (need ((of -) a))
=< :~ publish/(ar thot)
review/(ar thot)
design/(ot party/so config/(mu conf) ~)
ping/auri
==
|%
++ op :: parse keys of map
|* [fel=_rule wit=fist]
%+ cu mo
%- ci :_ (om wit)
|= a=(map cord ,_(need *wit))
^- (unit (list ,_[(wonk *fel) (need *wit)]))
(zl (turn (~(tap by a)) (head-rush fel)))
::
++ as :: array as set
:: |*(a=fist (cu sa (ar a))) :: XX types
|* a=fist
%- cu :_ (ar a)
~(gas in *(set ,_(need *a)))
::
++ lake |*(a=_,* $+(json (unit a)))
++ peach
|* a=_[rule rule]
|= tub=nail
^- (like (each ,_(wonk (-.a)) ,_(wonk (+.a))))
%. tub
;~(pose (stag %& -.a) (stag %| +.a))
::
++ head-rush
|* a=_rule
|* [b=cord c=*]
=+ nit=(rush b a)
?~ nit ~
(some [u.nit c])
::
::
++ thot
^- $+(json (unit thought))
%- ot :~
serial/(ci (slat %uv) so)
audience/audi
statement/stam
==
::
++ audi (op stati (ci (soft delivery) so)) :: audience
++ auri (op stati (ci (soft presence) so))
::
++ stati
^- $+(nail (like station))
%+ peach
;~((glue fas) ;~(pfix sig fed:ag) urs:ab)
%+ sear (soft partner)
;~((glue fas) sym urs:ab) :: XX [a-z0-9_]{1,15}
::
++ 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) ~)
==
::
::
++ conf
^- $+(json (unit config))
%- ot :~
sources/(as (su stati))
:- %cordon
%+ cu |*(a=^ ?~(-.a a a)) :: XX do type stuff
(ot white/bu list/(as (su fed:ag)) ~)
==
--
-- --

View File

@ -0,0 +1,93 @@
::
:::: /hook/door/rodeo-report/mar
::
/? 314
/- *rodeo
!:
|_ 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 (grop +.rep)
%group (jobe local/(grop p.rep) global/%.(q.rep (jome stan grop)) ~)
==
++ joce |=(a=span [%s a])
++ jope |=(a=ship (jape +:<a>)) ::[%s (crip +:(scow %p a))])
++ 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)])
::
::
++ grop (jome phon stas) :: (map ship status)
++ phon |=(a=ship (scot %p a))
++ stas |=(status (jobe presence/(joce p) human/(huma q) ~))
++ gram |=(telegram (jobe ship/(jope p) thought/(thot q) ~))
++ thot
|= thought
(jobe serial/(jape <p>) audience/(audi q) statement/(stam r) ~)
::
++ audi (jome stan joce)
++ stan
|= a=station ^- cord
%- crip
?~ -.a "{<p.p.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]
%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] ~)
==
::
++ 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
==
--
-- --

View File

@ -13,7 +13,7 @@
%- need
%. jon => jo
%^ ot
pax/(su ;~(pfix fas (more fas sym)))
pax/(su ;~(pose (cold ~ (full fas)) (plus ;~(pfix fas urs:ab))))
act/(of line/so res/so cmd/so ~)
~
++ noun term-in :: clam from %noun

70
main/sur/rodeo/core.hook Normal file
View File

@ -0,0 +1,70 @@
::
:::: /hook/core/rodeo/sur
::
|%
++ ache |*([a=$+(* *) b=$+(* *)] $%([| p=b] [& p=a])) :: PM 314
++ audience (map station delivery) :: destination/state
++ atlas (map ship status) :: presence map
++ command :: effect on party
$% [%design (pair span (unit config))] :: configure/destroy
[%publish (list thought)] :: originate
[%review (list thought)] :: deliver
[%ping (map station presence)] :: declare status
== ::
++ config :: party configuration
$: sources=(set station) :: pulls from
cordon=control :: & white, | black
== ::
++ cousin (pair ship span) :: domestic flow
++ control (ache (set ship) (set ship)) :: & white, | black
++ delivery :: delivery state
$? %pending :: undelivered
%received :: delivered
%rejected :: undeliverable
%released :: sent one-way
%accepted :: fully processed
== ::
++ human :: human identifier
$: true=(unit (trel ,@t (unit ,@t) ,@t)) :: true name
hand=(unit ,@t) :: handle
== ::
++ partner :: foreign flow
$% [%twitter p=@t] :: twitter
== ::
++ presence ?(%gone %hear %talk) :: status type
++ register (pair atlas (map station atlas)) :: ping me, ping srcs
++ report :: unified rush/rust
$% [%house (set span)] :: meta-changes
[%grams (pair ,@ud (list telegram))] :: beginning, thoughts
[%group register] :: presence
[%config config] :: reconfigure
== ::
++ speech :: narrative action
:: XX unify %own and %say to %lin
::
$% [%lan p=span q=@t] :: local announce
[%own p=@t] :: XX @ or /me
[%exp p=@t] :: hoon line
[%non ~] :: no content
[%ext p=@tas q=*] :: extended action
[%fat p=torso q=speech] :: attachment
:: [%inv p=station] :: invite to station
[%ire p=serial q=speech] :: in-reply-to
[%lin p=? q=@t] :: no=@, text line
[%mor p=(list speech)] :: XX deleteme
[%say p=@t] :: XX normal line
== ::
++ serial ,@uvH :: unique identity
++ station (each cousin partner) :: interlocutor
++ status (pair presence human) :: participant
++ statement (pair ,@da speech) :: when this
++ telegram (pair ship thought) :: who which whom what
++ thought (trel serial audience statement) :: which whom what
++ torso :: attachment
$% [%text (list ,@t)] :: text lines
[%tank (list tank)] :: tank list
== ::
:: markdown
:: image
:: mime object
--

View File

@ -1,6 +1,6 @@
$: pax=path ::
$= jof ::
$% [%line p=span] ::
$% [%line p=cord] ::
[%res p=span] ::
[%cmd p=char] ::
[%type p=?] ::