From 9236909cec563a1540e2ac3b761cb996b980abaf Mon Sep 17 00:00:00 2001 From: pkova Date: Wed, 17 Jan 2024 17:59:47 +0200 Subject: [PATCH] gall: separate put:of-grow to put-tend and put-grow --- pkg/arvo/sys/vane/gall.hoon | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/pkg/arvo/sys/vane/gall.hoon b/pkg/arvo/sys/vane/gall.hoon index 04a0be4077..b899beab19 100644 --- a/pkg/arvo/sys/vane/gall.hoon +++ b/pkg/arvo/sys/vane/gall.hoon @@ -142,7 +142,7 @@ ~ $(wer [i.path wer], path t.path, farm u.nex) :: - ++ put + ++ put-grow |= [=path =plot] ^- (unit _farm) ?: ?=(%coop -.farm) @@ -155,10 +155,24 @@ ?~ res ~ `farm(q (~(put by q.farm) i.path u.res)) :: + ++ put-tend + |= [=path =plot] + ^- (unit _farm) + ?: ?=(%coop -.farm) + `farm(q (~(put by q.farm) path plot)) + ?~ path + `farm(p `plot) + ?~ nex=(~(get by q.farm) i.path) + ~ + =/ res + $(path t.path, farm u.nex) + ?~ res ~ + `farm(q (~(put by q.farm) i.path u.res)) + :: ++ grow |= [=spur now=@da =page] =/ ski (gut spur) - %+ put spur + %+ put-grow spur =- ski(fan (put:on-path fan.ski -< -> &/page)) ?~ las=(ram:on-path fan.ski) [(fall bob.ski 1) now] @@ -258,6 +272,7 @@ ?~ nex=(~(get by q.farm) i.path) ~ $(path t.path, farm u.nex) + :: ++ tap-plot =| wer=path |- ^- (list [path plot]) @@ -512,7 +527,7 @@ =/ sky=(list [=spur bob=@ud]) ~(tap by sky.u.yak) |- ?~ sky farm - =. farm (need (~(put of-farm farm) spur.i.sky [`bob.i.sky ~])) + =. farm (need (~(put-tend of-farm farm) spur.i.sky [`bob.i.sky ~])) $(sky t.sky) == :: @@ -1424,7 +1439,7 @@ |= [=spur =page] ^+ ap-core :: check here, and no-op, so that +need below does not crash - ?: =(~ (ap-match-coop spur)) + ?: =(^ (ap-match-coop spur)) %. ap-core %+ trace & [leaf+"gall: {}: grow {} has coop, dropping"]~ @@ -1455,7 +1470,7 @@ :: %& :: replace with hash %- need - %+ ~(put of-farm sky.yoke) spur + %+ ~(put-grow of-farm sky.yoke) spur u.old(fan (put:on-path fan.u.old yon u.val(q |/(shax (jam p.q.u.val))))) == :: +ap-cull: delete all bindings up to and including .case @@ -1491,7 +1506,7 @@ %. sky.yoke %+ trace & [leaf+"gall: {}: cull {<[case spur]>} invalid path structure"]~ - %+ ~(put of-farm sky.yoke) spur :: delete all older paths + %+ ~(put-grow of-farm sky.yoke) spur :: delete all older paths [`yon (lot:on-path fan.u.old `yon ~)] :: +ap-from-internal: internal move to move. :: @@ -2692,7 +2707,7 @@ farm =/ [=spur p=plot] i.ski =; new - ?~ nex=(~(put of-farm farm) spur new) + ?~ nex=(~(put-tend of-farm farm) spur new) ~& %weird !! :: shouldn't continue else loss of ref integrity :: $(ski t.ski)