mirror of
https://github.com/urbit/shrub.git
synced 2024-08-17 08:00:39 +03:00
neo: fix synchronisation
This commit is contained in:
parent
1449c7b52b
commit
2376192da7
@ -865,6 +865,7 @@
|
||||
++ free
|
||||
|= =hunt:neo
|
||||
^+ run
|
||||
~& resolved/hunt
|
||||
:: XX: weird shadowing, be careful
|
||||
=/ =rave:neo (~(gut of:neo riot) pith.hunt *rave:neo)
|
||||
=. rave
|
||||
@ -1811,28 +1812,40 @@
|
||||
work
|
||||
::
|
||||
++ jazz
|
||||
=| bad=(set term)
|
||||
|= [=conf:neo =deps:neo]
|
||||
^- [bad=(set term) block=(set tour:neo)]
|
||||
%+ roll ~(tap by deps)
|
||||
|= [[=term required=? =quay:neo] bad=(set term) block=(set hunt:neo)]
|
||||
^+ [bad arvo]
|
||||
=/ deps ~(tap by deps)
|
||||
|- ^+ [bad arvo]
|
||||
?~ deps
|
||||
[bad arvo]
|
||||
=/ [=term required=? =quay:neo] i.deps
|
||||
=/ =care:neo (get-care:quay:neo quay)
|
||||
?: &(required !(~(has by conf) term))
|
||||
:_(block (~(put in bad) term))
|
||||
=. bad (~(put in bad) term)
|
||||
$(deps t.deps)
|
||||
?: &(!required !(~(has by conf) term))
|
||||
[bad block]
|
||||
$(deps t.deps)
|
||||
=/ pit=pith:neo (~(got by conf) term)
|
||||
=/ res (look care pit)
|
||||
=/ nam=name:neo (de-pith:name:neo pit)
|
||||
?~ res
|
||||
?: =(our.bowl ship.nam)
|
||||
?. required
|
||||
[bad block]
|
||||
:_(block (~(put in bad) term))
|
||||
[bad (~(put in block) care pit)]
|
||||
?~ u.res
|
||||
:_(block (~(put in bad) term))
|
||||
[bad block] ::
|
||||
::
|
||||
$(deps t.deps)
|
||||
=. bad (~(put in bad) term)
|
||||
$(deps t.deps)
|
||||
=? get.block required
|
||||
(~(put in get.block) care pit)
|
||||
=. run abet:(~(start sale pit) [p/our.bowl here] care)
|
||||
=? run !required
|
||||
(stalk:rage care^pit %rely term here)
|
||||
$(deps t.deps)
|
||||
?^ u.res
|
||||
$(deps t.deps)
|
||||
=. bad (~(put in bad) term)
|
||||
$(deps t.deps)
|
||||
::
|
||||
++ dance
|
||||
|= [=crew:neo =band:neo]
|
||||
^+ arvo
|
||||
@ -1875,7 +1888,7 @@
|
||||
|= [src=stud:neo init=(unit pail:neo) =crew:neo]
|
||||
=/ =wave:neo [src ~(dock husk src) crew]
|
||||
=. tide (~(put of:neo tide) here wave)
|
||||
=^ bad=(set term) get.block
|
||||
=^ bad=(set term) arvo
|
||||
(jazz crew deps:~(kook husk src))
|
||||
?. =(~ get.block)
|
||||
arvo
|
||||
@ -2000,6 +2013,8 @@
|
||||
?~ ack
|
||||
same
|
||||
(slog (print-quit:neo u.ack))
|
||||
?: ?=(%rely p.pail)
|
||||
((slog leaf/"no support for %rely" ~) su-core)
|
||||
(mean leaf/"no support for {<p.pail>}" ~)
|
||||
=/ [caz=(list card:neo) new=pail:neo]
|
||||
(poke:su-form pail)
|
||||
|
54
pkg/arvo/lib/neo-three.hoon
Normal file
54
pkg/arvo/lib/neo-three.hoon
Normal file
@ -0,0 +1,54 @@
|
||||
/- neo
|
||||
|%
|
||||
:: ++ dyad (pair @ @)
|
||||
++ scam
|
||||
=< scam
|
||||
|%
|
||||
++ on ((^on case:neo case:neo) lte)
|
||||
+$ scam ((mop case:neo case:neo) lte)
|
||||
--
|
||||
:: ++ push
|
||||
++ scum
|
||||
=< scum
|
||||
|%
|
||||
++ on ((^on case:neo (map pith:neo case:neo)) lte)
|
||||
+$ scum ((mop case:neo (map pith:neo case:neo)) lte)
|
||||
--
|
||||
+$ muck
|
||||
$: =soil
|
||||
=scum
|
||||
why=scam
|
||||
zed=scam
|
||||
==
|
||||
++ soil
|
||||
=< a
|
||||
^~
|
||||
|%
|
||||
++ on ((^on case:neo muck:neo) lte)
|
||||
+$ a ((mop case:neo muck:neo) lte)
|
||||
--
|
||||
++ plot
|
||||
|
||||
:: $dirt: Layer 1 of the namespace
|
||||
++ dirt
|
||||
|%
|
||||
+$ card (pair pith note)
|
||||
+$ note
|
||||
$% [%grow =pail case=(unit case) =oath]
|
||||
[%cull ~]
|
||||
==
|
||||
+$ loam (axal soil)
|
||||
+$ gift dust
|
||||
--
|
||||
++ frog
|
||||
[=pail =
|
||||
|
||||
++ till
|
||||
|_ =loam
|
||||
++ plow
|
||||
|=
|
||||
++ grew
|
||||
|= [=pail:neo case=@ud]
|
||||
++ grow
|
||||
|= [=pail:neo
|
||||
|
@ -453,11 +453,64 @@
|
||||
~
|
||||
`[pit %dif]
|
||||
==
|
||||
|
||||
++ fallback-peek-kids
|
||||
|= [=care:neo =pith:neo fam=farm:neo]
|
||||
^- (list pith:neo)
|
||||
?: ?=(%x care) ~
|
||||
?^ fil.fam
|
||||
=/ [=land:neo =plot:neo] u.fil.fam
|
||||
?~ kid=(ram:on:plan:neo ?:(?=(%y care) by-kids-mut.plot by-desc-mut.plot))
|
||||
~
|
||||
~(tap in val.u.kid)
|
||||
%- zing
|
||||
%+ turn ~(tap by kid.fam)
|
||||
|= [=iota f=farm:neo]
|
||||
^- (list pith:neo)
|
||||
(fallback-peek-kids care (snoc pith iota) f)
|
||||
++ fallback-peek-x
|
||||
|= =pith:neo
|
||||
^- (unit saga:neo)
|
||||
=/ sol (~(gut of:neo loam) pith *soil:neo)
|
||||
?~ val=(ram:on:soil:neo sol)
|
||||
~
|
||||
?~ q.val.u.val
|
||||
~
|
||||
`[*aeon:neo u.q.val.u.val]
|
||||
::
|
||||
++ fallback-peek
|
||||
|= [=care:neo =pith:neo]
|
||||
^- (axal:neo saga:neo)
|
||||
%- gas
|
||||
%+ welp
|
||||
?~ rot=(fallback-peek-x pith)
|
||||
~
|
||||
[pith u.rot]^~
|
||||
%+ murn (fallback-peek-kids care pith (~(dip of:neo farm) pith))
|
||||
|= p=pith:neo
|
||||
^- (unit [pith:neo saga:neo])
|
||||
=/ kid (welp pith p)
|
||||
?~ sag=(fallback-peek-x kid)
|
||||
~
|
||||
`[kid u.sag]
|
||||
++ piek
|
||||
|= [=care:neo =pith:neo]
|
||||
^- (unit (unit (axal:neo saga:neo)))
|
||||
~& peek-no-once/[care pith]
|
||||
``(fallback-peek care pith)
|
||||
|
||||
::
|
||||
++ peek
|
||||
|= [=care:neo =pith:neo]
|
||||
^- (unit (unit (axal:neo saga:neo)))
|
||||
?~ nce=(now-once care pith)
|
||||
~& peek-no-once/[care pith]
|
||||
~
|
||||
:: =/ res
|
||||
:: (fallback-peek care pith)
|
||||
:: ~? !=(res [~ ~])
|
||||
:: res/res
|
||||
:: ``(fallback-peek care pith)
|
||||
(look care u.nce pith)
|
||||
++ look-x
|
||||
|= [=case:neo =pith:neo]
|
||||
@ -467,6 +520,14 @@
|
||||
?: ?=($@(~ [~ ~]) res)
|
||||
res
|
||||
`(~(get of:neo u.u.res) ~)
|
||||
++ gas
|
||||
=| axe=(axal:neo saga:neo)
|
||||
|= res=(list (pair pith:neo saga:neo))
|
||||
^+ axe
|
||||
?~ res
|
||||
axe
|
||||
$(axe (~(put of:neo axe) p.i.res q.i.res), res t.res)
|
||||
|
||||
::
|
||||
++ look
|
||||
|= [=care:neo =once:neo =pith:neo]
|
||||
@ -485,12 +546,6 @@
|
||||
%y read-y
|
||||
%z read-z
|
||||
==
|
||||
++ gas
|
||||
|= res=(list (pair pith:neo saga:neo))
|
||||
^+ axe
|
||||
?~ res
|
||||
axe
|
||||
$(axe (~(put of:neo axe) p.i.res q.i.res), res t.res)
|
||||
++ read-x (gas read-x-raw)
|
||||
++ read-x-raw
|
||||
^- (list (pair pith:neo saga:neo))
|
||||
|
@ -57,8 +57,8 @@
|
||||
++ init
|
||||
|= old=(unit pail:neo)
|
||||
^- (quip card:neo pail:neo)
|
||||
=/ width 10
|
||||
=/ height 10
|
||||
=/ width 3
|
||||
=/ height 3
|
||||
:_ accel/!>([width height])
|
||||
(make-cells bowl 1 width 1 height %in)
|
||||
::
|
||||
|
@ -19,6 +19,7 @@
|
||||
[#/[p/our.bowl]/home/circle %make %circle ~ ~]
|
||||
[#/[p/our.bowl]/home/files %make %folder ~ ~]
|
||||
[#/[p/our.bowl]/home/planner %make %planner ~ ~]
|
||||
[#/[p/our.bowl]/home/messenger %make %messenger ~ ~]
|
||||
==
|
||||
++ poke
|
||||
|= =pail:neo
|
||||
|
@ -12,7 +12,7 @@
|
||||
++ deps
|
||||
%- ~(gas by *deps:neo)
|
||||
:~ :- %pub
|
||||
:+ req=& [pro/%sig (sy %sig ~)]
|
||||
:+ req=| [pro/%sig (sy %sig ~)]
|
||||
:+ ~ %y
|
||||
%- ~(gas by *lads:neo)
|
||||
:~ :- [|/%da |]
|
||||
@ -48,4 +48,4 @@
|
||||
[%make [%message `pai ~]]
|
||||
==
|
||||
--
|
||||
--
|
||||
--
|
||||
|
26
tests/lib/neo-two.hoon
Normal file
26
tests/lib/neo-two.hoon
Normal file
@ -0,0 +1,26 @@
|
||||
/- neo
|
||||
/+ aux=neo-two
|
||||
/+ *test
|
||||
=| [=farm:neo =loam:dirt:neo]
|
||||
=* sta -
|
||||
|%
|
||||
++ take-dirt-card
|
||||
|= =card:dirt:neo
|
||||
^+ sta
|
||||
=^ gifts=(list gift:dirt:neo) loam
|
||||
(~(call plow:aux loam) card)
|
||||
=. farm (~(take till:aux [loam farm]) gifts)
|
||||
sta
|
||||
++ oat *oath:neo
|
||||
:: ++ reset
|
||||
++ test-grow
|
||||
=. sta (take-dirt-card #/foo %grow atom/!>(1) ~ *oath:neo)
|
||||
=. sta (take-dirt-card #/foo/bar %grow atom/!>(1) ~ *oath:neo)
|
||||
=. sta (take-dirt-card #/foo/bar/baz %grow atom/!>(1) ~ *oath:neo)
|
||||
=. sta (take-dirt-card #/foo/bar %grow atom/!>(1) ~ *oath:neo)
|
||||
=. sta (take-dirt-card #/foo %grow atom/!>(2) ~ *oath:neo)
|
||||
=/ want (~(piek till:aux [loam farm]) %z #/foo)
|
||||
=/ have (~(peek till:aux [loam farm]) %z #/foo)
|
||||
~& sta
|
||||
(expect-eq !>(want) !>(have))
|
||||
--
|
Loading…
Reference in New Issue
Block a user