This commit is contained in:
Philip C Monk 2015-01-12 20:50:41 -05:00
parent 0844c4e043
commit 308fca2ea2
2 changed files with 371 additions and 402 deletions

View File

@ -78,7 +78,6 @@
[%dune p=(set beam) q=(unit cage)] :: unit literal [%dune p=(set beam) q=(unit cage)] :: unit literal
[%mute p=silk q=(list (pair wing silk))] :: mutant [%mute p=silk q=(list (pair wing silk))] :: mutant
[%pact p=silk q=silk] :: patch [%pact p=silk q=silk] :: patch
[%plan p=beam q=spur r=hood] :: structured assembly
[%reef ~] :: kernel reef [%reef ~] :: kernel reef
[%ride p=twig q=silk] :: silk thru twig [%ride p=twig q=silk] :: silk thru twig
[%vale p=mark q=ship r=*] :: validate [our his] [%vale p=mark q=ship r=*] :: validate [our his]
@ -97,7 +96,7 @@
$: lim=@da :: complete to $: lim=@da :: complete to
qyx=cult :: subscribers qyx=cult :: subscribers
ref=(unit rind) :: outgoing requests ref=(unit rind) :: outgoing requests
wok=work :: outstanding diffs wok=(unit work) :: outstanding diffs
dom=dome :: revision state dom=dome :: revision state
== :: == ::
++ riff ,[p=desk q=(unit rave)] :: request/desist ++ riff ,[p=desk q=(unit rave)] :: request/desist
@ -290,58 +289,61 @@
| :_ yel | :_ yel
[hen %note '=' %leaf :(weld (trip p.lem) " " (spud pre))] [hen %note '=' %leaf :(weld (trip p.lem) " " (spud pre))]
& |- ^+ yel & |- ^+ yel
?~ q.q.lem yel ?~ q.p.lem yel
:_ $(q.q.lem t.q.q.lem) :_ $(q.p.lem t.q.p.lem)
:- hen :- hen
:+ %note :+ %note
?-(-.q.i.q.q.lem %del '-', %ins '+', %mut ':') ?-(-.q.i.q.p.lem %del '-', %ins '+', %mut ':', %dif ';')
[%leaf (spud (weld pre p.i.q.q.lem))] [%leaf (spud (weld pre p.i.q.p.lem))]
== ==
== ==
:: ::
++ edit :: apply changes ++ edit :: apply changes
|= [wen=@da lem=nori] |= [wen=@da lem=nori]
^+ +> ^+ +>
?. -.lem ?: ?=(%| -.lem)
=+ axe=(~(edit ze lim dom ran) wen lem) =+ axe=(~(edit ze lim dom ran) wen lem)
=+ `[l=@da d=dome r=rang]`+<.axe =+ `[l=@da d=dome r=rang]`+<.axe
+>.$(dom d, ran r) +>.$(dom d, ran r) :: XX checkout-ankh
?^ wok ?. =(~ wok)
~& %already-applying-changes !! ~& %already-applying-changes !!
=+ ^- lon=(list path) =+ ^- lon=(list path)
(murn q.p.lem |=([a=path b=miso] ?.(?=(%mut -.b) ~ `a))) (murn q.p.lem |=([a=path b=miso] ?.(?=(%mut -.b) ~ (some a))))
=+ ^- sot=(list ,[p=path q=misu]) =+ ^- sot=(list ,[p=path q=misu])
(murn q.p.lem |=([a=path b=miso] ?:(?=(%mut -.b) ~ `[a `misu`b]))) %+ murn q.p.lem
=. wok `[sot lon] |=([a=path b=miso] ?:(?=(%mut -.b) ~ (some [a `misu`b])))
=. wok `[sot lon]
?~ lon ?~ lon
apply-edit (apply-edit wen)
=+ ^- los=(list ,[duct path note]) =+ ^- los=(list ,[duct path note])
(murn q.p.lem |=([a=path b=miso] ?.(?=(%mut -.b) ~ `(silkify a b)))) %+ murn q.p.lem
|=([a=path b=miso] ?.(?=(%mut -.b) ~ (some (silkify wen a b))))
%_(+>.$ tag (welp los tag)) %_(+>.$ tag (welp los tag))
:: ::
++ silkify ++ silkify
|= [a=path %mut b=cage c=cage] |= [wen=@da a=path %mut b=cage c=cage]
^- [duct path note] ^- [duct path note]
:+ hen :+ hen
[%diffing (scot %p who) syd a] [%diffing (scot %p who) syd (scot %da wen) a]
[%f %exec who ~ %diff [%done ~ b] [%done ~ c]] [%f %exec who ~ %diff [%done ~ b] [%done ~ c]]
:: ::
++ apply-edit ++ apply-edit
^- . |= wen=@da
^+ +>
?~ wok ~& %no-changes !! ?~ wok ~& %no-changes !!
?^ lon.u.wok ~& %not-done-diffing !! ?^ lon.u.wok ~& %not-done-diffing !!
=+ axe=(~(edit ze lim dom ran) wen %& *cart wok.wok) =+ axe=(~(edit ze lim dom ran) wen %& *cart sot.u.wok)
=+ `[l=@da d=dome r=rang]`+<.axe =+ `[l=@da d=dome r=rang]`+<.axe
+>(dom d, ran r, wok ~) +>.$(dom d, ran r, wok ~) :: XX checkout-ankh
:: ::
++ take-diff ++ take-diff
|= [pax=path res=(each bead (list tank))] |= [wen=@da pax=path res=(each bead (list tank))]
^+ +> ^+ +>
?~ wok ?~ wok
~& %clay-unexpected-made !! ~& %clay-unexpected-made !!
?. (lien lon.u.wok |=(path =(+< pax))) ?. (lien lon.u.wok |=(path =(+< pax)))
~& %clay-strange-made !! ~& %clay-strange-made !!
?. -.res ?: ?=(%| -.res)
%_ +>.$ %_ +>.$
wok ~ wok ~
tag tag
@ -349,17 +351,17 @@
^- (list ,[duct path note]) ^- (list ,[duct path note])
%+ murn lon.u.wok %+ murn lon.u.wok
|= a=path |= a=path
?: =(pax a) ?: =(pax a) ~
`[hen [%diffing (scot %p who) syd a] %f %exec who ~] `[hen [%diffing (scot %p who) syd (scot %da wen) a] %f %exec who ~]
:: ::
yel yel
[[hen %note '!' %rose [" " "" ""] leaf/"clay diff failed" p.res] yel] [[hen %note '!' %rose [" " "" ""] leaf/"clay diff failed" p.res] yel]
== ==
=: lon.wok (skip lon.u.wok |=(path =(+< pax))) =: lon.u.wok (skip lon.u.wok |=(path =(+< pax)))
sot.wok [[pax %dif q.p.res] sot.u.wok] sot.u.wok [[pax %dif q.p.res] sot.u.wok]
== ==
?~ lon.wok ?~ lon.wok
apply-edit (apply-edit wen)
+>.$ +>.$
:: ::
++ edis :: apply subscription ++ edis :: apply subscription
@ -797,12 +799,13 @@
[[[hen %slip %d %flog +.q.hin] ~] ..^$] [[[hen %slip %d %flog +.q.hin] ~] ..^$]
:: ::
%made %made
?> ?=([%diffing @ @ *] tea) ?> ?=([%diffing @ @ @ *] tea)
=+ who=(slav %p i.t.tea) =+ who=(slav %p i.t.tea)
=+ syd=(slav %tas i.t.t.tea) =+ syd=(slav %tas i.t.t.tea)
=+ wen=(slav %da i.t.t.t.tea)
=^ mos ruf =^ mos ruf
=+ ^= zat =+ ^= zat
(take-diff:(di:wake:une syd) t.t.t.tea p.q.hin) (take-diff:(di:wake:une syd) t.t.t.t.tea p.q.hin)
=+ zot=abet.zat =+ zot=abet.zat
[-.zot abet:(pish:une syd +.zot ran.zat)] [-.zot abet:(pish:une syd +.zot ran.zat)]
[mos ..^$] [mos ..^$]

View File

@ -2,6 +2,7 @@
:: zuse (3), standard library (tang) :: zuse (3), standard library (tang)
:: ::
~% %zuse + ~ ~% %zuse + ~
!:
|% |%
:::::::::::::::::::::::::::::::::::::::::::::::::::::: :: :::::::::::::::::::::::::::::::::::::::::::::::::::::: ::
:::: chapter 3b, Arvo libraries :::: :::: chapter 3b, Arvo libraries ::::
@ -1010,7 +1011,7 @@
?- -.mis ?- -.mis
%del [%ins p.mis] %del [%ins p.mis]
%ins [%del p.mis] %ins [%del p.mis]
%dif [%dif (limp p.mis)] %dif [%dif p.mis] :: XX incorrect
%mut [%mut q.mis p.mis] %mut [%mut q.mis p.mis]
== ==
:: ::
@ -1048,28 +1049,6 @@
== ==
:: ::
++ ze !: ++ ze !:
=+ ^= silk
$& [p=silk q=silk]
$% [%bake p=mark q=beam r=path]
[%boil p=mark q=beam r=path]
[%call p=silk q=silk]
[%cast p=mark q=silk]
[%diff p=silk q=silk]
[%done p=(set beam) q=cage]
[%dude p=tank q=silk]
[%dune p=(set beam) q=(unit cage)]
[%mute p=silk q=(list (pair wing silk))]
[%pact p=silk q=silk]
[%plan p=beam q=spur r=hood]
[%reef ~]
[%ride p=twig q=silk]
[%vale p=mark q=ship r=*]
==
=+ ^= silk
$% [%diff p=cage q=cage]
[%pact p=cage q=(list cage)]
==
=| mow=(list silk)
|_ [lim=@da dome rang] |_ [lim=@da dome rang]
++ aeon-to-tako ~(got by hit) ++ aeon-to-tako ~(got by hit)
++ aeon-to-yaki (cork aeon-to-tako tako-to-yaki) ++ aeon-to-yaki (cork aeon-to-tako tako-to-yaki)
@ -1083,72 +1062,57 @@
:: ::
++ tako-to-yaki ~(got by hut) :: grab yaki ++ tako-to-yaki ~(got by hut) :: grab yaki
++ lobe-to-blob ~(got by lat) :: grab blob ++ lobe-to-blob ~(got by lat) :: grab blob
++ lobe-to-noun :: grab blob ++ lobe-to-cage :: grab blob
|= p=lobe :: ^- * |= p=lobe :: ^- maybe cage
%- blob-to-noun ^- (each cage ,*)
%- blob-to-cage
(lobe-to-blob p) (lobe-to-blob p)
:: ::
++ make-direct :: make blob ++ make-direct :: make blob
|= [p=* q=umph] |= [p=cage]
^- blob ^- blob
[%direct (mug p) p q] [%direct (mug p) p]
:: ::
++ make-delta :: make blob delta ++ make-delta :: make blob delta
|= [p=lobe q=cage] |= [p=lobe q=cage]
^- blob ^- blob
=+ t=[%delta 0 p q] =+ t=[%delta 0 p q]
=+ z=(blob-to-noun t) =+ z=(blob-to-cage t)
=+ ^= has =+ ^= has
%^ cat 7 (sham [%blob z]) %^ cat 7 (sham [%blob z])
(sham [%lobe z]) (sham [%lobe z])
[%delta has p q] [%delta has p q]
:: ::
++ blob-to-umph :: blob umph [prep] ++ blob-to-cage
|= p=blob :: used in merge
^- umph
?- -.p
%delta p.r.p
%direct r.p
%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
==
::
++ new-blob-to-cage
|= p=blob |= p=blob
:: ^- (each cage ,[cage this]) :: ^- (each cage ,[cage this])
?- -.p ?- -.p
%direct [%& q.p] %direct [%& q.p]
%indirect [%& q.p] %indirect [%& q.p]
%delta [%| r.p $(p q.p)] %delta [%| r.p $(p (lobe-to-blob q.p))]
== ==
:: ::
:: ::
++ diff-yakis :: fundamental diff ++ diff-yakis :: fundamental diff
|= [p=yaki q=yaki] |= [p=yaki q=yaki]
^- (map path miso) ^- (map path miso)
%+ roll (~(tap in (luth q.p q.q)) ~) !!
|= [pat=path yeb=(map path miso)] :: %+ roll (~(tap in (luth q.p q.q)) ~)
=+ leb=(~(get by q.p) pat) :: |= [pat=path yeb=(map path miso)]
=+ lob=(~(get by q.q) pat) :: =+ leb=(~(get by q.p) pat)
?~ leb (~(put by yeb) pat [%ins (lobe-to-noun (need lob))]) :: =+ lob=(~(get by q.q) pat)
?~ lob (~(put by yeb) pat [%del (lobe-to-noun (need leb))]) :: ?~ leb (~(put by yeb) pat [%ins (lobe-to-cage (need lob))])
?: =(u.leb u.lob) yeb :: ?~ lob (~(put by yeb) pat [%del (lobe-to-cage (need leb))])
=+ veq=(lobe-to-blob u.leb) :: ?: =(u.leb u.lob) yeb
=+ voq=(lobe-to-blob u.lob) :: =+ veq=(lobe-to-blob u.leb)
%+ ~(put by yeb) pat :: =+ voq=(lobe-to-blob u.lob)
:- %dif :: %+ ~(put by yeb) pat
?: &(?=(%delta -.voq) =(u.leb q.voq)) :: avoid diff :: :- %dif
r.voq :: ?: &(?=(%delta -.voq) =(u.leb q.voq)) :: avoid diff
=+ zeq=(blob-to-noun veq) :: r.voq
=+ zoq=(blob-to-noun voq) :: =+ zeq=(blob-to-noun veq)
((diff (blob-to-umph (lobe-to-blob u.leb))) zeq zoq) :: =+ zoq=(blob-to-noun voq)
:: ((diff (blob-to-umph (lobe-to-blob u.leb))) zeq zoq)
:: ::
++ lobes-at-path :: lobes-at-path:ze ++ lobes-at-path :: lobes-at-path:ze
|= [yon=aeon pax=path] :: data at path |= [yon=aeon pax=path] :: data at path
@ -1322,13 +1286,13 @@
(~(put by bat) pat (lobe-to-blob gar)) :: use original (~(put by bat) pat (lobe-to-blob gar)) :: use original
^= bar ^- (map path blob) ^= bar ^- (map path blob)
%+ roll lar %+ roll lar
|= [[pat=path mys=miso] bar=(map path blob)] |= [[pat=path mys=misu] bar=(map path blob)]
^+ bar ^+ bar
?- -.mys ?- -.mys
%ins :: insert if not exist %ins :: insert if not exist
?: (~(has by bar) pat) !! :: ?: (~(has by bar) pat) !! ::
?: (~(has by hat) pat) !! :: ?: (~(has by hat) pat) !! ::
(~(put by bar) pat (make-direct p.mys %c)) :: TODO content type? (~(put by bar) pat (make-direct p.mys))
%del :: delete if exists %del :: delete if exists
?. |((~(has by hat) pat) (~(has by bar) pat)) !! ?. |((~(has by hat) pat) (~(has by bar) pat)) !!
(~(del by bar) pat) (~(del by bar) pat)
@ -1351,8 +1315,9 @@
^- ankh ^- ankh
%- cosh %- cosh
?~ pat ?~ pat
=+ zar=(lobe-to-noun bar) =+ zar=(lobe-to-cage bar)
ank(q [~ (sham zar) zar]) ?> ?=(%& -.zar)
ank(q [~ (sham `cage`p.zar) p.zar])
=+ nak=(~(get by r.ank) i.pat) =+ nak=(~(get by r.ank) i.pat)
%= ank %= ank
r %+ ~(put by r.ank) i.pat r %+ ~(put by r.ank) i.pat
@ -1558,261 +1523,260 @@
== ==
== ==
== ==
++ qeal :: merge p,q :: ++ qeal :: merge p,q
|* [us=[ship desk] th=[ship desk] pat=path p=miso q=miso r=(list) con=?] :: |* [us=[ship desk] th=[ship desk] pat=path p=miso q=miso r=(list) con=?]
^- miso :: in case of conflict :: ^- miso :: in case of conflict
~| %qeal-fail :: ~| %qeal-fail
?> ?=(%dif -.p) :: ?> ?=(%dif -.p)
?> ?=(%dif -.q) :: ?> ?=(%dif -.q)
?> ?=(%c -.q.p.p) :: ?> ?=(%c -.q.p.p)
?> ?=(%c -.q.p.q) :: ?> ?=(%c -.q.p.q)
=+ s=(clean p.q.p.p) :: =+ s=(clean p.q.p.p)
=+ t=(clean p.q.p.q) :: =+ t=(clean p.q.p.q)
:- %dif :: :- %dif
:- %c :: todo is this p.p.p? :: :- %c :: todo is this p.p.p?
:- %c :: :- %c
|- ^- (urge) :: |- ^- (urge)
::?~ s ?: (qual t) t :: ::?~ s ?: (qual t) t
:: ~| %qail-conflict !! :: :: ~| %qail-conflict !!
::?~ t ?: (qual s) s :: ::?~ t ?: (qual s) s
:: ~| %qail-conflict !! :: :: ~| %qail-conflict !!
?~ s t :: ?~ s t
?~ t s :: ?~ t s
?- -.i.s :: ?- -.i.s
%& :: %&
?- -.i.t :: ?- -.i.t
%& :: %&
?: =(p.i.s p.i.t) :: ?: =(p.i.s p.i.t)
[i.s $(s t.s, t t.t, r (slag p.i.s r))] :: [i.s $(s t.s, t t.t, r (slag p.i.s r))]
?: (gth p.i.s p.i.t) :: ?: (gth p.i.s p.i.t)
[i.t $(t t.t, p.i.s (sub p.i.s p.i.t), r (slag p.i.t r))] :: [i.t $(t t.t, p.i.s (sub p.i.s p.i.t), r (slag p.i.t r))]
[i.s $(s t.s, p.i.t (sub p.i.t p.i.s), r (slag p.i.s r))] :: [i.s $(s t.s, p.i.t (sub p.i.t p.i.s), r (slag p.i.s r))]
%| :: %|
?: =(p.i.s (lent p.i.t)) :: ?: =(p.i.s (lent p.i.t))
[i.t $(s t.s, t t.t, r (slag p.i.s r))] :: [i.t $(s t.s, t t.t, r (slag p.i.s r))]
?: (gth p.i.s (lent p.i.t)) :: ?: (gth p.i.s (lent p.i.t))
:- i.t :: :- i.t
$(t t.t, p.i.s (sub p.i.s (lent p.i.t)), r (slag (lent p.i.t) r)) :: $(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 :: ?. con ~| %quil-conflict !! :: conflict
~& [%quil-conflict-soft pat] :: ~& [%quil-conflict-soft pat]
=+ mar=(match-conflict 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.mar] $(s p.q.mar, t q.q.mar, r r.q.mar)]
== :: ==
%| :: %|
?- -.i.t :: ?- -.i.t
%| :: %|
?. con ~| %quil-conflict !! :: ?. con ~| %quil-conflict !!
~& [%quil-conflict-soft pat] :: ~& [%quil-conflict-soft pat]
=+ mar=(match-conflict 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.mar] $(s p.q.mar, t q.q.mar, r r.q.mar)]
%& :: %&
?: =(p.i.t (lent p.i.s)) :: ?: =(p.i.t (lent p.i.s))
[i.s $(s t.s, t t.t, r (slag p.i.t r))] :: [i.s $(s t.s, t t.t, r (slag p.i.t r))]
?: (gth p.i.t (lent p.i.s)) :: ?: (gth p.i.t (lent p.i.s))
:- 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)) :: $(s t.s, p.i.t (sub p.i.t (lent p.i.s)), r (slag (lent p.i.s) r))
?. con ~| %quil-conflict !! :: ?. con ~| %quil-conflict !!
~& [%quil-conflict-soft pat] :: ~& [%quil-conflict-soft pat]
=+ mar=(match-conflict 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.mar] $(s p.q.mar, t q.q.mar, r r.q.mar)]
== :: ==
== :: ==
++ quil :: merge p,q :: ++ quil :: merge p,q
|= $: us=[ship desk] :: |= $: us=[ship desk]
th=[ship desk] :: th=[ship desk]
pat=path :: pat=path
p=(unit miso) :: p=(unit miso)
q=(unit miso) :: q=(unit miso)
r=(unit (list)) :: r=(unit (list))
con=? :: con=?
== :: ==
^- (unit miso) :: ^- (unit miso)
?~ p q :: trivial :: ?~ p q :: trivial
?~ q p :: trivial :: ?~ q p :: trivial
?- -.u.p :: ?- -.u.p
%ins ?> ?=(%ins -.u.q) :: %ins ?> ?=(%ins -.u.q)
?. con !! :: ?. con !!
%- some :: %- some
:- %ins :: :- %ins
%- role :: %- role
%- annotate :: %- annotate
:- us :: :- us
:- th :: :- th
:- (lore ((hard ,@) p.u.p)) :: :- (lore ((hard ,@) p.u.p))
:- (lore ((hard ,@) p.u.q)) :: :- (lore ((hard ,@) p.u.q))
~ :: ~
%del p :: %del p
%dif ?> ?=(%dif -.u.q) :: %dif ?> ?=(%dif -.u.q)
%- some :: %- some
%^ qeal us th :: %^ qeal us th
:^ pat u.p u.q :: merge p,q :: :^ pat u.p u.q :: merge p,q
:- %- need r :: :- %- need r
con :: con
== :: ==
:: :: ::
++ meld :: merge p,q from r :: ++ meld :: merge p,q from r
|= [p=yaki q=yaki r=yaki con=? us=[ship desk] th=[ship desk]] :: |= [p=yaki q=yaki r=yaki con=? us=[ship desk] th=[ship desk]]
^- (map path blob) :: ^- (map path blob)
=+ s=(diff-yakis r p) :: =+ s=(diff-yakis r p)
=+ t=(diff-yakis r q) :: =+ t=(diff-yakis r q)
=+ lut=(luth s t) :: =+ lut=(luth s t)
%- |= res=(map path blob) :: add old :: %- |= res=(map path blob) :: add old
^- (map path blob) :: ^- (map path blob)
%- ~(uni by res) :: %- ~(uni by res)
%- mo :: %- mo
%+ turn :: %+ turn
%+ skip (~(tap by q.r) ~) :: loop through old :: %+ skip (~(tap by q.r) ~) :: loop through old
|= [pat=path bar=lobe] ^- ? :: |= [pat=path bar=lobe] ^- ?
(~(has in lut) pat) :: skip updated :: (~(has in lut) pat) :: skip updated
|= [pat=path bar=lobe] ^- [path blob] :: |= [pat=path bar=lobe] ^- [path blob]
[pat (lobe-to-blob bar)] :: lookup objects :: [pat (lobe-to-blob bar)] :: lookup objects
%+ roll (~(tap in (luth s t)) ~) :: %+ roll (~(tap in (luth s t)) ~)
|= [pat=path res=(map path blob)] :: |= [pat=path res=(map path blob)]
=+ ^= v :: =+ ^= v
%- need :: %- need
%^ quil us th :: %^ quil us th
:- pat :: :- pat
:+ (~(get by s) pat) :: :+ (~(get by s) pat)
(~(get by t) pat) :: (~(get by t) pat)
:_ con :: :_ con
%- %- lift lore :: %- %- lift lore
%- %- lift %- hard ,@ :: for %c :: %- %- lift %- hard ,@ :: for %c
%- %- lift lobe-to-noun :: %- %- lift lobe-to-cage
%- ~(get by q.r) :: %- ~(get by q.r)
pat :: pat
?- -.v :: ?- -.v
%del res :: no longer exists :: %del res :: no longer exists
%ins :: new file :: %ins :: new file
%+ ~(put by res) pat :: %+ ~(put by res) pat
%+ make-direct p.v %c :: TODO content type? :: (make-direct p.v)
%dif :: patch from r :: %dif :: patch from r
%+ ~(put by res) pat :: %+ ~(put by res) pat
%- make-direct :: %- make-direct
:_ %c :: %+ lump p.v
%+ lump p.v :: %- lobe-to-cage
%- lobe-to-noun :: %- ~(got by q.r) pat
%- ~(got by q.r) pat :: ==
== :: ::
:: :: :: merge types
:: merge types :: ::
:: :: ++ mate :: merge p,q
++ mate :: merge p,q :: |= con=? :: %mate, %meld
|= con=? :: %mate, %meld :: |= [p=yaki q=yaki us=[ship desk] th=[ship desk]]
|= [p=yaki q=yaki us=[ship desk] th=[ship desk]] :: ^- (map path blob)
^- (map path blob) :: =+ r=(~(tap in (find-merge-points p q)) ~)
=+ r=(~(tap in (find-merge-points p q)) ~) :: ?~ r
?~ r :: ~|(%mate-no-ancestor !!)
~|(%mate-no-ancestor !!) :: ?: =(1 (lent r))
?: =(1 (lent r)) :: (meld p q i.r con us th)
(meld p q i.r con us th) :: ~|(%mate-criss-cross !!)
~|(%mate-criss-cross !!) :: ::
:: :: ++ keep :: %this
++ keep :: %this :: |= [p=yaki q=yaki [ship desk] [ship desk]]
|= [p=yaki q=yaki [ship desk] [ship desk]] :: ^- (map path blob)
^- (map path blob) :: %+ roll (~(tap by q.p) ~)
%+ roll (~(tap by q.p) ~) :: |= [[pat=path lob=lobe] zar=(map path blob)]
|= [[pat=path lob=lobe] zar=(map path blob)] :: ^- (map path blob)
^- (map path blob) :: (~(put by zar) pat (lobe-to-blob lob))
(~(put by zar) pat (lobe-to-blob lob)) :: ::
:: :: ++ drop :: %that
++ drop :: %that :: |= [p=yaki q=yaki r=[ship desk] s=[ship desk]]
|= [p=yaki q=yaki r=[ship desk] s=[ship desk]] :: ^- (map path blob)
^- (map path blob) :: (keep q p r s)
(keep q p r s) :: ::
:: :: ++ forge :: %forge
++ forge :: %forge :: |= [p=yaki q=yaki s=[ship desk] t=[ship desk]]
|= [p=yaki q=yaki s=[ship desk] t=[ship desk]] :: ^- (map path blob)
^- (map path blob) :: =+ r=(~(tap in (find-merge-points p q)) ~)
=+ r=(~(tap in (find-merge-points p q)) ~) :: ?~ r
?~ r :: ~|(%forge-no-ancestor !!)
~|(%forge-no-ancestor !!) :: %- |= [r=yaki lut=(map lobe blob) hat=(map tako yaki)]
%- |= [r=yaki lut=(map lobe blob) hat=(map tako yaki)] :: =. lat lut
=. lat lut :: =. hut hat
=. hut hat :: (meld p q r & s t) :: fake merge
(meld p q r & s t) :: fake merge :: %+ roll t.r :: fake ancestor
%+ roll t.r :: fake ancestor :: |= [par=yaki [for=_i.r lut=_lat hat=_hut]]
|= [par=yaki [for=_i.r lut=_lat hat=_hut]] :: =. lat lut
=. lat lut :: =+ ^= far
=+ ^= far :: ^- (map path lobe)
^- (map path lobe) :: %- ~(urn by (forge par for s t))
%- ~(urn by (forge par for s t)) :: |= [k=path v=blob] (blob-to-lobe v)
|= [k=path v=blob] (blob-to-lobe v) :: =+ u=(make-yaki [r.par r.for ~] far `@da`0) :: fake yaki
=+ u=(make-yaki [r.par r.for ~] far `@da`0) :: fake yaki :: :- u
:- u :: :_ (~(put by hat) r.u u)
:_ (~(put by hat) r.u u) :: =< -
=< - :: %- update-lat
%- update-lat :: :_ ~
:_ ~ :: %- ~(urn by q.u)
%- ~(urn by q.u) :: |= [path k=lobe]
|= [path k=lobe] :: (lobe-to-blob k)
(lobe-to-blob k) :: ::
:: :: :: actual merge
:: actual merge :: ::
:: :: ++ merge
++ merge :: |= [us=[ship desk] th=[ship desk]]
|= [us=[ship desk] th=[ship desk]] :: |= [p=yaki q=yaki r=@da s=$+([yaki yaki [ship desk] [ship desk]] (map path blob))]
|= [p=yaki q=yaki r=@da s=$+([yaki yaki [ship desk] [ship desk]] (map path blob))] :: ^- [yaki (map path blob)]
^- [yaki (map path blob)] :: =+ u=(s p q us th)
=+ u=(s p q us th) :: =+ ^= t
=+ ^= t :: ^- (map path lobe)
^- (map path lobe) :: %+ roll (~(tap by u) ~)
%+ roll (~(tap by u) ~) :: |= [[pat=path bar=blob] yeb=(map path lobe)]
|= [[pat=path bar=blob] yeb=(map path lobe)] :: (~(put by yeb) pat (blob-to-lobe bar))
(~(put by yeb) pat (blob-to-lobe bar)) :: :_ u
:_ u :: (make-yaki [r.p r.q ~] t r)
(make-yaki [r.p r.q ~] t r) :: ::
:: :: ++ strategy :: merge strategy
++ strategy :: merge strategy :: |= gem=?(%meld %mate %that %this)
|= gem=?(%meld %mate %that %this) :: ?- gem
?- gem :: %meld (mate %.y)
%meld (mate %.y) :: %mate (mate %.n)
%mate (mate %.n) :: %this keep
%this keep :: %that drop
%that drop :: ==
== :: ::
:: :: ++ construct-merge :: construct-merge:ze
++ construct-merge :: construct-merge:ze :: |= [gem=germ who=ship des=desk sab=saba now=@da] :: construct merge
|= [gem=germ who=ship des=desk sab=saba now=@da] :: construct merge :: ^- (unit (unit mizu)) ::::::
^- (unit (unit mizu)) :::::: :: =+ for=s.sab :: foreign dome
=+ for=s.sab :: foreign dome :: =+ mer=(merge [who des] [p.sab q.sab])
=+ mer=(merge [who des] [p.sab q.sab]) :: ?- gem
?- gem :: %init :: force fine
%init :: force fine :: ?. =(let 0) :: hell no
?. =(let 0) :: hell no :: !!
!! :: =+ hot=(~(put by *(map aeon 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
[~ [~ [1 hot hut lat]]] :: trivial :: %fine
%fine :: =+ der=(~(got by hit.for) let.for)
=+ der=(~(got by hit.for) let.for) :: =+ owr=(~(got by hit) let)
=+ owr=(~(got by hit) let) :: ?: =(der owr)
?: =(der owr) :: [~ ~]
[~ ~] :: ?: (~(has in (reachable-takos owr)) der)
?: (~(has in (reachable-takos owr)) der) :: [~ ~]
[~ ~] :: ?. (~(has in (reachable-takos der)) owr)
?. (~(has in (reachable-takos der)) owr) :: ~ :: not a fast forward
~ :: not a fast forward :: ~& [%merge-fine p.sab q.sab]
~& [%merge-fine p.sab q.sab] :: [~ [~ [+(let) (~(put by hit) +(let) der) hut lat]]]
[~ [~ [+(let) (~(put by hit) +(let) der) hut lat]]] :: ?(%mate %that %this %meld)
?(%mate %that %this %meld) :: =+ foreign-head=(tako-to-yaki (~(got by hit.for) let.for))
=+ foreign-head=(tako-to-yaki (~(got by hit.for) let.for)) :: =+ our-head=(tako-to-yaki (~(got by hit) let))
=+ our-head=(tako-to-yaki (~(got by hit) let)) :: ?: =(r.foreign-head r.our-head)
?: =(r.foreign-head r.our-head) :: [~ ~] :: up to date
[~ ~] :: up to date :: ?: (~(has in (reachable-takos r.our-head)) r.foreign-head)
?: (~(has in (reachable-takos r.our-head)) r.foreign-head) :: [~ ~] :: up to date
[~ ~] :: up to date :: ?: ?& |(=(gem %mate) =(gem %meld))
?: ?& |(=(gem %mate) =(gem %meld)) :: (~(has in (reachable-takos r.foreign-head)) r.our-head)
(~(has in (reachable-takos r.foreign-head)) r.our-head) :: ==
== :: $(gem %fine) :: use fast forward
$(gem %fine) :: use fast forward :: =+ gar=(mer our-head foreign-head now (strategy gem))
=+ gar=(mer our-head foreign-head now (strategy gem)) :: =+ yak=-.gar
=+ yak=-.gar :: =+ hek=+.gar
=+ hek=+.gar :: =. lat -:(update-lat hek ~) :: add new blobs
=. lat -:(update-lat hek ~) :: add new blobs :: =. hut (~(put by *(map tako yaki)) r.yak yak)
=. hut (~(put by *(map tako yaki)) r.yak yak) :: =. let +(let)
=. let +(let) :: =. hit (~(put by *(map aeon tako)) let r.yak)
=. hit (~(put by *(map aeon tako)) let r.yak) :: [~ [~ [let hit hut lat]]]
[~ [~ [let hit hut lat]]] :: ==
==
:: ::
++ read :: read:ze ++ read :: read:ze
|= mun=mood :: read at point |= mun=mood :: read at point
@ -1848,7 +1812,7 @@
|= [pat=path lob=lobe] |= [pat=path lob=lobe]
=+ zat=(~(get by q) pat) =+ zat=(~(get by q) pat)
?~ zat %.n ?~ zat %.n
=((lobe-to-noun u.zat) (lobe-to-noun lob)) =((lobe-to-cage u.zat) (lobe-to-cage lob))
:: ::
++ edit :: edit:ze ++ edit :: edit:ze
|= [wen=@da lem=nuri] :: edit |= [wen=@da lem=nuri] :: edit
@ -1868,7 +1832,8 @@
hit (~(put by hit) +(let) r.yak) hit (~(put by hit) +(let) r.yak)
hut (~(put by hut) r.yak yak) hut (~(put by hut) r.yak yak)
== ==
+>.$(ank (checkout-ankh q.yak)) +>.$
:: +>.$(ank (checkout-ankh q.yak))
| +>.$(lab ?<((~(has by lab) p.lem) (~(put by lab) p.lem let))) | +>.$(lab ?<((~(has by lab) p.lem) (~(put by lab) p.lem let)))
== ==
-- --
@ -1954,60 +1919,58 @@
=. +.^$ rm-r:(descend p.i.dyr) =. +.^$ rm-r:(descend p.i.dyr)
$(dyr t.dyr) $(dyr t.dyr)
:: ::
++ drum :: apply effect ::++ drum :: apply effect
|= [pax=path mis=miso] :: XX unused (++dune) :: |= [pax=path mis=miso] :: XX unused (++dune)
^+ +> :: ^+ +>
?^ pax :: ?^ pax
update-hash:(ascend:$(pax t.pax, +> (descend i.pax)) i.pax ank) :: update-hash:(ascend:$(pax t.pax, +> (descend i.pax)) i.pax ank)
~| %clay-fail :: ~| %clay-fail
?- -.mis :: ?- -.mis
%del :: %del
?> &(?=(^ q.ank) =(q.u.q.ank p.mis)) :: ?> &(?=(^ q.ank) =(q.u.q.ank p.mis))
+>.$(p.ank (mix p.u.q.ank p.ank), q.ank ~) :: +>.$(p.ank (mix p.u.q.ank p.ank), q.ank ~)
:: :: ::
%ins :: %ins
?> ?=(~ q.ank) :: ?> ?=(~ q.ank)
=+ sam=(sham p.mis) :: =+ sam=(sham p.mis)
+>.$(p.ank (mix sam p.ank), q.ank [~ sam p.mis]) :: +>.$(p.ank (mix sam p.ank), q.ank [~ sam p.mis])
:: :: ::
%dif :: %dif
?> ?=(^ q.ank) :: ?> ?=(^ q.ank)
=+ nex=(lump p.mis q.u.q.ank) :: =+ nex=(lump p.mis q.u.q.ank)
=+ sam=(sham nex) :: =+ sam=(sham nex)
+>.$(p.ank :(mix sam p.u.q.ank p.ank), q.ank [~ sam nex]) :: +>.$(p.ank :(mix sam p.u.q.ank p.ank), q.ank [~ sam nex])
== :: ==
:: ::::
++ dune :: apply ::++ dune :: apply
|- ^+ + :: XX unused (++durn) :: |- ^+ + :: XX unused (++durn)
?~ myz + :: ?~ myz +
=> .(+ (drum p.i.myz q.i.myz)) :: => .(+ (drum p.i.myz q.i.myz))
$(myz ?>(?=(^ myz) t.myz)) :: $(myz ?>(?=(^ myz) t.myz))
:: ::::
++ durn :: apply forward ::++ durn :: apply forward
|= nyp=soba :: XX unused :: |= nyp=soba :: XX unused
^+ +> :: ^+ +>
?: =([0 0] p.nyp) :: ?: =([0 0] p.nyp)
dune(myz q.nyp) :: dune(myz q.nyp)
=> ?: =(p.ank p.p.nyp) . :: => ?: =(p.ank p.p.nyp) .
~& [%durn-in-wrong p.ank p.p.nyp] :: ~& [%durn-in-wrong p.ank p.p.nyp]
. :: .
=. +> dune(myz q.nyp) :: =. +> dune(myz q.nyp)
=> ?: =(p.ank q.p.nyp) . :: => ?: =(p.ank q.p.nyp) .
~& [%durn-out-wrong p.ank q.p.nyp] :: ~& [%durn-out-wrong p.ank q.p.nyp]
. :: .
+> :: +>
-- --
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::: ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: section 3bF, filesystem interface :: :: section 3bF, filesystem interface ::
:: ::
++ feel :: simple file write ++ feel :: simple file write
|= [pax=path val=*] |= [pax=path val=cage]
^- miso ^- miso
=+ dir=((hard arch) .^(%cy pax)) =+ dir=((hard arch) .^(%cy pax))
?~ q.dir [%ins val] ?~ q.dir [%ins val]
:- %dif [%mut ((hard cage) .^(%cx pax)) val]
^- udon
[%a %a .^(%cx pax) val]
:: ::
++ file :: simple file load ++ file :: simple file load
|= pax=path |= pax=path
@ -2016,7 +1979,7 @@
?~(q.dir ~ [~ .^(%cx pax)]) ?~(q.dir ~ [~ .^(%cx pax)])
:: ::
++ foal :: high-level write ++ foal :: high-level write
|= [pax=path val=*] |= [pax=path val=cage]
^- toro ^- toro
?> ?=([* * * *] pax) ?> ?=([* * * *] pax)
[i.t.pax [%& [*cart [[t.t.t.pax (feel pax val)] ~]]]] [i.t.pax [%& [*cart [[t.t.t.pax (feel pax val)] ~]]]]
@ -2025,7 +1988,7 @@
|= pax=path |= pax=path
^- toro ^- toro
?> ?=([* * * *] pax) ?> ?=([* * * *] pax)
[i.t.pax [%& [*cart [[t.t.t.pax [%del .^(%cx pax)]] ~]]]] [i.t.pax [%& [*cart [[t.t.t.pax [%del %$ !>(.^(%cx pax))]] ~]]]]
:: ::
++ furl :: unify changes ++ furl :: unify changes
|= [one=toro two=toro] |= [one=toro two=toro]
@ -2034,7 +1997,7 @@
?> ?& =(p.one p.two) :: same path ?> ?& =(p.one p.two) :: same path
&(?=(& -.q.one) ?=(& -.q.two)) :: both deltas &(?=(& -.q.one) ?=(& -.q.two)) :: both deltas
== ==
[p.one [%& [*cart (weld q.q.q.one q.q.q.two)]]] [p.one [%& [*cart (weld q.p.q.one q.p.q.two)]]]
:: ::
++ meat :: kite to .^ path ++ meat :: kite to .^ path
|= kit=kite |= kit=kite
@ -2756,6 +2719,9 @@
[%direct p=lobe q=cage] :: [%direct p=lobe q=cage] ::
[%indirect p=lobe q=cage r=cage s=lobe] :: [%indirect p=lobe q=cage r=cage s=lobe] ::
== :: == ::
++ blub $% [%direct p=lobe q=cage] ::
[%indirect p=lobe q=cage r=cage s=lobe] ::
== ::
++ boat ,[(list slip) tart] :: user stage ++ boat ,[(list slip) tart] :: user stage
++ boon :: fort output ++ boon :: fort output
$% [%beer p=ship q=@uvG] :: gained ownership $% [%beer p=ship q=@uvG] :: gained ownership