From 9f222877913ce383d547be625ce38d71d683387e Mon Sep 17 00:00:00 2001 From: "C. Guy Yarvin" Date: Tue, 16 Sep 2014 17:29:12 -0700 Subject: [PATCH] Merges and bugfixes. --- arvo/ames.hoon | 6 +- arvo/clay.hoon | 64 +-- arvo/eyre.hoon | 74 +-- arvo/ford.hoon | 2 +- arvo/hoon.hoon | 3 +- arvo/zuse.hoon | 510 ++++++++++----------- main/app/chat/core.hook | 4 +- main/bin/update.hoon | 2 +- main/pub/src/doc/ref/vol/4c.md | 801 ++++++++++++++++++++++++++------- try/bin/merge.hoon | 2 +- 10 files changed, 941 insertions(+), 527 deletions(-) diff --git a/arvo/ames.hoon b/arvo/ames.hoon index 2a6b744582..0d5f096baa 100644 --- a/arvo/ames.hoon +++ b/arvo/ames.hoon @@ -439,7 +439,7 @@ vix=(bex +((cut 0 [25 2] mag))) :: width of sender tay=(cut 0 [27 5] mag) :: message type == - ?> =(7 vez) + ?> =(1 vez) ?> =(chk (end 0 20 (mug bod))) :+ [(end 3 wix bod) (cut 3 [wix vix] bod)] (kins tay) @@ -459,7 +459,7 @@ =+ tay=(ksin q.kec) %+ mix %+ can 0 - :~ [3 7] + :~ [3 1] [20 (mug bod)] [2 yax] [2 qax] @@ -1047,7 +1047,7 @@ ++ gnaw :: gnaw:am |= [kay=cape ryn=lane pac=rock] :: process packet ^- [p=(list boon) q=fort] - ?. =(7 (end 0 3 pac)) [~ fox] + ?. =(1 (end 0 3 pac)) [~ fox] =+ kec=(bite pac) ?: (goop p.p.kec) [~ fox] ?. (~(has by urb.ton.fox) q.p.kec) diff --git a/arvo/clay.hoon b/arvo/clay.hoon index 71ca2ed349..243dd3ad45 100644 --- a/arvo/clay.hoon +++ b/arvo/clay.hoon @@ -20,7 +20,7 @@ [%wart p=sock q=@tas r=path s=*] :: network request [%warp p=sock q=riff] :: file request == :: -++ moot ,[p=case q=case r=path s=(map path lobe)] :: +++ moot ,[p=case q=case r=path s=(map path lobe)] :: stored change range ++ move ,[p=duct q=(mold note gift)] :: local move ++ nako $: gar=(map ,@ud tako) :: new ids let=@ud :: next id @@ -75,7 +75,7 @@ hez=(unit duct) :: sync duch dos=(map desk dojo) :: native desk == :: -++ rove (each mood moot) :: +++ rove (each mood moot) :: stored request ++ rung $: rus=(map desk rede) :: neighbor desks == :: -- => @@ -121,14 +121,14 @@ !! =+ ezy=?~(ref ~ (~(get by haw.u.ref) mun)) ?^ ezy ezy - =+ nao=(~(aeon ze lim dom ran) q.mun) + =+ nao=(~(case-to-aeon ze lim dom ran) q.mun) :: ~& [%aver-mun nao [%from syd lim q.mun]] - ?~(nao ~ [~ (~(avid ze lim dom ran) u.nao mun)]) + ?~(nao ~ [~ (~(read-at-aeon ze lim dom ran) u.nao mun)]) :: ++ balk :: read and send - |= [hen=duct oan=@ud mun=mood] + |= [hen=duct yon=@ud mun=mood] ^+ +> - =+ vid=(~(avid ze lim dom ran) oan mun) + =+ vid=(~(read-at-aeon ze lim dom ran) yon mun) ?~ vid (blub hen) (blab hen mun u.vid) :: ++ blab :: ship result @@ -137,7 +137,7 @@ +>(byn [[hen ~ [p.mun q.mun syd] r.mun dat] byn]) :: ++ bleb :: ship sequence - |= [hen=duct ins=@ud hip=*] + |= [hen=duct ins=@ud hip=nako] ^+ +> (blab hen [%w [%ud ins] ~] hip) :: @@ -211,19 +211,19 @@ (blab hen p.rav u.u.ver) :: | - =+ nab=(~(aeon ze lim dom ran) p.p.rav) + =+ nab=(~(case-to-aeon ze lim dom ran) p.p.rav) ?~ nab - ?> =(~ (~(aeon ze lim dom ran) q.p.rav)) - ~! [%um rav] + ?> =(~ (~(case-to-aeon ze lim dom ran) q.p.rav)) (duce hen (rive rav)) - =+ huy=(~(aeon ze lim dom ran) q.p.rav) + =+ huy=(~(case-to-aeon ze lim dom ran) q.p.rav) ?: &(?=(^ huy) |((lth u.huy u.nab) &(=(0 u.huy) =(0 u.nab)))) (blub hen) =+ top=?~(huy let.dom u.huy) - =+ sar=(~(apax ze lim dom ran) u.nab r.p.rav) - =+ ear=(~(apax ze lim dom ran) top r.p.rav) - =. +>.$ ?: =(sar ear) +>.$ - =+ fud=(~(gack ze lim dom ran) u.nab top) + =+ sar=(~(lobes-at-path ze lim dom ran) u.nab r.p.rav) + =+ ear=(~(lobes-at-path ze lim dom ran) top r.p.rav) + =. +>.$ + ?: =(sar ear) +>.$ + =+ fud=(~(make-nako ze lim dom ran) u.nab top) (bleb hen u.nab fud) ?^ huy (blub hen) @@ -263,7 +263,7 @@ ++ edit :: apply changes |= [wen=@da lem=nori] ^+ +> - =+ axe=(~(axel ze lim dom ran) wen lem) + =+ axe=(~(edit ze lim dom ran) wen lem) =+ `[l=@da d=dome r=rang]`+<.axe +>.$(dom d, ran r) :: @@ -276,7 +276,7 @@ lat.ran %+ roll (~(tap in bar.nak) ~) =< .(yeb lat.ran) |= [sar=blob yeb=(map lobe blob)] - =+ zax=(zaax sar) + =+ zax=(blob-to-lobe sar) %+ ~(put by yeb) zax sar hut.ran %+ roll (~(tap in lar.nak) ~) =< .(yeb hut.ran) @@ -303,7 +303,8 @@ %- ~(got by hut.ran) %- ~(got by hit.dom) let.dom - =. ank.dom (~(azel ze lim dom ran) hed) :: real checkout + =. ank.dom :: real checkout + (~(checkout-ankh ze lim dom ran) hed) (echa:wake hen wen mer) :: notify or w/e :: ++ knit :: external change @@ -337,8 +338,9 @@ =+ nex=(~(get by haw.u.ref) nez) ?~ nex +>+.^$ ?~ u.nex +>+.^$ :: should never happen - =. +>+.^$ =+ roo=(edis ((hard nako) u.u.nex)) - ?>(?=(^ ref.roo) roo) + =. +>+.^$ + =+ roo=(edis ((hard nako) u.u.nex)) + ?>(?=(^ ref.roo) roo) %= $ haw.u.ref (~(del by haw.u.ref) nez) == @@ -370,33 +372,35 @@ ..wake ?~ u.cas (blub p.i.xiq) (blab p.i.xiq p.q.i.xiq u.u.cas) == - =+ nao=(~(aeon ze lim dom ran) q.p.q.i.xiq) + =+ nao=(~(case-to-aeon ze lim dom ran) q.p.q.i.xiq) ?~ nao $(xiq t.xiq, xaq [i.xiq xaq]) $(xiq t.xiq, ..wake (balk p.i.xiq u.nao p.q.i.xiq)) :: | =+ mot=`moot`p.q.i.xiq - =+ nab=(~(aeon ze lim dom ran) p.mot) + =+ nab=(~(case-to-aeon ze lim dom ran) p.mot) ?~ nab $(xiq t.xiq, xaq [i.xiq xaq]) - =+ huy=(~(aeon ze lim dom ran) q.mot) + =+ huy=(~(case-to-aeon ze lim dom ran) q.mot) ?~ huy =+ ptr=[%ud +(let.dom)] %= $ xiq t.xiq xaq [[p.i.xiq [%| ptr q.mot r.mot s.mot]] xaq] - ..wake =+ ear=(~(apax ze lim dom ran) let.dom r.p.q.i.xiq) + ..wake =+ ^= ear + (~(lobes-at-path ze lim dom ran) let.dom r.p.q.i.xiq) ?: =(s.p.q.i.xiq ear) ..wake - =+ fud=(~(gack ze lim dom ran) u.nab let.dom) - (bleb p.i.xiq let.dom ear) + =+ fud=(~(make-nako ze lim dom ran) u.nab let.dom) + (bleb p.i.xiq let.dom fud) == %= $ xiq t.xiq ..wake =- (blub:- p.i.xiq) - =+ ear=(~(apax ze lim dom ran) u.huy r.p.q.i.xiq) - ?: =(s.p.q.i.xiq ear) ..wake - =+ fud=(~(gack ze lim dom ran) u.nab u.huy) - (bleb p.i.xiq +(u.nab) ear) + =+ ^= ear + (~(lobes-at-path ze lim dom ran) u.huy r.p.q.i.xiq) + ?: =(s.p.q.i.xiq ear) (blub p.i.xiq) + =+ fud=(~(make-nako ze lim dom ran) u.nab u.huy) + (bleb p.i.xiq +(u.nab) fud) == == -- diff --git a/arvo/eyre.hoon b/arvo/eyre.hoon index 5437ed8a1c..232eb4bf88 100644 --- a/arvo/eyre.hoon +++ b/arvo/eyre.hoon @@ -773,69 +773,11 @@ == :: ^= fac - 0w89.wgGV4.jAl90.00003.sV4OG.IJjfa.1vYpi.gRxB9.3m6kA.dopig. - RxB93.m6kAd.opigR.xB93m.6kAdo.pigRx.B93m6.kAdop.igRxB.93m6k. - Adopi.gRxBf.vGSfy.m8hQj.T-DiD.7kqvH.vEpA3.3vH-C.in~Tq.l8U0n. - 1FVhj.w9E1A.NIF6w.4j9v~.VZ0~B.9flkB.IY90B.-ieSV.Ky8Q~.4~07s. - JcXFC.DtI-1.GGz-1.V-olV.g3wsv.ZCQM1.BJbVj.Vwiv0.uo7Gh.4qsxA. - 92ZYU.tJ5uH.yiIzV.FwvJR.UUq6z.cpKIG.Hck9v.qGDm1.PY2rM.itxLB. - fn0Bo.5DO8x.oO7KE.kYh-P.NiKp1.HT88j.Mu3ZK.ciKsU.TnlkV.0Zo77. - 12ciy.nY3dM.7nDnY.GVgGh.ZllpO.SFHFb.p1Ae0.uUpXV.eqFvS.pkBRl. - jv0MP.ilRHP.1HwtK.GFptt.2KdpP.RsYqI.wRHEG.j~LZQ.I06qJ.fP0Pp. - 77qjo.s0PU0.rGGg6.lgNvc.~CZE~.bSp9j.EGHF~.UqYB6.l4Y~Z.P~GGE. - LwrJs.ZvYV-.U4Wh4.04dws.6HeuZ.2ZF7A.y4MN5.3vsCj.QHzjW.4lflk. - WU6X0.AmMws.vbMfB.3e1s~.aeE7W.0hQPH.ODvMf.cvgzb.Y15Ah.01384. - YwVPT.KzILB.PlaqN.pNlvw.fdQ79.~mPpo.YaHqw.fnWGB.QYM4F.w3E0b. - 0o~n-.faydD.zlllI.0nU3D.w5rlI.4nrSG.VkhPM.NTkpa.eoXzw.9AEYN. - auZGt.99gxL.8RlsI.aXMXX.tFVhX.V4kj8.yczjh.faRI3.JTg1H.-0uZM. - JA6rR.z0~pO.uXiSg.rvU27.A58MU.TBijQ.23F1J.CCIYE.IO8w-.cMlMA. - hvKh4.zY16M.gjRlk.v--9h.TNNRR.HhIGo.8kZXk.Wb74j.faHlk.6V-Vw. - jMan8.yb37R.Q2h42.Or3Nw.Pp39w.jZ--3.-jwZH.U~3Za.Uu0u6.bNAOP. - U2jux.Jqo2R.O8x1~.ecZvL.30ug~.qpoFw.vwtqD.Vb6EI.cZQyO.EN-xl. - nlsLC.dT099.apOh5.SEeDz.07-GE.xFzZk.KcmCl.SJWF5.v3u1x.Uq1Cj. - tV~hG.YuGGb.SgpdR.xHaBh.S3eEv.q0mSg.RZh8s.wxhnk.EcNvW.GccZQ. - yO0Jb.n18hs.BLFx2.iigqf.AhsKS.LWqby.TUEmv.gmmhR.6DW3w.uLR0Y. - QQBC8.YoQ63.g8m8i.iq3B-.SxwLn.jLbh3.l7cq3.eVQmV.5O2df.SXBkv. - Y3LLb.denQq.GvR0R.P3Gh4.2iiq2.h-srW.o0ZZ-.HIrdj.npm5n.pnv07. - vyT77.43WGP.Bciiq.zt1cI.7A4xB.zK9xm.-tV6x.ZdA6P.pheXQ.aSz4X. - Zj2bS.C1UPx.~c1dS.xwF3b.6jZ-M.WI2eQ.e69Qw.DGFly.tTze-.GGbZU. - qJ-m-.fD8yI.Adktz.oqTsF.F7ltA.6no6T.~fWJU.0gRsp.-P88x.a9I9b. - Adkvz.ory8J.Ouhfu.H8c-U.2HLgE.Wi4xH.3AEGK.VjkS-.Z5hMx.UN5o~. - Y~EWp.7LGox.IQxpt.cgONH.CEyKJ.jjTdM.GJ9HL.RloJZ.xuRtL.JZ7jg. - ZZj6w.2AOoM.CENdS.xxegZ.RzTdh.i-1hZ.N1HPF.EqHU0.XzN6K.mBedG. - uvBiL.HqpmY.Bl9z2.qzqA8.WzKqz.h~S1J.K2QHQ.Dy-CM.7RO0l.QksW3. - mpFnx.fy-Pa.p7xhW.SboOd.fOBon.mCgSX.Z38Qe.dMHUC.79wje.wziG5. - 6Xtn7.ksEHO.xkBrO.e7yFe.vNaYx.FgDsI.BS9y8.AELs-.C9-DB.FAZI-. - wKt2N.8qQhA.Apxm7.O5yIB.X51l9.Kduxm.SRA5N.UYi6I.MrySX.RZXrT. - 8UcY2.zUAfu.SOcUK.vZrDL.vBAHb.eOo~N.7J3sR.eJhSo.4~YE1.5k0h5. - 51RqS.b0jyR.RfhON.4Dt07.idahL.5isLK.eeBv3.znQxC.9LXkE.xKghP. - Ia-R0.AgmB5.pGGIA.slCGu.CtR5q.NrzHh.1bscz.8CsWC.KH4it.LLrWm. - UlRdr.lUGji.W76xr.kVAmO.6oAYS.7nXX~.kfeM2.TSS2m.JOCAb.sFFWg. - 4xH3C.MDKh4.FZso1.tXwUJ.Taq5K.8yS24.xHr4M.Kvu~E.HTpka.-Zg3f. - KEXFS.qCKwh.l1KRN.c9H8A.HFcSw.rePCF.Iy93m.njkMZ.IEyiq.lFq3y. - gRFzg.uL9tz.zP8du.Y1ZWP.PtQ6G.gzIt5.K8hNz.UAdpM.Q43L6.IMHx5. - N8qPh.EfX8G.UC~68.S93ms.d18Vh.adkOx.GLkTI.khFcL.ZWG5G.Adoeh. - hx~As.hci6I.Uq2pG.ykqHO.yUAdq.gQ7FD.4sOjn.IwGGw.UAdqo.Q4jVN. - eJP8c.xQlm~.8nJ1y.gRF3g.oSPAM.fuqE0.M~23y.gRHyo.gngjF.ceM3n. - V~uQy.93m-9.xa-3N.T80~v.GzR-g.HqBGA.mi4xH.3AMOL.mCjT5.Blqab. - 60ruw.HDV~k.Tj~fX.Swx8u.ZFOoi.m1GUF.Gs4-q.0kfxh.H8yjt.OCXGL. - PYGTY.23LgI.Wl4x6.8bI3e.MXeVb.h6rL9.DXWyt.8wJ8W.HalWR.itqp3. - pkrSC.8bQSM.HLV2J.G7sCj.QtGEi.AkSwI.A4P0J.gJ85j.MuMUY.nkT45. - -rkqv.BFBFU.KGd98.qRs~A.iblOv.mVKWx.Z19cs.AxHc6.UIKJc.NIHW8. - EnOEy.fygRG.29bbR.FBDVL.Ter6T.SBKat.MFBPE.AfuO9.kBHV~.QstE-. - VaYNV.qpfhL.sFHj0.eFphG.U6Hw6.EsVox.7kpks.N6bRk.GMLY~.HWBVj. - Snx6X.0GY2b.GhzmW.udfRF.jTgLC.uPWGL.fIwM6.16Ah4.NFZjz.Ftln7. - KQ-k-.0SO8H.xrqcw.MXZG9.6BZsJ.zULJU.NPDy3.aewMa.3auiA.Ysei3. - YQJGB.PlCAQ.S5YPU.uGEtI.wQrw1.cy8Sd.bFYuX.GGWZS.DSq1Y.O8ELq. - cR6kA.dopig.RxB93.m6kAd.opigR.xB93m.6kAdo.pigRx.B93m6.kAdop. - igRxB.93m6k.Adopi.gRxB9.3m6kA.doSsI.1Tves.7Fb5l.hneus.VDLsZ. - ~P3DD.D~CpI.BALPA.rxSTT.fuXa4.gP3Yv.sPKOY.KSMKP.balqk.xjbEH. - idkbq.Elo0N.dHjkM.vEBiq.BC-Rb.IKMiB.JiaoS.x3mLy.Jr6P5.ToiS2. - gAz4y.qNHiI.k7WIl.9EJGb.iJ2Tp.NQ5H5.VpSni.By-OX.TfvYs.plRic. - rpPJD.7xkgk.h9BMw.001EY.XFJDs.CYKpn.1xoTd.HrCAK.tTtT0.6lOon. - tQpCZ.jt5x5.t1A00.01UCO.x20ts.d003n.3g00s.RB8s0.A0002.8p0xY. - 20w82.5h9gD.c4000.0l9ny.s0000.0o8p0.0006g.0001i.h4x93.g0000. - Eq2wR.7jB29 + 0w89wg.GV4jA.l9000.00dPb.YzBT6.giO00.o100d.wZcqc.a9tg-.VTG0b. + AUIvE.HBM3g.cK4SE.0aagi.l090p.I1P5g.Y-80r.y1YS9.1xE~Y.qgpFY. + vKN1V.905y0.2UwvL.43TUw.uL406.0-31h.xwoJF.Ul454.ilk00.00Yps. + BNumh.xpl9B.pS5Ji.i1BoC.ZAgg1.BsC5T.t6pLk.Thohn.gp000.0ov~P. + 7M000.0o840.00010.0001i.h4x93.g0000.Eq2wR.7jB29 == :: ++ huff :: request by ship @@ -1125,7 +1067,7 @@ ?> ?=(%way pez.u.pup) $(yov t.yov, q.rey (~(put by q.rey) i.yov u.pup(pez noz))) :: - ++ duty |= [our=ship nap=@ud you=ship orx=oryx] :: interface script + ++ duty |= [nap=@ud you=ship] :: interface script ^- cord %^ cat 3 %- crip @@ -1133,9 +1075,9 @@ :~ [%ship (jape |1:)] [%port (jone nap)] + [%oryx %s orx.ced] [%auto %b %&] [%user (jape |1:)] - [%oryx %s orx] == ''' window.urb.seqn_u = 0 @@ -2036,7 +1978,7 @@ ++ hark |= num=@ud ^- [(unit pimp) _+>] - =. +>.$ abet:(busk:(yule %nil) num _@ ~ %& %js !>((duty our nap you orx.ced))) + =. +>.$ abet:(busk:(yule %nil) num _@ ~ %& %js !>((duty nap you))) [`(need (~(get by q.rey) num)) +>.$] :: ++ harp diff --git a/arvo/ford.hoon b/arvo/ford.hoon index 98fe283114..40aaa5cf44 100644 --- a/arvo/ford.hoon +++ b/arvo/ford.hoon @@ -438,7 +438,7 @@ ?. ?=([%$ ?(%da %ud %tas) *] a) ~ [~ u=(^case a)] :: - ++ hath (cook plex:voz (stag %clsg poor:voz)) :: hood path + ++ hath (sear plex:voz (stag %clsg poor:voz)) :: hood path ++ have (sear tome ;~(pfix fas hath)) :: hood beam ++ hood %+ ifix [gay gay] diff --git a/arvo/hoon.hoon b/arvo/hoon.hoon index 87fa1d0a31..ccc7865b3e 100644 --- a/arvo/hoon.hoon +++ b/arvo/hoon.hoon @@ -28,7 +28,8 @@ ++ axis ,@ :: tree address ++ also ,[p=term q=wing r=type] :: alias ++ base ?([%atom p=odor] %noun %cell %bean %null) :: axils, @ * ^ ? ~ -++ bean ,? :: 0=&=yes, 1=|=no +++ bean ,? :: default to yes +++ bane $?(%| %&) :: default to no ++ beer $|(@ [~ p=twig]) :: simple embed ++ beet $| @ :: advanced embed $% [%a p=twig] :: diff --git a/arvo/zuse.hoon b/arvo/zuse.hoon index ef6151ec5f..6ada5eaf2f 100644 --- a/arvo/zuse.hoon +++ b/arvo/zuse.hoon @@ -996,7 +996,7 @@ :: section 3bE, tree sync :: :: :: -++ cure :: invert miso +++ invert-miso :: invert miso |= mis=miso ?- -.mis %del [%ins p.mis] @@ -1005,15 +1005,15 @@ == :: ++ cosh :: locally rehash - |= ank=ankh - ank(p dash:(zu ank)) + |= ank=ankh :: NB v/unix.c + ank(p rehash:(zu ank)) :: ++ cost :: new external patch - |= [bus=ankh ank=ankh] + |= [bus=ankh ank=ankh] :: NB v/unix.c ^- soba :- [p.ank p.bus] %- flop - myz:(dist:(zu ank) %c bus) + myz:(change-tree:(zu ank) %c bus) :: ++ loth |= pat=(map path ,*) @@ -1027,7 +1027,7 @@ ^- (set path) (~(uni in (loth p)) (loth q)) :: -++ zaax :: p.blob +++ blob-to-lobe :: p.blob |= p=blob ^- lobe ?- -.p @@ -1036,19 +1036,11 @@ %indirect p.p == :: -++ qeel :: trim ankh - |= p=ankh - ^- ankz - :- 0 - ^- (map ,@ta ankz) - %- ~(tur by r.p) - |= [pat=@ta ank=ankh] - ^- ankz - ^$(p ank) -:: ++ ze |_ [lim=@da dome rang] - ++ zoal :: make yaki + ++ aeon-to-tako ~(got by hit) + ++ aeon-to-yaki (cork aeon-to-tako tako-to-yaki) + ++ make-yaki :: make yaki |= [p=(list tako) q=(map path lobe) t=@da] ^- yaki =+ ^= has @@ -1056,45 +1048,29 @@ (sham [%tako (roll p add) q t]) [p q has t] :: - ++ zaal :: grab blob - |= p=lobe :: (raw) - ^- blob - (~(got by lat) p) - :: - ++ zaul :: grab blob + ++ tako-to-yaki ~(got by hut) :: grab yaki + ++ lobe-to-blob ~(got by lat) :: grab blob + ++ lobe-to-noun :: grab blob |= p=lobe :: ^- * - %- zaru - (zaal p) + %- blob-to-noun + (lobe-to-blob p) :: - ++ zaru :: grab blob - |= p=blob - ?- -.p - %delta (lump r.p (zaul q.p)) - %direct q.p - %indirect q.p - == + ++ make-direct :: make blob + |= [p=* q=umph] + ^- blob + [%direct (mug p) p q] :: - ++ zeol :: make blob delta + ++ make-delta :: make blob delta |= [p=lobe q=udon] ^- blob =+ t=[%delta 0 p q] - =+ z=(zaru t) + =+ z=(blob-to-noun t) =+ ^= has %^ cat 7 (sham [%blob z]) (sham [%lobe z]) [%delta has p q] :: - ++ zeul :: make blob - |= [p=* q=umph] - ^- blob - [%direct (mug p) p q] - :: - ++ zamp :: grab yaki - |= p=tako - ^- yaki - (need (~(get by hut) p)) - :: - ++ zump :: blob umph [prep] + ++ blob-to-umph :: blob umph [prep] |= p=blob :: used in merge ^- umph ?- -.p @@ -1103,41 +1079,47 @@ %indirect p.r.p == :: + ++ blob-to-noun :: grab blob + |= p=blob + ?- -.p + %delta (lump r.p (lobe-to-noun q.p)) + %direct q.p + %indirect q.p + == :: :: :: - ++ zerg :: fundamental diff + ++ diff-yakis :: fundamental diff |= [p=yaki q=yaki] ^- (map path miso) %+ roll (~(tap in (luth q.p q.q)) ~) |= [pat=path yeb=(map path miso)] =+ leb=(~(get by q.p) pat) =+ lob=(~(get by q.q) pat) - ?~ leb (~(put by yeb) pat [%ins (zaul (need lob))]) - ?~ lob (~(put by yeb) pat [%del (zaul (need leb))]) + ?~ leb (~(put by yeb) pat [%ins (lobe-to-noun (need lob))]) + ?~ lob (~(put by yeb) pat [%del (lobe-to-noun (need leb))]) ?: =(u.leb u.lob) yeb - =+ veq=(zaal u.leb) - =+ voq=(zaal u.lob) + =+ veq=(lobe-to-blob u.leb) + =+ voq=(lobe-to-blob u.lob) %+ ~(put by yeb) pat :- %mut - ?: &(?=(%delta -.voq) =(u.leb q.voq)) :: avoid diff + ?: &(?=(%delta -.voq) =(u.leb q.voq)) :: avoid diff r.voq - =+ zeq=(zaru veq) - =+ zoq=(zaru voq) - ((diff (zump (zaal u.leb))) zeq zoq) + =+ zeq=(blob-to-noun veq) + =+ zoq=(blob-to-noun voq) + ((diff (blob-to-umph (lobe-to-blob u.leb))) zeq zoq) :: - ++ apax :: apax:ze - |= [oan=@ud pax=path] :: data at path + ++ lobes-at-path :: lobes-at-path:ze + |= [yon=aeon pax=path] :: data at path ^- (map path lobe) - ?: =(0 oan) ~ + ?: =(0 yon) ~ %- mo %+ skim %. ~ %~ tap by =< q - %- ~(got by hut) - %- ~(got by hit) - oan + %- aeon-to-yaki + yon |= [p=path q=lobe] ?| ?=(~ pax) ?& !?=(~ p) @@ -1145,18 +1127,17 @@ $(p +.p, pax +.pax) == == :: - ++ aeon :: aeon:ze + ++ case-to-aeon :: case-to-aeon:ze |= lok=case :: act count through - ^- (unit ,@ud) + ^- (unit aeon) ?- -.lok %da ?: (gth p.lok lim) ~ - |- ^- (unit ,@ud) + |- ^- (unit aeon) ?: =(0 let) [~ 0] :: avoid underflow ?: %+ gte p.lok =< t - %- ~(got by hut) - %- ~(got by hit) + %- aeon-to-yaki let [~ let] $(let (dec let)) @@ -1165,7 +1146,7 @@ %ud ?:((gth p.lok let) ~ [~ p.lok]) == :: - ++ ache :: ache:ze + ++ as-arch :: as-arch:ze ^- arch :: arch report :+ p.ank ?~(q.ank ~ [~ p.u.q.ank]) @@ -1173,49 +1154,50 @@ ?~ r.ank ~ [[p.n.r.ank ~] $(r.ank l.r.ank) $(r.ank r.r.ank)] :: - ++ zule :: reachable - |= p=tako :: XX slow + ++ reachable-takos :: reachable + |= p=tako :: XX slow ^- (set tako) - =+ y=(~(got by hut) p) + =+ y=(tako-to-yaki p) =+ t=(~(put in _(set tako)) p) %+ roll p.y |= [q=tako s=_t] - ?: (~(has in s) q) :: already done - s :: hence skip - (~(uni in s) ^$(p q)) :: otherwise traverse + ?: (~(has in s) q) :: already done + s :: hence skip + (~(uni in s) ^$(p q)) :: otherwise traverse :: - ++ garg :: object hash set - |= [b=(set lobe) a=(set tako)] :: that aren't in b + ++ new-lobes :: object hash set + |= [b=(set lobe) a=(set tako)] :: that aren't in b ^- (set lobe) %+ roll (~(tap in a) ~) |= [tak=tako bar=(set lobe)] ^- (set lobe) - =+ yak=(need (~(get by hut) tak)) + =+ yak=(tako-to-yaki tak) %+ roll (~(tap by q.yak) ~) |= [[path lob=lobe] far=_bar] ^- (set lobe) - ?~ (~(has in b) lob) :: don't need + ?~ (~(has in b) lob) :: don't need far - =+ gar=(need (~(get by lat) lob)) + =+ gar=(lobe-to-blob lob) ?- -.gar %direct (~(put in far) lob) %delta (~(put in $(lob q.gar)) lob) %indirect (~(put in $(lob s.gar)) lob) == - ++ garf :: garg & repack + :: + ++ new-lobes-takos :: garg & repack |= [b=(set lobe) a=(set tako)] ^- [(set tako) (set lobe)] - [a (garg b a)] + [a (new-lobes b a)] :: - ++ pack - |= [a=(unit tako) b=tako] :: pack a through b + ++ reachable-between-takos + |= [a=(unit tako) b=tako] :: pack a through b ^- [(set tako) (set lobe)] =+ ^= sar ?~ a ~ - (zule r:(need (~(get by hut) u.a))) - =+ yak=`yaki`(need (~(get by hut) b)) - %+ garf (garg ~ sar) :: get lobes - |- ^- (set tako) :: walk onto sar + (reachable-takos r:(tako-to-yaki u.a)) + =+ yak=`yaki`(tako-to-yaki b) + %+ new-lobes-takos (new-lobes ~ sar) :: get lobes + |- ^- (set tako) :: walk onto sar ?: (~(has in sar) r.yak) ~ =+ ber=`(set tako)`(~(put in `(set tako)`~) `tako`r.yak) @@ -1224,73 +1206,72 @@ %+ roll p.yak |= [yek=tako bar=(set tako)] ^- (set tako) - ?: (~(has in bar) yek) :: save some time + ?: (~(has in bar) yek) :: save some time bar %- ~(uni in bar) - ^$(yak (need (~(get by hut) yek))) + ^$(yak (tako-to-yaki yek)) :: - ++ hack :: trivial - |= [a=(set tako) b=(set lobe)] - ^- [(set yaki) (set blob)] - :- %- sa %+ turn (~(tap by a) ~) - |= tak=tako - (need (~(get by hut) tak)) - %- sa %+ turn (~(tap by b) ~) - |= lob=lobe - (need (~(get by lat) lob)) + ++ takos-to-yakis :: trivial + |= a=(set tako) + ^- (set yaki) + (sa (turn (~(tap by a)) tako-to-yaki)) :: - ++ gack :: gack a through b - |= [a=@ud b=@ud] - ^- [(map ,@ud tako) @ud (set yaki) (set blob)] + ++ lobes-to-blobs :: trivial + |= a=(set lobe) + ^- (set blob) + (sa (turn (~(tap by a)) lobe-to-blob)) + :: + ++ make-nako :: gack a through b + |= [a=aeon b=aeon] + ^- [(map aeon tako) aeon (set yaki) (set blob)] :_ :- b - %- hack - %+ pack - (~(get by hit) a) :: if a not found, a=0 - %- need (~(get by hit) b) - ^- (map ,@ud tako) + =- [(takos-to-yakis -<) (lobes-to-blobs ->)] + %+ reachable-between-takos + (~(get by hit) a) :: if a not found, a=0 + (aeon-to-tako b) + ^- (map aeon tako) %- mo %+ skim (~(tap by hit) ~) - |= [p=@ud *] + |= [p=aeon *] &((gth p a) (lte p b)) :: :::::::::::::::::::::::::::::::::::::::::::::::::::::::: - ++ amor :: amor:ze + ++ query :: query:ze |= ren=?(%u %v %x %y %z) :: endpoint query ^- (unit ,*) ?- ren - %u [~ `rang`+<+>.amor] - %v [~ `dome`+<+<.amor] + %u [~ `rang`+<+>.query] + %v [~ `dome`+<+<.query] %x ?~(q.ank ~ [~ q.u.q.ank]) - %y [~ ache] + %y [~ as-arch] %z [~ ank] == :: - ++ argo :: argo:ze - |= oan=@ud :: rewind to aeon + ++ rewind :: rewind:ze + |= yon=aeon :: rewind to aeon ^+ +> - ?: =(let oan) +> - ?: (gth oan let) !! :: don't have this version - +>(ank (azel q:(~(got by hut) (~(got by hit) oan))), let oan) + ?: =(let yon) +> + ?: (gth yon let) !! :: don't have version + +>(ank (checkout-ankh q:(aeon-to-yaki yon)), let yon) :: :::: - ++ aqel :: aqel:ze - |= [lag=(map path blob) sta=(map lobe blob)] :: fix lat - ^- [(map lobe blob) (map path lobe)] - %+ roll (~(tap by lag) ~) - |= [[pat=path bar=blob] [lut=_sta gar=(map path lobe)]] - ?~ (~(has by lut) p.bar) - [lut (~(put by gar) pat p.bar)] - :- (~(put by lut) p.bar bar) - (~(put by gar) pat p.bar) + ++ update-lat :: update-lat:ze + |= [lag=(map path blob) sta=(map lobe blob)] :: fix lat + ^- [(map lobe blob) (map path lobe)] + %+ roll (~(tap by lag) ~) + |= [[pat=path bar=blob] [lut=_sta gar=(map path lobe)]] + ?~ (~(has by lut) p.bar) + [lut (~(put by gar) pat p.bar)] + :- (~(put by lut) p.bar bar) + (~(put by gar) pat p.bar) :: - ++ azal :: azal:ze + ++ apply-changes :: apply-changes:ze |= lar=(list ,[p=path q=miso]) :: store changes ^- (map path blob) =+ ^= hat :: current state ?: =(let 0) :: initial commit ~ :: has nothing =< q - %- need %- ~(get by hut) - %- need %- ~(get by hit) + %- aeon-to-yaki let %- |= bar=(map path blob) :: find unchanged =+ sar=(sa (turn lar |=([p=path *] p))) :: changed paths @@ -1298,7 +1279,7 @@ |= [[pat=path gar=lobe] bat=_bar] ?: (~(has in sar) pat) :: has update bat - (~(put by bat) pat (need (~(get by lat) gar))) :: use original + (~(put by bat) pat (lobe-to-blob gar)) :: use original %+ roll lar |= [[pat=path mys=miso] bar=(map path blob)] ^+ bar @@ -1306,7 +1287,7 @@ %ins :: insert if not exist ?: (~(has by bar) pat) !! :: ?: (~(has by hat) pat) !! :: - (~(put by bar) pat (zeul p.mys %c)) :: TODO content type? + (~(put by bar) pat (make-direct p.mys %c)) :: TODO content type? %del :: delete if exists ?. |((~(has by hat) pat) (~(has by bar) pat)) !! (~(del by bar) pat) @@ -1316,11 +1297,11 @@ =+ har=(~(get by hat) pat) ?~ har !! %+ ~(put by bar) pat - (zeol u.har p.mys) + (make-delta u.har p.mys) %+ ~(put by bar) pat - (zeol p.u.ber p.mys) + (make-delta p.u.ber p.mys) == - ++ azel :: azel:ze + ++ checkout-ankh :: checkout-ankh:ze |= hat=(map path lobe) :: checkout commit ^- ankh %- cosh @@ -1329,7 +1310,7 @@ ^- ankh %- cosh ?~ pat - =+ zar=(zaul bar) + =+ zar=(lobe-to-noun bar) ank(q [~ (sham zar) zar]) =+ nak=(~(get by r.ank) i.pat) %= ank @@ -1337,31 +1318,32 @@ $(pat t.pat, ank (fall nak _ankh)) == :: - ++ azol :: azol:ze + ++ forge-yaki :: forge-yaki:ze |= [wen=@da par=(unit tako) lem=soba] :: forge yaki =+ ^= per ?~ par ~ ~[u.par] - =+ gar=(aqel (azal q.lem) lat) - :- %^ zoal per +.gar wen :: from existing diff + =+ gar=(update-lat (apply-changes q.lem) lat) + :- %^ make-yaki per +.gar wen :: from existing diff -.gar :: fix lat :: - ++ azul :: azul:ze + ++ forge-nori :: forge-nori:ze |= yak=yaki :: forge nori (ugly op) ^- nori :: basically zerg w/ nori ?~ p.yak !! :: no parent -> can't diff - [%& [*cart (~(tap by (zerg (zamp i.p.yak) yak)) ~)]]:: diff w/ 1st parent + :+ %& *cart :: diff w/ 1st parent + (~(tap by (diff-yakis (tako-to-yaki i.p.yak) yak)) ~) :: :: graph algorithms (bottleneck) :: - ++ zear :: reduce merge points + ++ reduce-merge-points :: reduce merge points |= unk=(set yaki) :: maybe need jet =| gud=(set yaki) =+ ^= zar ^- (map tako (set tako)) %+ roll (~(tap in unk) ~) |= [yak=yaki qar=(map tako (set tako))] - (~(put by qar) r.yak (zule r.yak)) + (~(put by qar) r.yak (reachable-takos r.yak)) |- ^- (set yaki) ?~ unk gud @@ -1375,10 +1357,10 @@ $(gud (~(put in gud) tek), unk bun) $(unk bun) :: - ++ zeas :: merge points fast + ++ future-find-merge-points :: merge points fast |= [p=yaki q=yaki] :: (future zeal) ^- (set yaki) :: zear still uses zule - %- zear :: this is test-only + %- reduce-merge-points :: this is test-only =+ s=(~(put in _(set tako)) r.p) :: not actually used =+ t=(~(put in _(set tako)) t.p) :: but might be active =| u=(set yaki) :: eventually @@ -1390,39 +1372,37 @@ |= [tak=tako bar=_s zar=_t] [(~(del in bar) tak) (~(del in zar) tak)] ?: &(=(~ s.qez) =(~ s.qez)) - (~(uni in u) (zeaz v)) - $(u (~(uni in u) (zeaz v)), s (zeat s.qez), t (zeat t.qez)) + (~(uni in u) (takos-to-yakis v)) + %= $ + u (~(uni in u) (takos-to-yakis v)) + s (add-parents s.qez) + t (add-parents t.qez) + == :: - ++ zeaz - |= qez=(set tako) - ^- (set yaki) - %- sa %+ turn (~(tap in qez) ~) - |= tak=tako - (~(got by hut) tak) - ++ zeat :: expand set + ++ add-parents :: expand set |= qez=(set tako) ^- (set tako) %+ roll (~(tap in qez) ~) |= [tak=tako zar=(set tako)] %- ~(uni in (~(put in zar) tak)) - (sa p:(~(got by hut) tak)) + (sa p:(tako-to-yaki tak)) :: - ++ zeal :: merge points + ++ find-merge-points :: merge points |= [p=yaki q=yaki] :: maybe need jet ^- (set yaki) - %- zear - =+ r=(zule r.p) + %- reduce-merge-points + =+ r=(reachable-takos r.p) |- ^- (set yaki) ?: (~(has in r) q) (~(put in _(set yaki)) q) :: done %+ roll p.q |= [t=tako s=(set yaki)] ?: (~(has in r) t) - (~(put in s) (~(got by hut) t)) :: found - (~(uni in s) ^$(q (~(got by hut) t))) :: traverse + (~(put in s) (tako-to-yaki t)) :: found + (~(uni in s) ^$(q (tako-to-yaki t))) :: traverse :: :: merge logic :: - ++ qael :: clean + ++ clean :: clean |= wig=(urge) ^- (urge) ?~ wig ~ @@ -1435,28 +1415,19 @@ $(wig [[%| (welp p.i.wig p.i.t.wig) (welp q.i.wig q.i.t.wig)] t.t.wig]) [i.wig $(wig t.wig)] :: - ++ qaul :: check no delete - |= wig=(urge) - ^- ? - ?~ wig %.y - ?- -.i.wig - %& %.n - %| ?: =(p.i.wig 0) - $(wig t.wig) - %.n - == - ++ quax :: match conflict + ++ match-conflict :: match conflict |= [us=[ship desk] th=[ship desk] p=(urge) q=(urge) r=(list)] ^- [p=[p=(list) q=(list)] q=[p=(urge) q=(urge) r=(list)]] =+ cas=(hard (list ,@t)) =+ cat=(hard (urge ,@t)) - =+ mar=(qear (cat p) (cat q) (cas r)) + =+ mar=(match-merge (cat p) (cat q) (cas r)) :- :- s.q.mar - (quis us th p.p.mar q.p.mar s.q.mar) :: annotation + (annotate us th p.p.mar q.p.mar s.q.mar) :: annotation :- p.q.mar :- q.q.mar r.q.mar - ++ quis :: annotate conflict + :: + ++ annotate :: annotate conflict |= [us=[ship desk] th=[ship desk] p=(list ,@t) q=(list ,@t) r=(list ,@t)] ^- (list ,@t) %- zing @@ -1482,11 +1453,17 @@ +.th ~ :: - ++ qear :: match merge + ++ match-merge :: match merge |= [p=(urge ,@t) q=(urge ,@t) r=(list ,@t)] :: resolve conflict =| s=[p=(list ,@t) q=(list ,@t)] :: p chunk =| t=[p=(list ,@t) q=(list ,@t)] :: q chunk - |- ^- [p=[p=(list ,@t) q=(list ,@t)] q=[p=(urge ,@t) q=(urge ,@t) r=(list ,@t) s=(list ,@t)]] + |- ^- $: p=[p=(list ,@t) q=(list ,@t)] + $= q + $: p=(urge ,@t) + q=(urge ,@t) + r=(list ,@t) + s=(list ,@t) + == == ?~ p [[q.s q.t] p q r p.s] :: can't be conflict ?~ q [[q.s q.t] p q r p.s] :: can't be conflict ?- -.i.p @@ -1527,7 +1504,8 @@ ?. (lth (lent p.i.p) (lent p.i.q)) =+ mar=$(p q, q p, s t, t s) :: swap recursion [[q.p.mar p.p.mar] q.q.mar p.q.mar r.q.mar s.q.mar] - ?> =((slag (sub (lent p.i.q) (lent p.i.p)) p.i.q) p.i.p) :: sane conflict + ?> .= p.i.p :: sane conflict + (slag (sub (lent p.i.q) (lent p.i.p)) p.i.q) %= $ :: extend p p t.p p.s (welp p.i.p p.s) @@ -1547,8 +1525,8 @@ ?> ?=(%mut -.q) ?> ?=(%c -.q.p.p) ?> ?=(%c -.q.p.q) - =+ s=(qael p.q.p.p) - =+ t=(qael p.q.p.q) + =+ s=(clean p.q.p.p) + =+ t=(clean p.q.p.q) :- %mut :- %c :: todo is this p.p.p? :- %c @@ -1576,7 +1554,7 @@ $(t t.t, p.i.s (sub p.i.s (lent p.i.t)), r (slag (lent p.i.t) r)) ?. con ~| %quil-conflict !! :: conflict ~& [%quil-conflict-soft pat] - =+ mar=(quax us th s t r) + =+ mar=(match-conflict us th s t r) [[%| p.mar] $(s p.q.mar, t q.q.mar, r r.q.mar)] == %| @@ -1584,21 +1562,29 @@ %| ?. con ~| %quil-conflict !! ~& [%quil-conflict-soft pat] - =+ mar=(quax us th s t r) + =+ mar=(match-conflict us th s t r) [[%| p.mar] $(s p.q.mar, t q.q.mar, r r.q.mar)] %& ?: =(p.i.t (lent p.i.s)) [i.s $(s t.s, t t.t, r (slag p.i.t r))] ?: (gth p.i.t (lent p.i.s)) - [i.s $(s t.s, p.i.t (sub p.i.t (lent p.i.s)), r (slag (lent p.i.s) r))] + :- i.s + $(s t.s, p.i.t (sub p.i.t (lent p.i.s)), r (slag (lent p.i.s) r)) ?. con ~| %quil-conflict !! ~& [%quil-conflict-soft pat] - =+ mar=(quax us th s t r) + =+ mar=(match-conflict us th s t r) [[%| p.mar] $(s p.q.mar, t q.q.mar, r r.q.mar)] == == ++ quil :: merge p,q - |= [us=[ship desk] th=[ship desk] pat=path p=(unit miso) q=(unit miso) r=(unit (list)) con=?] + |= $: us=[ship desk] + th=[ship desk] + pat=path + p=(unit miso) + q=(unit miso) + r=(unit (list)) + con=? + == ^- (unit miso) ?~ p q :: trivial ?~ q p :: trivial @@ -1608,7 +1594,7 @@ %- some :- %ins %- roly - %- quis + %- annotate :- us :- th :- (lore ((hard ,@) p.u.p)) @@ -1626,8 +1612,8 @@ ++ meld :: merge p,q from r |= [p=yaki q=yaki r=yaki con=? us=[ship desk] th=[ship desk]] ^- (map path blob) - =+ s=(zerg r p) - =+ t=(zerg r q) + =+ s=(diff-yakis r p) + =+ t=(diff-yakis r q) =+ lut=(luth s t) %- |= res=(map path blob) :: add old ^- (map path blob) @@ -1638,7 +1624,7 @@ |= [pat=path bar=lobe] ^- ? (~(has in lut) pat) :: skip updated |= [pat=path bar=lobe] ^- [path blob] - [pat (zaal bar)] :: lookup objects + [pat (lobe-to-blob bar)] :: lookup objects %+ roll (~(tap in (luth s t)) ~) |= [pat=path res=(map path blob)] =+ ^= v @@ -1650,20 +1636,20 @@ :_ con %- %- lift lore %- %- lift %- hard ,@ :: for %c - %- %- lift zaul + %- %- lift lobe-to-noun %- ~(get by q.r) pat ?- -.v %del res :: no longer exists %ins :: new file %+ ~(put by res) pat - %+ zeul p.v %c :: TODO content type? + %+ make-direct p.v %c :: TODO content type? %mut :: patch from r %+ ~(put by res) pat - %- zeul + %- make-direct :_ %c %+ lump p.v - %- zaul + %- lobe-to-noun %- ~(got by q.r) pat == :: @@ -1673,7 +1659,7 @@ |= con=? :: %mate, %meld |= [p=yaki q=yaki us=[ship desk] th=[ship desk]] ^- (map path blob) - =+ r=(~(tap in (zeal p q)) ~) + =+ r=(~(tap in (find-merge-points p q)) ~) ?~ r ~|(%mate-no-ancestor !!) ?: =(1 (lent r)) @@ -1686,7 +1672,7 @@ %+ roll (~(tap by q.p) ~) |= [[pat=path lob=lobe] zar=(map path blob)] ^- (map path blob) - (~(put by zar) pat (zaal lob)) + (~(put by zar) pat (lobe-to-blob lob)) :: ++ drop :: %that |= [p=yaki q=yaki r=[ship desk] s=[ship desk]] @@ -1696,29 +1682,29 @@ ++ forge :: %forge |= [p=yaki q=yaki s=[ship desk] t=[ship desk]] ^- (map path blob) - =+ r=(~(tap in (zeal p q)) ~) + =+ r=(~(tap in (find-merge-points p q)) ~) ?~ r ~|(%forge-no-ancestor !!) %- |= [r=yaki lut=(map lobe blob) hat=(map tako yaki)] =. lat lut =. hut hat - (meld p q r & s t) :: fake merge + (meld p q r & s t) :: fake merge %+ roll t.r :: fake ancestor |= [par=yaki [for=_i.r lut=_lat hat=_hut]] =. lat lut =+ ^= far ^- (map path lobe) %- ~(tur by (forge par for s t)) - |= [k=path v=blob] (zaax v) - =+ u=(zoal [r.par r.for ~] far `@da`0) :: fake yaki + |= [k=path v=blob] (blob-to-lobe v) + =+ u=(make-yaki [r.par r.for ~] far `@da`0) :: fake yaki :- u :_ (~(put by hat) r.u u) =< - - %- aqel + %- update-lat :_ ~ %- ~(tur by q.u) |= [path k=lobe] - (zaal k) + (lobe-to-blob k) :: :: actual merge :: @@ -1731,11 +1717,11 @@ ^- (map path lobe) %+ roll (~(tap by u) ~) |= [[pat=path bar=blob] yeb=(map path lobe)] - (~(put by yeb) pat (zaax bar)) + (~(put by yeb) pat (blob-to-lobe bar)) :_ u - (zoal [r.p r.q ~] t r) + (make-yaki [r.p r.q ~] t r) :: - ++ strat :: merge strat + ++ strategy :: merge strategy |= gem=?(%meld %mate %that %this) ?- gem %meld (mate %.y) @@ -1744,7 +1730,7 @@ %that drop == :: - ++ auld :: auld:ze + ++ construct-merge :: construct-merge:ze |= [gem=germ who=ship des=desk sab=saba now=@da] :: construct merge ^- (unit (unit mizu)) :::::: =+ for=s.sab :: foreign dome @@ -1753,68 +1739,63 @@ %init :: force fine ?. =(let 0) :: hell no !! - =+ hot=(~(put by _(map ,@ud tako)) 1 (~(got by hit.for) let.for)) + =+ hot=(~(put by _(map aeon tako)) 1 (~(got by hit.for) let.for)) [~ [~ [1 hot hut lat]]] :: trivial %fine =+ der=(~(got by hit.for) let.for) =+ owr=(~(got by hit) let) ?: =(der owr) [~ ~] - ?: (~(has in (zule owr)) der) + ?: (~(has in (reachable-takos owr)) der) [~ ~] - ?. (~(has in (zule der)) owr) + ?. (~(has in (reachable-takos der)) owr) ~ :: not a fast forward ~& [%merge-fine p.sab q.sab] [~ [~ [+(let) (~(put by hit) +(let) der) hut lat]]] ?(%mate %that %this %meld) - =+ foreign-head=(~(got by hut) (~(got by hit.for) let.for)) - =+ our-head=(~(got by hut) (~(got by hit) let)) + =+ foreign-head=(tako-to-yaki (~(got by hit.for) let.for)) + =+ our-head=(tako-to-yaki (~(got by hit) let)) ?: =(r.foreign-head r.our-head) [~ ~] :: up to date - ?: (~(has in (zule r.our-head)) r.foreign-head) + ?: (~(has in (reachable-takos r.our-head)) r.foreign-head) [~ ~] :: up to date - ?: &(|(=(gem %mate) =(gem %meld)) (~(has in (zule r.foreign-head)) r.our-head)) + ?: ?& |(=(gem %mate) =(gem %meld)) + (~(has in (reachable-takos r.foreign-head)) r.our-head) + == $(gem %fine) :: use fast forward - =+ gar=(mer our-head foreign-head now (strat gem)) + =+ gar=(mer our-head foreign-head now (strategy gem)) =+ yak=-.gar =+ hek=+.gar - =. lat -:(aqel hek ~) :: add new blobs + =. lat -:(update-lat hek ~) :: add new blobs =. hut (~(put by _(map tako yaki)) r.yak yak) =. let +(let) - =. hit (~(put by _(map ,@ud tako)) let r.yak) + =. hit (~(put by _(map aeon tako)) let r.yak) [~ [~ [let hit hut lat]]] == :: - ++ auto :: auto:ze + ++ read :: read:ze |= mun=mood :: read at point ^- (unit) ?: ?=(%v p.mun) - [~ `dome`+<+<.auto] + [~ `dome`+<+<.read] ?: &(?=(%w p.mun) !?=(%ud -.q.mun)) ?^(r.mun ~ [~ let]) ?: ?=(%w p.mun) =+ ^= yak - %- ~(got by hut) - %- ~(got by hit) + %- aeon-to-yaki let - ?^(r.mun ~ [~ [t.yak (azul yak)]]) - ::?> ?=(^ hit) ?^(r.mun ~ [~ i.hit]) :: what do?? need [@da nori] - (amor(ank ank:(deny:(zu ank) r.mun)) p.mun) + ?^(r.mun ~ [~ [t.yak (forge-nori yak)]]) + ::?> ?=(^ hit) ?^(r.mun ~ [~ i.hit]) :: what do?? need [@da nori] + (query(ank ank:(descend-path:(zu ank) r.mun)) p.mun) :: - ++ aver :: aver:ze - |= mun=mood :: direct read - ^- (unit (unit ,*)) - =+ nao=(aeon q.mun) - ?~(nao ~ [~ (avid u.nao mun)]) - :: - ++ avid :: avid:ze - |= [oan=@ud mun=mood] :: seek and read + ++ read-at-aeon :: read-at-aeon:ze + |= [yon=aeon mun=mood] :: seek and read ^- (unit) ?: &(?=(%w p.mun) !?=(%ud -.q.mun)) :: NB only for speed - ?^(r.mun ~ [~ oan]) - (auto:(argo oan) mun) + ?^(r.mun ~ [~ yon]) + (read:(rewind yon) mun) :: - ++ equi :: test paths + ++ equiv :: test paths |= [p=(map path lobe) q=(map path lobe)] ^- ? %- |= qat=? @@ -1830,33 +1811,31 @@ ?. eq %.n =+ zat=(~(get by q) pat) ?~ zat %.n - =((zaul u.zat) (zaul lob)) + =((lobe-to-noun u.zat) (lobe-to-noun lob)) :: - ++ axel :: axel:ze + ++ edit :: edit:ze |= [wen=@da lem=nori] :: edit ^+ +> ?- -.lem & =+ ^= yet - %+ azol wen + %+ forge-yaki wen ?: =(let 0) :: initial import [~ q.lem] - [(some r:(need (~(get by hut) (need (~(get by hit) let))))) q.lem] + [(some r:(aeon-to-yaki let)) q.lem] =+ yak=-.yet =. lat +.yet :: merge objects - ?. |(=(0 let) !=((lent p.yak) 1) !(equi q.yak q:(need (~(get by hut) (need (~(get by hit) let)))))) + ?. ?| =(0 let) + !=((lent p.yak) 1) + !(equiv q.yak q:(aeon-to-yaki let)) + == +>.$ :: silently ignore =: let +(let) hit (~(put by hit) +(let) r.yak) hut (~(put by hut) r.yak yak) == - +>.$(ank (azel q.yak)) + +>.$(ank (checkout-ankh q.yak)) | +>.$(lab ?<((~(has by lab) p.lem) (~(put by lab) p.lem let))) == - :: - ++ axon :: axon:ze - |= nyp=soba :: apply changes - ^+ +> - +>(ank ank:(durn:(zu ank) nyp)) -- :: ++ zu :: filesystem @@ -1864,7 +1843,7 @@ =| myz=(list ,[p=path q=miso]) :: changes in reverse =| ram=path :: reverse path into |% - ++ dash :: local rehash + ++ rehash :: local rehash ^- cash %+ mix ?~(q.ank 0 p.u.q.ank) =+ axe=1 @@ -1876,8 +1855,8 @@ $(r.ank r.r.ank, axe (peg axe 3)) == :: - ++ dosh %_(. p.ank dash) :: rehash and save - ++ dose :: ascend + ++ update-hash %_(. p.ank rehash) :: rehash and save + ++ ascend :: ascend |= [lol=@ta kan=ankh] ^+ +> ?> &(?=(^ ram) =(lol i.ram)) @@ -1890,61 +1869,61 @@ kan(r (~(put by r.kan) lol ank)) == :: - ++ deaf :: add change + ++ push-change :: add change |= mis=miso ^+ +> +>(myz [[(flop ram) mis] myz]) :: - ++ dent :: descend + ++ descend :: descend |= lol=@ta ^+ +> =+ you=(~(get by r.ank) lol) +>.$(ram [lol ram], ank ?~(you [*cash ~ ~] u.you)) :: - ++ deny :: descend recursively + ++ descend-path :: descend recursively |= way=path ^+ +> - ?~(way +> $(way t.way, +> (dent i.way))) + ?~(way +> $(way t.way, +> (descend i.way))) :: - ++ dest :: write over + ++ overwrite :: write over |= [pum=umph val=(unit ,[p=cash q=*])] ^+ +> ?~ q.ank ?~ val +> - (deaf %ins q.u.val) + (push-change %ins q.u.val) ?~ val - (deaf %del q.u.q.ank) + (push-change %del q.u.q.ank) ?: =(q.u.val q.u.q.ank) +> - (deaf %mut ((diff pum) q.u.q.ank q.u.val)) + (push-change %mut ((diff pum) q.u.q.ank q.u.val)) :: - ++ dist :: modify tree + ++ change-tree :: modify tree |= [pum=umph bus=ankh] ^+ +> - =. +> (dest pum q.bus) + =. +> (overwrite pum q.bus) =+ [yeg=(~(tap by r.ank) ~) gey=(~(tap by r.bus) ~)] =. +>.$ |- ^+ +>.^$ ?~ yeg +>.^$ ?: (~(has by r.bus) p.i.yeg) $(yeg t.yeg) - $(yeg t.yeg, myz myz:dirk(ank q.i.yeg, ram [p.i.yeg ram])) + $(yeg t.yeg, myz myz:rm-r(ank q.i.yeg, ram [p.i.yeg ram])) |- ^+ +>.^$ ?~ gey +>.^$ - $(gey t.gey, myz myz:^$(bus q.i.gey, +> (dent p.i.gey))) + $(gey t.gey, myz myz:^$(bus q.i.gey, +> (descend p.i.gey))) :: - ++ dirk :: rm -r + ++ rm-r :: rm -r |- ^+ + - =. + ?~(q.ank + (deaf %del q.u.q.ank)) + =. + ?~(q.ank + (push-change %del q.u.q.ank)) =+ dyr=(~(tap by r.ank) ~) |- ^+ +.^$ ?~ dyr +.^$ - =. +.^$ dirk:(dent p.i.dyr) + =. +.^$ rm-r:(descend p.i.dyr) $(dyr t.dyr) :: ++ drum :: apply effect - |= [pax=path mis=miso] + |= [pax=path mis=miso] :: XX unused (++dune) ^+ +> ?^ pax - dosh:(dose:$(pax t.pax, +> (dent i.pax)) i.pax ank) + update-hash:(ascend:$(pax t.pax, +> (descend i.pax)) i.pax ank) ~| %clay-fail ?- -.mis %del @@ -1964,13 +1943,13 @@ == :: ++ dune :: apply - |- ^+ + + |- ^+ + :: XX unused (++durn) ?~ myz + => .(+ (drum p.i.myz q.i.myz)) $(myz ?>(?=(^ myz) t.myz)) :: ++ durn :: apply forward - |= nyp=soba + |= nyp=soba :: XX unused ^+ +> ?: =([0 0] p.nyp) dune(myz q.nyp) @@ -2741,13 +2720,14 @@ ++ pac _@uvG :: default passcode ++ pub *pass :: public key ++ sec *ring :: private key - -- + -- :: ++ nu ^? :: reconstructors |% ++ pit |=([a=@ b=@] ^?(..nu)) :: from [width seed] ++ nol |=(a=@ ^?(..nu)) :: from naked ring ++ com |=(a=@ ^?(..nu)) :: from naked pass - -- - -- + -- :: + -- :: +++ aeon ,@ud :: ++ agon (map ,[p=ship q=desk] ,[p=@ud q=@ud r=waks]) :: mergepts ++ ankh :: fs node (new) $: p=cash :: recursive hash diff --git a/main/app/chat/core.hook b/main/app/chat/core.hook index 7ad80c2418..e9612fd5f7 100644 --- a/main/app/chat/core.hook +++ b/main/app/chat/core.hook @@ -130,9 +130,9 @@ == :: ++ pour - |= [ost=bone pax=path sih=*] + |= [ost=bone pax=path sih=sign] ^- [(list move) _+>] - =+ sih=((hard sign) sih) + :: =+ sih=((hard sign) sih) :: ~& [%chat-pour sih] ?. ?=([@ *] pax) ~& %chat-pour-strange-path !! ?> ?=(%g -.sih) diff --git a/main/bin/update.hoon b/main/bin/update.hoon index efca0a3069..07bef22c4d 100644 --- a/main/bin/update.hoon +++ b/main/bin/update.hoon @@ -25,7 +25,7 @@ |= [der=dome owr=dome des=desk] ^- gift =+ sab=`saba`[bos des [0 let.der] der] - =+ lum=`(unit (unit mizu))`(~(auld ze est owr ran) gem who des sab est) + =+ lum=`(unit (unit mizu))`(~(construct-merge ze est owr ran) gem who des sab est) ?~ lum ^- gift :^ %la %rose [": " "" ""] diff --git a/main/pub/src/doc/ref/vol/4c.md b/main/pub/src/doc/ref/vol/4c.md index d1db462f2c..5ba5770bd9 100644 --- a/main/pub/src/doc/ref/vol/4c.md +++ b/main/pub/src/doc/ref/vol/4c.md @@ -49,8 +49,6 @@ to clay is stored in this state. `fat` is the set of domestic servers. This stores all the information that is specfic to a particular ship on this pier. The keys to this map are the ships on the current pier. - -`hoy` is the set of foreign servers that we know anything about. This stores all the information that is specific to a particular foreign ship. The keys to this map are all the ships whose filesystems we have attempted to access through clay. @@ -123,6 +121,16 @@ these ducts. The values are a description of the requested information. This represents a subscription request for a desk. The request can be for either a single item in the desk or else for a range of changes on the desk. +###`++rove`, stored general subscription request + +``` +++ rove (each mood moot) :: stored request +``` + +When we store a request, we store subscriptions with a little extra information +so that we can determine whether new versions actually affect the path we're +subscribed to. + ###`++mood`, single subscription request ``` @@ -136,12 +144,23 @@ specifies the path we are requesting. ###`++moat`, range subscription request ``` -++ moat ,[p=case q=case] :: change range +++ moat ,[p=case q=case r=path] :: change range ``` -This represents a request for all changes between `p` and `q`. Note that there -is currently no way to request to be notified only on changes to particular -paths in the filesystem. You must subscribe to the entire desk. +This represents a request for all changes between `p` and `q` on path `r`. You +will be notified when a change is made to the node referenced by the path or to +any of its children. + +###`++moot`, stored range subscription request + +``` +++ moot ,[p=case q=case r=path s=(map path lobe)] :: +``` + +This is just a `++moat` plus a map of paths to lobes. This map represents the +data at the node referenced by the path at case `p`, if we've gotten to that +case (else null). We only send a notification along the subscription if the +data at a new revision is different than it was. ###`++care`, clay submode @@ -613,7 +632,8 @@ subscription). `r.p` is the desk. `q` is the path to the filesystem node. ``` This is the data that is produced by a request for a range of revisions of a -desk. +desk. This allows us to easily keep track of a remote repository -- all the +new information we need is contained in the `nako`. `gar` is a map of the revisions in the range to the hash of the commit at that revision. These hashes can be used with `hut:rang` to find the commit @@ -932,9 +952,8 @@ actually try to read the data. !! =+ ezy=?~(ref ~ (~(get by haw.u.ref) mun)) ?^ ezy ezy - =+ nao=(~(aeon ze lim dom ran) q.mun) - :: ~& [%aver-mun nao [%from syd lim q.mun]] - ?~(nao ~ [~ (~(avid ze lim dom ran) u.nao mun)]) + =+ nao=(~(case-to-aeon ze lim dom ran) q.mun) + ?~(nao ~ [~ (~(read-at-aeon ze lim dom ran) u.nao mun)]) ``` We check immediately that we're not requesting the `rang` for any time other @@ -949,21 +968,21 @@ specified by the given case, and then we try to get the data there. Here, we jump into `arvo/zuse.hoon`, which is where much of the algorithmic code is stored, as opposed to the clay interface, which is stored in -`arvo/clay.hoon`. We examine `++aeon:ze`. +`arvo/clay.hoon`. We examine `++case-to-aeon:ze`. ``` - ++ aeon :: aeon:ze + ++ case-to-aeon :: case-to-aeon:ze |= lok=case :: act count through - ^- (unit ,@ud) + ^- (unit aeon) ?- -.lok %da ?: (gth p.lok lim) ~ - |- ^- (unit ,@ud) + |- ^- (unit aeon) ?: =(0 let) [~ 0] :: avoid underflow ?: %+ gte p.lok =< t - %- ~(got by hut) - %- ~(got by hit) + %- tako-to-yaki + %- aeon-to-tako let [~ let] $(let (dec let)) @@ -976,7 +995,7 @@ code is stored, as opposed to the clay interface, which is stored in We handle each type of `case` differently. The latter two types are easy. If we're requesting a revision by label, then we simply look up the requested -label in `lab` from the given dome. If it exists, that is our number; else we +label in `lab` from the given dome. If it exists, that is our aeon; else we produce null, indicating the requested revision does not yet exist. If we're requesting a revision by number, we check if we've yet reached that @@ -988,30 +1007,42 @@ scan backwards until we find the first revision committed before that date, and we produce that. If we requested a date before any revisions were committed, we produce `0`. -Assuming we got a valid version number, `++aver` calls `++avid:ze`, which reads -the requested data at the given revision. +The definitions of `++aeon-to-tako` and `++tako-to-yaki` are trivial. ``` - ++ avid :: avid:ze - |= [oan=@ud mun=mood] :: seek and read + ++ aeon-to-tako ~(got by hit) +``` + +``` + ++ tako-to-yaki ~(got by hut) :: grab yaki +``` + +We simply look up the aeon or tako in their respective maps (`hit` and `hut`). + +Assuming we got a valid version number, `++aver` calls `++read-at-aeon:ze`, +which reads the requested data at the given revision. + +``` + ++ read-at-aeon :: read-at-aeon:ze + |= [yon=aeon mun=mood] :: seek and read ^- (unit) ?: &(?=(%w p.mun) !?=(%ud -.q.mun)) :: NB only for speed - ?^(r.mun ~ [~ oan]) - (auto:(argo oan) mun) + ?^(r.mun ~ [~ yon]) + (read:(rewind yon) mun) ``` If we're requesting the revision number with a case other than by number, then we go ahead and just produce the number we were given. Otherwise, we call -`++argo` to rewind our state to the given revision, and then we call `++auto` +`++rewind` to rewind our state to the given revision, and then we call `++read` to get the requested information. ``` - ++ argo :: argo:ze - |= oan=@ud :: rewind to aeon + ++ rewind :: rewind:ze + |= yon=aeon :: rewind to aeon ^+ +> - ?: =(let oan) +> - ?: (gth oan let) !! :: don't have this version - +>(ank (azel q:(~(got by hut) (~(got by hit) oan))), let oan) + ?: =(let yon) +> + ?: (gth yon let) !! :: don't have version + +>(ank (checkout-ankh q:(tako-to-yaki (aeon-to-tako yon))), let yon) ``` If we're already at the requested version, we do nothing. If we're requesting @@ -1019,11 +1050,11 @@ a version later than our head, we are unable to comply. Otherwise, we get the hash of the commit at the number, and from that we get the commit itself (the yaki), which has the map of path to lobe that represents -a version of the filesystem. We call `++azel` to checkout the commit, and we +a version of the filesystem. We call `++checkout-ankh` to checkout the commit, and we replace `ank` in our context with the result. ``` - ++ azel :: azel:ze + ++ checkout-ankh :: checkout-ankh:ze |= hat=(map path lobe) :: checkout commit ^- ankh %- cosh @@ -1032,7 +1063,7 @@ replace `ank` in our context with the result. ^- ankh %- cosh ?~ pat - =+ zar=(zaul bar) + =+ zar=(lobe-to-noun bar) ank(q [~ (sham zar) zar]) =+ nak=(~(get by r.ank) i.pat) %= ank @@ -1042,16 +1073,16 @@ replace `ank` in our context with the result. ``` Twice we call `++cosh`, which hashes a commit, updating `p` in an `ankh`. -Let's jump into that algorithm before we describe `++azel`. +Let's jump into that algorithm before we describe `++checkout-ankh`. ``` ++ cosh :: locally rehash - |= ank=ankh - ank(p dash:(zu ank)) + |= ank=ankh :: NB v/unix.c + ank(p rehash:(zu ank)) ``` We simply replace `p` in the hash with the `cash` we get from a call to -`++dash:zu`. +`++rehash:zu`. ``` ++ zu !: :: filesystem @@ -1059,7 +1090,7 @@ We simply replace `p` in the hash with the `cash` we get from a call to =| myz=(list ,[p=path q=miso]) :: changes in reverse =| ram=path :: reverse path into |% - ++ dash :: local rehash + ++ rehash :: local rehash ^- cash %+ mix ?~(q.ank 0 p.u.q.ank) =+ axe=1 @@ -1076,43 +1107,40 @@ We simply replace `p` in the hash with the `cash` we get from a call to checkout of the filesystem and access the actual data inside it. One of the things we can do with it is to create a recursive hash of the node. -In `++dash`, if this node is a file, then we xor the remainder of the hash with -the hash of the contents of the file. The remainder of the hash is `0` if we -have no children, else we descend into our children. Basically, we do a half -SHA-256 of the xor of the axis of this child and the half SHA-256 of the xor of -the name of the child and the hash of the child. This is done for each child -and all the results are xored together. +In `++rehash`, if this node is a file, then we xor the remainder of the hash +with the hash of the contents of the file. The remainder of the hash is `0` if +we have no children, else we descend into our children. Basically, we do a +half SHA-256 of the xor of the axis of this child and the half SHA-256 of the +xor of the name of the child and the hash of the child. This is done for each +child and all the results are xored together. -Now we return to our discussion of `++azel`. +Now we return to our discussion of `++checkout-ankh`. We fold over every path in this version of the filesystem and create a great -ankh out of them. First, we call `++zaul` to get the raw data referred to be -each lobe. +ankh out of them. First, we call `++lobe-to-noun` to get the raw data referred +to be each lobe. ``` - ++ zaul :: grab blob + ++ lobe-to-noun :: grab blob |= p=lobe :: ^- * - %- zaru - (zaal p) + %- blob-to-noun + (lobe-to-blob p) ``` This converts a lobe into the raw data it refers to by first getting the blob -with `++zaal` and converting that into data with `++zaru`. +with `++lobe-to-blob` and converting that into data with `++blob-to-noun`. ``` - ++ zaal :: grab blob - |= p=lobe :: (raw) - ^- blob - (~(got by lat) p) + ++ lobe-to-blob ~(got by lat) :: grab blob ``` This just grabs the blob that the lobe refers to. ``` - ++ zaru :: grab blob + ++ blob-to-noun :: grab blob |= p=blob ?- -.p - %delta (lump r.p (zaul q.p)) + %delta (lump r.p (lobe-to-noun q.p)) %direct q.p %indirect q.p == @@ -1189,10 +1217,10 @@ are what we expect them to be (`p.i.rug`), crashing on failure. If they're good, then we append the new lines in `q.i.rug` onto `war`. And that's really it. List merges are pretty easy. Anyway, if you recall, we -were discussing `++azel`. +were discussing `++checkout-ankh`. ``` - ++ azel :: azel:ze + ++ checkout-ankh :: checkout-ankh:ze |= hat=(map path lobe) :: checkout commit ^- ankh %- cosh @@ -1201,7 +1229,7 @@ were discussing `++azel`. ^- ankh %- cosh ?~ pat - =+ zar=(zaul bar) + =+ zar=(lobe-to-noun bar) ank(q [~ (sham zar) zar]) =+ nak=(~(get by r.ank) i.pat) %= ank @@ -1213,7 +1241,7 @@ were discussing `++azel`. If the path is null, then we calculate `zar`, the raw data at the path `pat` in this version. We produce the given ankh with the correct data. -Otherwise, we try to get the child we're looking at from our parent `ankh`. If +Otherwise, we try to get the child we're looking at from our parent ankh. If it's already been created, this succeeds; otherwise, we simply create a default blank ankh. We place ourselves in our parent after recursively computing our children. @@ -1249,7 +1277,7 @@ In the recursion, we our path is `/english` and our ankh is again blank. We try to get the `english` child of our ankh, but this of course fails. Thus, we update our blank `/greeting` ankh with a child `english` produced by recursing. -Now our path is null, so we call `++zaul` to get the actual data, and we place +Now our path is null, so we call `++lobe-to-noun` to get the actual data, and we place it in the brand-new ankh. Next, we process `/greeting/russian/short`. Since our path is not null, we try @@ -1288,54 +1316,55 @@ depending on what order the paths come in, but the resulting tree is independent of order. At any rate, we were talking about something important, weren't we? If you -recall, that concludes our discussion of `++argo`, which was called from -`++avid`. In summary, `++argo` returns a context in which our current state is -(very nearly) as it was when the specified version of the desk was the head. -This allows `++avid` to call `++auto` to read the requested information. +recall, that concludes our discussion of `++rewind`, which was called from +`++read-at-aeon`. In summary, `++rewind` returns a context in which our +current state is (very nearly) as it was when the specified version of the desk +was the head. This allows `++read-at-aeon` to call `++read` to read the +requested information. ``` - ++ auto :: auto:ze + ++ read :: read:ze |= mun=mood :: read at point ^- (unit) ?: ?=(%v p.mun) - [~ `dome`+<+<.auto] + [~ `dome`+<+<.read] ?: &(?=(%w p.mun) !?=(%ud -.q.mun)) ?^(r.mun ~ [~ let]) ?: ?=(%w p.mun) =+ ^= yak - %- ~(got by hut) - %- ~(got by hit) + %- tako-to-yaki + %- aeon-to-tako let - ?^(r.mun ~ [~ [t.yak (azul yak)]]) - ::?> ?=(^ hit) ?^(r.mun ~ [~ i.hit]) :: what do?? need [@da nori] - (amor(ank ank:(deny:(zu ank) r.mun)) p.mun) + ?^(r.mun ~ [~ [t.yak (forge-nori yak)]]) + ::?> ?=(^ hit) ?^(r.mun ~ [~ i.hit]) :: what do?? need [@da nori] + (query(ank ank:(descend-path:(zu ank) r.mun)) p.mun) ``` If we're requesting the dome, then we just return that immediately. If we're requesting the revision number of the desk and we're not requesting it by number, then we just return the current number of this desk. Note of course -that this was really already handled in `++avid`. +that this was really already handled in `++read-at-aeon`. If we're requesting a `%w` with a specific revision number, then we do something or other with the commit there. It's kind of weird, and it doesn't seem to work, so we'll ignore this case. -Otherwise, we descend into the ankh tree with `++deny:zu` to the given path, -and then we handle specific request in `++amor`. +Otherwise, we descend into the ankh tree to the given path with +`++descend-path:zu`, and then we handle specific request in `++query`. ``` - ++ deny :: descend recursively + ++ descend-path :: descend recursively |= way=path ^+ +> - ?~(way +> $(way t.way, +> (dent i.way))) + ?~(way +> $(way t.way, +> (descend i.way))) ``` -This is simple recursion down into the ankh tree. `++dent` descends one level, -so this will eventually get us down to the path we want. +This is simple recursion down into the ankh tree. `++descend` descends one +level, so this will eventually get us down to the path we want. ``` - ++ dent :: descend + ++ descend :: descend |= lol=@ta ^+ +> =+ you=(~(get by r.ank) lol) @@ -1350,24 +1379,25 @@ Once we've decscended to the correct level, we need to actually deal with the request. ``` - ++ amor :: amor:ze + ++ query :: query:ze |= ren=?(%u %v %x %y %z) :: endpoint query ^- (unit ,*) ?- ren - %u [~ `rang`+<+>.amor] - %v [~ `dome`+<+<.amor] + %u [~ `rang`+<+>.query] + %v [~ `dome`+<+<.query] %x ?~(q.ank ~ [~ q.u.q.ank]) - %y [~ ache] + %y [~ as-arch] %z [~ ank] == ``` -Now that everything's set up, it's really easy. If they're requesting the rang -, dome, or ankh, we give it to them. If the contents of a file, we give it to -them if it is in fact a file. If the `arch`, then we calculate it with `++ache`. +Now that everything's set up, it's really easy. If they're requesting the +rang, dome, or ankh, we give it to them. If the contents of a file, we give it +to them if it is in fact a file. If the `arch`, then we calculate it with +`++as-arch`. ``` - ++ ache :: ache:ze + ++ as-arch :: as-arch:ze ^- arch :: arch report :+ p.ank ?~(q.ank ~ [~ p.u.q.ank]) @@ -1389,34 +1419,37 @@ rave. If the head was `&`, then it was a single request, so we handled it above. If `|`, then we handle it with the following code. ``` - | - =+ nab=(~(aeon ze lim dom ran) p.p.rav) + =+ nab=(~(case-to-aeon ze lim dom ran) p.p.rav) ?~ nab - ?> =(~ (~(aeon ze lim dom ran) q.p.rav)) - (duce hen rav) - =+ huy=(~(aeon ze lim dom ran) q.p.rav) + ?> =(~ (~(case-to-aeon ze lim dom ran) q.p.rav)) + (duce hen (rive rav)) + =+ huy=(~(case-to-aeon ze lim dom ran) q.p.rav) ?: &(?=(^ huy) |((lth u.huy u.nab) &(=(0 u.huy) =(0 u.nab)))) (blub hen) =+ top=?~(huy let.dom u.huy) - =+ fud=(~(gack ze lim dom ran) u.nab let.dom) - =. +>.$ (bleb hen u.nab fud) + =+ sar=(~(lobes-at-path ze lim dom ran) u.nab r.p.rav) + =+ ear=(~(lobes-at-path ze lim dom ran) top r.p.rav) + =. +>.$ + ?: =(sar ear) +>.$ + =+ fud=(~(make-nako ze lim dom ran) u.nab top) + (bleb hen u.nab fud) ?^ huy (blub hen) =+ ^= ptr ^- case [%ud +(let.dom)] - (duce hen `rave`[%| ptr q.p.rav]) + (duce hen `rove`[%| ptr q.p.rav r.p.rav ear]) == ``` -Recall that `++aeon:ze` produces the revision number that a case corresponds -to, if it corresponds to any. If it doesn't yet correspond to a revision, then -it produces null. +Recall that `++case-to-aeon:ze` produces the revision number that a case +corresponds to, if it corresponds to any. If it doesn't yet correspond to a +revision, then it produces null. Thus, we first check to see if we've even gotten to the beginning of the range of revisions requested. If not, then we assert that we haven't yet gotten to the end of the range either, because that would be really strange. If not, then we immediately call `++duce`, which, if you recall, for a local request, -simply puts this duct and rave into our cult `qyx`, so that we know who to +simply puts this duct and rove into our cult `qyx`, so that we know who to respond to when the revision does appear. If we've already gotten to the first revision, then we can produce some content @@ -1424,18 +1457,22 @@ immediately. If we've also gotten to the final revision, and that revision is earlier than the start revision, then it's a bad request and we call `++blub`, which tells the subscriber that his subscription will not be satisfied. -Otherwise, we call `++gack`, which creates the `++nako` we need to produce. We -call `++bleb` to actually produce the information. If we already have the last -requested revision, then we also tell the subscriber with `++blub` that the -subscription will receive no further updates. +Otherwise, we find the data at the given path at the beginning of the +subscription and at the last available revision in the subscription. If +they're the same, then we don't send a notification. Otherwise, we call +`++gack`, which creates the `++nako` we need to produce. We call `++bleb` to +actually produce the information. -If there will be more revisions, that we'll need to report, then we call -`++duce`, adding the duct to our subscribers. We modify the rave to start at -the next revision since we've already handled all the revisions up to the -present. +If we already have the last requested revision, then we also tell the +subscriber with `++blub` that the subscription will receive no further updates. -We glossed over the calls to `++gack` and `++bleb`, so we'll get back to those -right now. `++bleb` is simple, so we'll start with that. +If there will be more revisions in the subscription, then we call `++duce`, +adding the duct to our subscribers. We modify the rove to start at the next +revision since we've already handled all the revisions up to the present. + +We glossed over the calls to `++lobes-at-path`, `++make-nako`, and `++bleb`, so +we'll get back to those right now. `++bleb` is simple, so we'll start with +that. ``` ++ bleb :: ship sequence @@ -1449,51 +1486,78 @@ the updates since that revision. We use `++blab` to produce this result to the subscriber. The case is `%w` with a revision number of the beginning of the subscription, and the data is the nako itself. -Finally, we will describe `++gack:ze`. +We call `++lobes-at-path:ze` to get the data at the particular path. ``` - ++ gack :: gack a through b - |= [a=@ud b=@ud] - ^- [(map ,@ud tako) @ud (set yaki) (set blob)] + ++ lobes-at-path :: lobes-at-path:ze + |= [yon=aeon pax=path] :: data at path + ^- (map path lobe) + ?: =(0 yon) ~ + %- mo + %+ skim + %. ~ + %~ tap by + =< q + %- tako-to-yaki + %- aeon-to-tako + yon + |= [p=path q=lobe] + ?| ?=(~ pax) + ?& !?=(~ p) + =(-.pax -.p) + $(p +.p, pax +.pax) + == == +``` + +At revision zero, the theoretical common revision between all repositories, +there is no data, so we produce null. + +We get the list of paths (paired with their lobe) in the revision referred to +by the given number and we keep only those paths which begin with `pax`. +Converting to a map, we now have a map from the subpaths at the given path to +the hash of their data. This is simple and efficient to calculate and compare +to later revisions. This allows us to easily tell if a node or its children +have changed. + +Finally, we will describe `++make-nako:ze`. + +``` + ++ make-nako :: gack a through b + |= [a=aeon b=aeon] + ^- [(map aeon tako) aeon (set yaki) (set blob)] :_ :- b - %- hack - %+ pack - (~(get by hit) a) :: if a not found, a=0 - %- need (~(get by hit) b) - ^- (map ,@ud tako) + =- [(takos-to-yakis -<) (lobes-to-blobs ->)] + %+ reachable-between-takos + (~(get by hit) a) :: if a not found, a=0 + (aeon-to-tako b) + ^- (map aeon tako) %- mo %+ skim (~(tap by hit) ~) - |= [p=@ud *] + |= [p=aeon *] &((gth p a) (lte p b)) ``` +We need to produce four things -- the numbers of the new commits, the number of +the latest commit, the new commits themselves, and the new data itself. +The first is fairly easy to produce. We simply go over our map of numbered +commits and produce all those numbered greater than `a` and not greater than +`b`. + +The second is even easier to produce -- `b` is clearly our most recent commit. + +The third and fourth are slightly more interesting, though not too terribly +difficult. First, we call `++reachable-between-takos`. ``` - ++ hack :: trivial - |= [a=(set tako) b=(set lobe)] - ^- [(set yaki) (set blob)] - :- %- sa %+ turn (~(tap by a) ~) - |= tak=tako - (need (~(get by hut) tak)) - %- sa %+ turn (~(tap by b) ~) - |= lob=lobe - (need (~(get by lat) lob)) -``` - -The type signature says everything you need to know about this. We take a set -of hashes of commits and data and convert them into the actual commits and data -in the most straightforward way possible. - -``` - ++ pack - |= [a=(unit tako) b=tako] :: pack a through b + ++ reachable-between-takos + |= [a=(unit tako) b=tako] :: pack a through b ^- [(set tako) (set lobe)] =+ ^= sar ?~ a ~ - (zule r:(need (~(get by hut) u.a))) - =+ yak=`yaki`(need (~(get by hut) b)) - %+ garf (garg ~ sar) :: get lobes - |- ^- (set tako) :: walk onto sar + (reachable-takos r:(tako-to-yaki u.a)) + =+ yak=`yaki`(tako-to-yaki b) + %+ new-lobes-takos (new-lobes ~ sar) :: get lobes + |- ^- (set tako) :: walk onto sar ?: (~(has in sar) r.yak) ~ =+ ber=`(set tako)`(~(put in `(set tako)`~) `tako`r.yak) @@ -1502,39 +1566,57 @@ in the most straightforward way possible. %+ roll p.yak |= [yek=tako bar=(set tako)] ^- (set tako) - ?: (~(has in bar) yek) :: save some time + ?: (~(has in bar) yek) :: save some time bar %- ~(uni in bar) - ^$(yak (need (~(get by hut) yek))) + ^$(yak (tako-to-yaki yek)) ``` +We take a possible starting commit and a definite ending commit, and we produce +the set of commits and the set of data between them. + +We let `sar` be the set of commits reachable from `a`. If `a` is null, then +obviously no commits are reachable. Otherwise, we call `++reachable-takos` to +calculate this. + ``` - ++ zule :: reachable - |= p=tako :: XX slow + ++ reachable-takos :: reachable + |= p=tako :: XX slow ^- (set tako) - =+ y=(~(got by hut) p) + =+ y=(tako-to-yaki p) =+ t=(~(put in _(set tako)) p) %+ roll p.y |= [q=tako s=_t] - ?: (~(has in s) q) :: already done - s :: hence skip - (~(uni in s) ^$(p q)) :: otherwise traverse + ?: (~(has in s) q) :: already done + s :: hence skip + (~(uni in s) ^$(p q)) :: otherwise traverse ``` +We very simply produce the set of the given tako plus its parents, recursively. + +Back in `++reachable-between-takos`, we let `yak` be the yaki of `b`, the +ending commit. With this, we create a set that is the union of `sar` and all +takos reachable from `b`. + +We pass `sar` into `++new-lobes` to get all the lobes referenced by any tako +referenced by `a`. The result is passed into `++new-lobes-takos` to do the +same, but not recomputing those in already calculated last sentence. This +produces the sets of takos and lobes we need. + ``` - ++ garg :: object hash set - |= [b=(set lobe) a=(set tako)] :: that aren't in b + ++ new-lobes :: object hash set + |= [b=(set lobe) a=(set tako)] :: that aren't in b ^- (set lobe) %+ roll (~(tap in a) ~) |= [tak=tako bar=(set lobe)] ^- (set lobe) - =+ yak=(need (~(get by hut) tak)) + =+ yak=(tako-to-yaki tak) %+ roll (~(tap by q.yak) ~) |= [[path lob=lobe] far=_bar] ^- (set lobe) - ?~ (~(has in b) lob) :: don't need + ?~ (~(has in b) lob) :: don't need far - =+ gar=(need (~(get by lat) lob)) + =+ gar=(lobe-to-blob lob) ?- -.gar %direct (~(put in far) lob) %delta (~(put in $(lob q.gar)) lob) @@ -1542,9 +1624,414 @@ in the most straightforward way possible. == ``` +Here, we're creating a set of lobes referenced in a commit in `a`. We start +out with `b` as the initial set of lobes, so we don't need to recompute any of +the lobes referenced in there. + +The algorithm is pretty simple, so we won't bore you with the details. We +simply traverse every commit in `a`, looking at every blob referenced there, +and, if it's not already in `b`, we add it to `b`. In the case of a direct +blob, we're done. For a delta or an indirect blob, we recursively add every +blob referenced within the blob. + ``` - ++ garf :: garg & repack + ++ new-lobes-takos :: garg & repack |= [b=(set lobe) a=(set tako)] ^- [(set tako) (set lobe)] - [a (garg b a)] + [a (new-lobes b a)] ``` + +Here, we just update the set of lobes we're given with the commits we're given +and produce both sets. + +This concludes our discussion of a local subscription. + +Lifecycle of a Foreign Read or Subscription +------------------------------------------- + +Foreign reads and subscriptions are handled in much the same way as local ones. +The interface is the same -- a vane or app sends a `%warp` kiss with the +request. The difference is simply that the `sock` refers to the foreign ship. + +Thus, we start in the same place -- in `++call`, handling `%warp`. However, +since the two side of the `sock` are different, we follow a different path. + +``` + =+ wex=(do now p.q.hic p.q.q.hic ruf) + =+ ^= woo + ?~ q.q.q.hic + abet:(ease:wex hen) + abet:(eave:wex hen u.q.q.q.hic) + [-.woo (posh q.p.q.hic p.q.q.hic +.woo ruf)] +``` + +If we compare this to how the local case was handled, we see that it's not all +that different. We use `++do` rather than `++un` and `++de` to set up the core +for the foreign ship. This gives us a `++de` core, so we either cancel or +begin the request by calling `++ease` or `++eave`, exactly as in the local +case. In either case, we call `++abet:de` to resolve our various types of +output into actual moves, as described in the local case. Finally, we call +`++posh` to update our raft, putting the modified rung into the raft. + +We'll first trace through `++do`. + +``` + ++ do + |= [now=@da [who=ship him=ship] syd=@tas ruf=raft] + =+ ^= rug ^- rung + =+ rug=(~(get by hoy.ruf) him) + ?^(rug u.rug *rung) + =+ ^= red ^- rede + =+ yit=(~(get by rus.rug) syd) + ?^(yit u.yit `rede`[~2000.1.1 ~ [~ *rind] *dome]) + ((de now ~ ~) [who him] syd red ran.ruf) +``` + +If we already have a rung for this foreign ship, then we use that. Otherwise, +we create a new blank one. If we already have a rede in this rung, then we use +that, otherwise we create a blank one. An important point to note here is that +we let `ref` in the rede be `[~ *rind]`. Recall, for domestic desks `ref` is +null. We use this to distinguish between foreign and domestic desks in `++de`. + +With this information, we create a `++de` core as usual. + +Although we've already covered `++ease` and `++eave`, we'll go through them +quickly again, highlighting the case of foreign request. + +``` + ++ ease :: release request + |= hen=duct + ^+ +> + =. qyx (~(del by qyx) hen) + ?~ ref +> + |- ^+ +>+.$ + =+ nux=(~(get by fod.u.ref) hen) + ?~ nux +>+.$ + %= +>+.$ + say [[hen [(scot %ud u.nux) ~] for [u.nux syd ~]] say] + fod.u.ref (~(del by fod.u.ref) hen) + bom.u.ref (~(del by bom.u.ref) u.nux) + == +``` + +Here, we still remove the duct from our cult (we maintain a cult even for +foreign desks), but we also need to tell the foreign desk to cancel our +subscription. We do this by sending a request (by appending to `say`, which +gets resolved in `++abet:de` to a `%want` kiss to ames) to the foreign ship to +cancel the subscription. Since we don't anymore expect a response on this +duct, we remove it from `fod` and `bom`, which are the maps between ducts, +raves, and request sequence numbers. Basically, we remove every trace of the +subscription from our request manager. + +In the case of `++eave`, where we're creating a new request, everything is +exactly identical to the case of the local request except `++duce`. We said +that `++duce` simply puts the request into our cult. This is true for a +domestic request, but distinctly untrue for foreign requests. + +``` + ++ duce :: produce request + |= [hen=duct rov=rove] + ^+ +> + =. qyx (~(put by qyx) hen rov) + ?~ ref +>.$ + |- ^+ +>+.$ :: XX why? + =+ rav=(reve rov) + =+ ^= vaw ^- rave + ?. ?=([%& %v *] rav) rav + [%| [%ud let.dom] `case`q.p.rav r.p.rav] + =+ inx=nix.u.ref + %= +>+.$ + say [[hen [(scot %ud inx) ~] for [inx syd ~ vaw]] say] + nix.u.ref +(nix.u.ref) + bom.u.ref (~(put by bom.u.ref) inx [hen vaw]) + fod.u.ref (~(put by fod.u.ref) hen inx) + == +``` + +If we have a request manager (i.e. this is a foreign desk), then we do the +approximate inverse of `++ease`. We create a rave out of the given request and +send it off to the foreign desk by putting it in `say`. Note that the rave is +created to request the information starting at the next revision number. Since +this is a new request, we put it into `fod` and `bom` to associate the request +with its duct and its sequence number. Since we're using another sequence +number, we must increment `nix`, which represents the next available sequence +number. + +And that's really it for this side of the request. Requesting foreign +information isn't that hard. Let's see what it looks like on the other side. +When we get a request from another ship for information on our ship, that comes +to us in the form of a `%wart` from ames. + +We handle a `%wart` in `++call`, right next to where we handle the `%warp` case. + +``` + %wart + ?> ?=(%re q.q.hic) + =+ ryf=((hard riff) s.q.hic) + :_ ..^$ + :~ :- hen + :^ %pass [(scot %p p.p.q.hic) (scot %p q.p.q.hic) r.q.hic] + %c + [%warp [p.p.q.hic p.p.q.hic] ryf] + == +``` + +Every request we receive should be of type `riff`, so we coerce it into that +type. We just convert this into a new `%warp` kiss that we pass to ourself. +This gets handled like normal, as a local request. When the request produces +a value, it does so like normal as a `%writ`, which is returned to `++take` +along the path we just sent it on. + +``` + %writ + ?> ?=([@ @ *] tea) + =+ our=(need (slaw %p i.tea)) + =+ him=(need (slaw %p i.t.tea)) + :_ ..^$ + :~ :- hen + [%pass ~ %a [%want [our him] [%r %re %c t.t.tea] p.+.q.hin]] + == +``` + +Since we encoded the ship we need to respond to in the path, we can just pass +our `%want` back to ames, so that we tell the requesting ship about the new +data. + +This comes back to the original ship as a `%waft` from ames, which comes into +`++take`, right next to where we handled `%writ`. + +``` + %waft + ?> ?=([@ @ ~] tea) + =+ syd=(need (slaw %tas i.tea)) + =+ inx=(need (slaw %ud i.t.tea)) + =+ ^= zat + =< wake + (knit:(do now p.+.q.hin syd ruf) [inx ((hard riot) q.+.q.hin)]) + =^ mos ruf + =+ zot=abet.zat + [-.zot (posh q.p.+.q.hin syd +.zot ruf)] + [mos ..^$(ran.ruf ran.zat)] :: merge in new obj +``` + +This gets the desk and sequence number from the path the request was sent over. +This determines exactly which request is being responded to. We call +`++knit:de` to apply the changes to our local desk, and we call `++wake` to +update our subscribers. Then we call `++abet:de` and `++posh` as normal (like +in `++eave`). + +We'll examine `++knit` and `++wake`, in that order. + +``` + ++ knit :: external change + |= [inx=@ud rot=riot] + ^+ +> + ?> ?=(^ ref) + |- ^+ +>+.$ + =+ ruv=(~(get by bom.u.ref) inx) + ?~ ruv +>+.$ + => ?. |(?=(~ rot) ?=(& -.q.u.ruv)) . + %_ . + bom.u.ref (~(del by bom.u.ref) inx) + fod.u.ref (~(del by fod.u.ref) p.u.ruv) + == + ?~ rot + =+ rav=`rave`q.u.ruv + %= +>+.$ + lim + ?.(&(?=(| -.rav) ?=(%da -.q.p.rav)) lim `@da`p.q.p.rav) + :: + haw.u.ref + ?. ?=(& -.rav) haw.u.ref + (~(put by haw.u.ref) p.rav ~) + == + ?< ?=(%v p.p.u.rot) + =. haw.u.ref + (~(put by haw.u.ref) [p.p.u.rot q.p.u.rot q.u.rot] ~ r.u.rot) + ?. ?=(%w p.p.u.rot) +>+.$ + |- ^+ +>+.^$ + =+ nez=[%w [%ud let.dom] ~] + =+ nex=(~(get by haw.u.ref) nez) + ?~ nex +>+.^$ + ?~ u.nex +>+.^$ :: should never happen + =. +>+.^$ =+ roo=(edis ((hard nako) u.u.nex)) + ?>(?=(^ ref.roo) roo) + %= $ + haw.u.ref (~(del by haw.u.ref) nez) + == +``` + +This is kind of a long gate, but don't worry, it's not bad at all. + +First, we assert that we're not a domestic desk. That wouldn't make any sense +at all. + +Since we have the sequence number of the request, we can get the duct and rave +from `bom` in our request manager. If we didn't actually request this data (or +the request was canceled before we got it), then we do nothing. + +Else, we remove the request from `bom` and `fod` unless this was a subscription +request and we didn't receive a null riot (which would indicate the last +message on the subscription). + +Now, if we received a null riot, then if this was a subscription request by +date, then we update `lim` in our request manager (representing the latest time +at which we have complete information for this desk) to the date that was +requested. If this was a single read request, then we put the result in our +simple cache `haw` to make future requests faster. Then we're done. + +If we received actual data, then we put it into our cache `haw`. Unless it's a +`%w` request, we're done. + +If it is a `%w` request, then we try to get the `%w` at our current head from +the cache. In general, that should be the thing we just put in a moment ago, +but that is not guaranteed. The most common case where this is different is +when we receive desk updates out of order. At any rate, since we now have new +information, we need to apply it to our local copy of the desk. We do so in +`++edis`, and then we remove the stuff we just applied from the cache, since +it's not really a true "single read", like what should really be in the cache. + +``` + ++ edis :: apply subscription + |= nak=nako + ^+ +> + %= +> + hit.dom (~(uni by hit.dom) gar.nak) + let.dom let.nak + lat.ran %+ roll (~(tap in bar.nak) ~) + =< .(yeb lat.ran) + |= [sar=blob yeb=(map lobe blob)] + =+ zax=(blob-to-lobe sar) + %+ ~(put by yeb) zax sar + hut.ran %+ roll (~(tap in lar.nak) ~) + =< .(yeb hut.ran) + |= [sar=yaki yeb=(map tako yaki)] + %+ ~(put by yeb) r.sar sar + == +``` + +This shows, of course, exactly why nako is defined the way it is. To become +completely up to date with the foreign desk, we need to merge `hit` with the +foreign one so that we have all the revision numbers. We update `let` so that +we know which revision is the head. + +We merge the new blobs in `lat`, keying them by their hash, which we get from a +call to `++blob-to-lobe`. Recall that the hash is stored in the actual blob +itself. We do the same thing to the new yakis, putting them in `hut`, keyed by +their hash. + +Now, our local dome should be exactly the same as the foreign one. + +This concludes our discussion of `++knit`. Now the changes have been applied to +our local copy of the desk, and we just need to update our subscribers. We do +so in `++wake:de`. + +``` + ++ wake :: update subscribers + ^+ . + =+ xiq=(~(tap by qyx) ~) + =| xaq=(list ,[p=duct q=rove]) + |- ^+ ..wake + ?~ xiq + ..wake(qyx (~(gas by *cult) xaq)) + ?- -.q.i.xiq + & + =+ cas=?~(ref ~ (~(get by haw.u.ref) `mood`p.q.i.xiq)) + ?^ cas + %= $ + xiq t.xiq + ..wake ?~ u.cas (blub p.i.xiq) + (blab p.i.xiq p.q.i.xiq u.u.cas) + == + =+ nao=(~(case-to-aeon ze lim dom ran) q.p.q.i.xiq) + ?~ nao $(xiq t.xiq, xaq [i.xiq xaq]) + $(xiq t.xiq, ..wake (balk p.i.xiq u.nao p.q.i.xiq)) + :: + | + =+ mot=`moot`p.q.i.xiq + =+ nab=(~(case-to-aeon ze lim dom ran) p.mot) + ?~ nab + $(xiq t.xiq, xaq [i.xiq xaq]) + =+ huy=(~(case-to-aeon ze lim dom ran) q.mot) + ?~ huy + =+ ptr=[%ud +(let.dom)] + %= $ + xiq t.xiq + xaq [[p.i.xiq [%| ptr q.mot r.mot s.mot]] xaq] + ..wake =+ ^= ear + (~(lobes-at-path ze lim dom ran) let.dom r.p.q.i.xiq) + ?: =(s.p.q.i.xiq ear) ..wake + =+ fud=(~(make-nako ze lim dom ran) u.nab let.dom) + (bleb p.i.xiq let.dom fud) + == + %= $ + xiq t.xiq + ..wake =- (blub:- p.i.xiq) + =+ ^= ear + (~(lobes-at-path ze lim dom ran) u.huy r.p.q.i.xiq) + ?: =(s.p.q.i.xiq ear) (blub p.i.xiq) + =+ fud=(~(make-nako ze lim dom ran) u.nab u.huy) + (bleb p.i.xiq +(u.nab) fud) + == + == + -- +``` + +This is even longer than `++knit`, but it's pretty similar to `++eave`. We loop +through each of our subscribers `xiq`, processing each in turn. When we're done, +we just put the remaining subscribers back in our subscriber list. + +If the subscriber is a single read, then, if this is a foreign desk (note that +`++wake` is called from other arms, and not only on foreign desks). Obviously, +if we find an identical request there, then we can produce the result +immediately. Referential transparency for the win. We produce the result with +a call to `++blab`. If this is a foreign desk but the result is not in the +cache, then we produce `++blub` (canceled subscription with no data) for +reasons entirely opaque to me. Seriously, it seems like we should wait until +we get an actual response to the request. If someone figures out why this is, +let me know. At any rate, it seems to work. + +If this is a domestic desk, then we check to see if the case exists yet. If +it doesn't, then we simply move on to the next subscriber, consing this one +onto `xaq` so that we can check again the next time around. If it does exist, +then we call `++balk` to fulfill the request and produce it. + +`++balk` is very simple, so we'll describe it here before we get to the +subscription case. + +``` + ++ balk :: read and send + |= [hen=duct yon=@ud mun=mood] + ^+ +> + =+ vid=(~(read-at-aeon ze lim dom ran) yon mun) + ?~ vid (blub hen) (blab hen mun u.vid) +``` + +We call `++read-at-aeon` on the given request and aeon. If you recall, this +processes a `mood` at a particular aeon and produces the result, if there is +one. If there is data at the requested location, then we produce it with +`++blab`. Else, we call `++blub` to notify the subscriber that no data can +ever come over this subscriptioin since it is now impossible for there to ever +be data for the given request. Because referential transparency. + +At any rate, back to `++wake`. If the given rave is a subscription request, +then we proceed similarly to how we do in `++eave`. We first try to get the +aeon referred to by the starting case. If it doesn't exist yet, then we can't +do anything interesting with this subscription, so we move on to the next one. + +Otherwise, we try to get the aeon referrred to by the ending case. If it +doesn't exist yet, then we produce all the information we can. We call +`++lobes-at-path` at the given aeon and path to see if the requested path has +actually changed. If it hasn't, then we don't produce anything; else, we +produce the correct nako by calling `++bleb` on the result of `++make-nako`, as +in `++eave`. At any rate, we move on to the next subscription, putting back +into our cult the current subscription with a new start case of the next aeon +after the present. + +If the aeon referred to by the ending case does exist, then we drop this +subscriber from our cult and satisfy its request immediately. This is the same +as before -- we check to see if the data at the path has actually changed, +producing it if it has; else, we call `++blub` since no more data can be +produced over this subscription. + +This concludes our discussion of foreign requests. diff --git a/try/bin/merge.hoon b/try/bin/merge.hoon index 824ed4c15a..f49bed92a0 100644 --- a/try/bin/merge.hoon +++ b/try/bin/merge.hoon @@ -25,7 +25,7 @@ vsr == =+ ^= lum - %- ~(auld ze est ves ran) + %- ~(construct-merge ze est ves ran) [?~(gem %fine -.gem) (need (slaw 'p' sen.pen)) den.pen sab est] ?~ lum ^- gift