Fix referential transparency in %merg

This commit is contained in:
Jared Hance 2014-07-29 13:43:20 -04:00
parent ef94352267
commit 68fb76214d
2 changed files with 10 additions and 8 deletions

View File

@ -290,10 +290,12 @@
|= [hen=duct wen=@da mer=mizu] :: aka direct change
~& [%apply-mizu-hit q.mer]
~& [%apply-mizu-let p.mer]
?. (gte p.mer let.dom) !! :: no
=. +>.$ %= +>.$
ran r.mer
hut.ran (~(uni by hut.r.mer) hut.ran)
lat.ran (~(uni by lat.r.mer) lat.ran)
let.dom p.mer
hit.dom q.mer
hit.dom (~(uni by q.mer) hit.dom)
==
=+ ^= hed :: head commit
=< q

View File

@ -1202,10 +1202,10 @@
::
::::
++ aqel :: aqel:ze
|= lag=(map path blob) :: fix lat
|= [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=_lat gar=(map path lobe)]]
|= [[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)
@ -1268,7 +1268,7 @@
=+ ^= per
?~ par ~
~[u.par]
=+ gar=(aqel (azal q.lem))
=+ gar=(aqel (azal q.lem) lat)
:- %^ zoal per +.gar wen :: from existing diff
-.gar :: fix lat
::
@ -1514,10 +1514,10 @@
=+ gar=(merge foreign-head our-head now (strat gem))
=+ yak=-.gar
=+ hek=+.gar
=. lat -:(aqel hek) :: add new blobs
=. hut (~(put by hut) r.yak yak)
=. lat -:(aqel hek ~) :: add new blobs
=. hut (~(put by _(map tako yaki)) r.yak yak)
=. let +(let)
=. hit (~(put by hit) let r.yak)
=. hit (~(put by _(map ,@ud tako)) let r.yak)
[~ [~ [let hit hut lat]]]
%conf !!
==