mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-12-16 19:22:22 +03:00
convert ford kig to a simple set, make wires more straightforward
This commit is contained in:
parent
4c419a2ecd
commit
152b38c557
126
arvo/ford.hoon
126
arvo/ford.hoon
@ -78,7 +78,7 @@
|
|||||||
$: nah/duct :: cause
|
$: nah/duct :: cause
|
||||||
{bek/beak kas/silk} :: problem
|
{bek/beak kas/silk} :: problem
|
||||||
keg/(map (pair term beam) cage) :: block results
|
keg/(map (pair term beam) cage) :: block results
|
||||||
kig/{p/@ud q/(map @ud {van/vane ren/care bem/beam})} :: blocks
|
kig/(set (trel vane care beam)) :: blocks
|
||||||
== ::
|
== ::
|
||||||
++ gagl (list (pair gage gage)) ::
|
++ gagl (list (pair gage gage)) ::
|
||||||
++ vane ?($a $b $c $d $e $f $g) ::
|
++ vane ?($a $b $c $d $e $f $g) ::
|
||||||
@ -192,28 +192,22 @@
|
|||||||
=: p.tad.bay +(p.tad.bay)
|
=: p.tad.bay +(p.tad.bay)
|
||||||
dym.bay (~(put by dym.bay) hen num)
|
dym.bay (~(put by dym.bay) hen num)
|
||||||
==
|
==
|
||||||
~(exec zo [num `task`[hen kub ~ 0 ~]])
|
~(exec zo [num `task`[hen kub ~ ~]])
|
||||||
::
|
::
|
||||||
++ axon :: take
|
++ axon :: take
|
||||||
|= {num/@ud tik/@ud sih/sign}
|
|= {num/@ud {van/vane ren/care bem/beam} sih/sign}
|
||||||
^+ +>
|
^+ +>
|
||||||
|
?: ?=({$unto $quit *} +.sih)
|
||||||
|
+>.$
|
||||||
|
=+ tus=(~(get by q.tad.bay) num)
|
||||||
|
?~ tus
|
||||||
|
~& [%ford-lost van num]
|
||||||
|
+>.$
|
||||||
?- -.+.sih
|
?- -.+.sih
|
||||||
$writ
|
$writ (~(resp zo [num u.tus]) [van ren bem] p.+.sih)
|
||||||
=+ tus=(~(get by q.tad.bay) num)
|
|
||||||
?~ tus
|
|
||||||
~& [%ford-lost num]
|
|
||||||
+>.$
|
|
||||||
(~(resp zo [num u.tus]) tik p.+.sih)
|
|
||||||
::
|
|
||||||
$unto
|
$unto
|
||||||
?: ?=($quit -.p.+.sih)
|
?+ -.p.+.sih ~|(ford-strange-unto+-.p.+.sih !!)
|
||||||
+>.$
|
$diff (~(resd zo [num u.tus]) [van ren bem] p.p.+.sih)
|
||||||
=+ tus=(~(get by q.tad.bay) num)
|
|
||||||
?~ tus
|
|
||||||
~& [%ford-lost num -.p.+.sih]
|
|
||||||
+>.$
|
|
||||||
?+ -.p.+.sih ~|(%ford-strange-unto !!)
|
|
||||||
$diff (~(resd zo [num u.tus]) tik p.p.+.sih)
|
|
||||||
$reap ?~ p.p.+.sih +>.$
|
$reap ?~ p.p.+.sih +>.$
|
||||||
((slog leaf+"ford-reap-fail" u.p.p.+.sih) +>.$)
|
((slog leaf+"ford-reap-fail" u.p.p.+.sih) +>.$)
|
||||||
==
|
==
|
||||||
@ -294,49 +288,40 @@
|
|||||||
==
|
==
|
||||||
++ camo :: stop requests
|
++ camo :: stop requests
|
||||||
^+ .
|
^+ .
|
||||||
=+ kiz=(~(tap by q.kig) *(list {p/@ud q/{van/vane ren/care bem/beam}}))
|
=+ kiz=(~(tap in kig))
|
||||||
|- ^+ +>
|
|- ^+ +>
|
||||||
?~ kiz +>
|
?~ kiz +>
|
||||||
?. ?=($c van.q.i.kiz) +>
|
$(kiz t.kiz, mow :_(mow [hen (cancel i.kiz)]))
|
||||||
%= $
|
::
|
||||||
kiz t.kiz
|
++ cancel :: stop a request
|
||||||
mow
|
|= {van/vane ren/care bem/beam} ^- (mold note gift)
|
||||||
:_ mow
|
?+ van ~|(stub-cancel+van !!)
|
||||||
:- hen
|
$c [%pass (camp-wire +<) van [%warp [our p.bem] q.bem ~]]
|
||||||
:^ %pass
|
$g [%pass (camp-wire +<) van [%deal [our p.bem] q.bem [%pull ~]]]
|
||||||
[(scot %p our) (scot %ud num) (scot %ud p.i.kiz) ~]
|
|
||||||
%c
|
|
||||||
[%warp [our p.bem.q.i.kiz] q.bem.q.i.kiz ~]
|
|
||||||
==
|
==
|
||||||
|
++ camp-wire :: encode block
|
||||||
|
|= {van/vane ren/care bem/beam} ^- wire
|
||||||
|
[(scot %p our) (scot %ud num) van ren (tope bem)]
|
||||||
::
|
::
|
||||||
++ camp :: request a file
|
++ camp :: request a file
|
||||||
|= {van/vane ren/care bem/beam}
|
|= {van/vane ren/care bem/beam}
|
||||||
^+ +>
|
^+ +>
|
||||||
?: ?=($g van)
|
~& >> [%camping van ren bem]
|
||||||
%= +>.$
|
%_ +>.$
|
||||||
kig [+(p.kig) (~(put by q.kig) p.kig [%g ren bem])]
|
kig (~(put in kig) +<)
|
||||||
mow
|
mow
|
||||||
:_ mow
|
:_ mow
|
||||||
:- hen
|
:- hen
|
||||||
:^ %pass
|
?+ van ~&(%camp-stub !!)
|
||||||
[(scot %p our) (scot %ud num) (scot %ud p.kig) ~]
|
$g
|
||||||
%g
|
:+ %pass (camp-wire +<)
|
||||||
~& >> [%camping van ren bem]
|
[%g [%deal [our p.bem] q.bem [%peer %scry ren (flop s.bem)]]]
|
||||||
[%deal [our p.bem] q.bem [%peer %scry ren (flop s.bem)]]
|
::
|
||||||
|
$c
|
||||||
|
:+ %pass (camp-wire +<)
|
||||||
|
[%c [%warp [our p.bem] q.bem [~ %sing ren r.bem (flop s.bem)]]]
|
||||||
==
|
==
|
||||||
?: ?=($c van)
|
==
|
||||||
%= +>.$
|
|
||||||
kig [+(p.kig) (~(put by q.kig) p.kig [%c ren bem])]
|
|
||||||
mow
|
|
||||||
:_ mow
|
|
||||||
:- hen
|
|
||||||
:^ %pass
|
|
||||||
[(scot %p our) (scot %ud num) (scot %ud p.kig) ~]
|
|
||||||
%c
|
|
||||||
~& >> [%camping van ren bem]
|
|
||||||
[%warp [our p.bem] q.bem [~ %sing ren r.bem (flop s.bem)]]
|
|
||||||
==
|
|
||||||
+>.$
|
|
||||||
::
|
::
|
||||||
++ clad :: hash dependencies
|
++ clad :: hash dependencies
|
||||||
|* hoc/(bolt) ^+ [*@uvH hoc]
|
|* hoc/(bolt) ^+ [*@uvH hoc]
|
||||||
@ -582,7 +567,7 @@
|
|||||||
::
|
::
|
||||||
++ exec :: execute app
|
++ exec :: execute app
|
||||||
^+ ..zo
|
^+ ..zo
|
||||||
?: !=(~ q.kig) ..zo
|
?: !=(~ kig) ..zo
|
||||||
=+ bot=(make-norm-bek [~ jav.bay deh.bay] kas)
|
=+ bot=(make-norm-bek [~ jav.bay deh.bay] kas)
|
||||||
=^ dep bot (clad bot)
|
=^ dep bot (clad bot)
|
||||||
=. ..exec (dash p.bot)
|
=. ..exec (dash p.bot)
|
||||||
@ -1764,33 +1749,24 @@
|
|||||||
==
|
==
|
||||||
::
|
::
|
||||||
++ resp
|
++ resp
|
||||||
|= {tik/@ud rot/riot}
|
|= {{van/vane ren/care bem/beam} rot/riot}
|
||||||
^+ ..zo
|
^+ ..zo
|
||||||
?> (~(has by q.kig) tik)
|
?> ?=($c van)
|
||||||
=+ `{van/vane ren/care bem/beam}`(~(got by q.kig) tik)
|
=. kig (~(del in kig) +<-.$)
|
||||||
?~ rot
|
?~ rot
|
||||||
=^ dep deh.bay (daze ~ deh.bay) :: dependencies?
|
=^ dep deh.bay (daze ~ deh.bay) :: dependencies?
|
||||||
amok:(expo [%made dep %| (smyt ren (tope bem)) ~])
|
amok:(expo [%made dep %| (smyt ren (tope bem)) ~])
|
||||||
?> ?=($c van)
|
|
||||||
=+ (cat 3 van ren)
|
=+ (cat 3 van ren)
|
||||||
exec(q.kig (~(del by q.kig) tik), keg (~(put by keg) [- bem] r.u.rot))
|
exec(keg (~(put by keg) [- bem] r.u.rot))
|
||||||
::
|
|
||||||
++ pull-tik
|
|
||||||
|= {tik/@ud ren/care bem/beam}
|
|
||||||
:^ %pass
|
|
||||||
[(scot %p our) (scot %ud num) (scot %ud tik) ~]
|
|
||||||
%g
|
|
||||||
[%deal [our p.bem] q.bem [%pull ~]]
|
|
||||||
::
|
::
|
||||||
++ resd
|
++ resd
|
||||||
|= {tik/@ud cag/cage}
|
|= {{van/vane ren/care bem/beam} cag/cage}
|
||||||
^+ ..zo
|
^+ ..zo
|
||||||
?> (~(has by q.kig) tik)
|
|
||||||
=+ `{van/vane ren/care bem/beam}`(~(got by q.kig) tik)
|
|
||||||
=. mow :_(mow [hen (pull-tik tik ren bem)])
|
|
||||||
?> ?=($g van)
|
?> ?=($g van)
|
||||||
|
=. kig (~(del in kig) +<-.$)
|
||||||
|
=. mow :_(mow [hen (cancel van ren bem)])
|
||||||
=+ (cat 3 van ren)
|
=+ (cat 3 van ren)
|
||||||
exec(q.kig (~(del by q.kig) tik), keg (~(put by keg) [- bem] cag))
|
exec(keg (~(put by keg) [- bem] cag))
|
||||||
::
|
::
|
||||||
++ syve
|
++ syve
|
||||||
^- sley
|
^- sley
|
||||||
@ -1909,10 +1885,12 @@
|
|||||||
?^ dep
|
?^ dep
|
||||||
=+ bem=(need (tome t.t.tea))
|
=+ bem=(need (tome t.t.tea))
|
||||||
abet:(~(axun za [our hen [now eny ski] ~] bay) tea u.dep bem q.hin)
|
abet:(~(axun za [our hen [now eny ski] ~] bay) tea u.dep bem q.hin)
|
||||||
?> ?=({@ $~} t.t.tea)
|
?> ?=({@ @ ^} t.t.tea)
|
||||||
=+ :* num=(slav %ud i.t.tea)
|
=+ :* num=(slav %ud i.t.tea)
|
||||||
tik=(slav %ud i.t.t.tea)
|
van=((hard vane) i.t.t.tea)
|
||||||
|
ren=((hard care) i.t.t.t.tea)
|
||||||
|
bem=(need (tome t.t.t.t.tea))
|
||||||
==
|
==
|
||||||
abet:(~(axon za [our hen [now eny ski] ~] bay) num tik q.hin)
|
abet:(~(axon za [our hen [now eny ski] ~] bay) num [van ren bem] q.hin)
|
||||||
[mos ..^$(pol (~(put by pol) our bay))]
|
[mos ..^$(pol (~(put by pol) our bay))]
|
||||||
--
|
--
|
||||||
|
Loading…
Reference in New Issue
Block a user