From a8fb5fb7e3bafa10b964a7c1ece851722c95d531 Mon Sep 17 00:00:00 2001 From: bonbud-macryg Date: Mon, 3 Jun 2024 10:34:07 +0100 Subject: [PATCH] Implement moar feedback --- pkg/arvo/neo/cod/std/src/imp/counter.hoon | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/pkg/arvo/neo/cod/std/src/imp/counter.hoon b/pkg/arvo/neo/cod/std/src/imp/counter.hoon index 2cc8c00baa..7447309bdd 100644 --- a/pkg/arvo/neo/cod/std/src/imp/counter.hoon +++ b/pkg/arvo/neo/cod/std/src/imp/counter.hoon @@ -18,9 +18,9 @@ (sy %counter-diff ~) :: :: -:: counter does not "constrain" its children; -:: any shrub can be made below this shrub in the -:: namespace, they can have any state and any kids +:: counter does not constrain the type and behaviour of +:: its children; any shrub can be made below this shrub +:: in the tree, they can have any state, kids, or pokes ++ kids ^- kids:neo *kids:neo @@ -34,11 +34,7 @@ ++ form ^- form:neo :: treat this door's sample as boilerplate - |_ [=bowl:neo =aeon:neo stud:neo state-vase=vase] - :: - :: de-vase the state; we don't know what it is, - :: in most cases it will be counter's old state - +* state !<(number state-vase) + |_ [=bowl:neo =aeon:neo =pail:neo] :: :: +init, like +on-init ++ init @@ -61,6 +57,11 @@ :: pail, which is a (pair stud vase) ^- (quip card:neo pail:neo) :: + :: assert the stud of the pail (pair stud vase), + :: which is the shrub's state given in the sample + ?> =(p.pail %number) + =/ state !<(number q.pail) + :: :: assert that the poke's stud is %counter-diff, :: which protects counter from evil vases ?> =(%counter-diff stud)