mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-12-29 18:06:43 +03:00
56c47a8125
Conflicts: urb/zod/base/ape/hood/core.hook urb/zod/base/lib/kiln/core.hook
115 lines
5.1 KiB
Plaintext
115 lines
5.1 KiB
Plaintext
:: :: ::
|
|
:::: /hook/core/hood/ape :: ::
|
|
:: :: ::
|
|
/? 314 :: zuse version
|
|
/+ sole, talk, helm, kiln, drum :: libraries
|
|
:: :: ::
|
|
:::: :: ::
|
|
!: :: ::
|
|
=> |% :: module boilerplate
|
|
++ hood-0 ::
|
|
,[%0 lac=(map ,@tas hood-part)] ::
|
|
++ hood-good ::
|
|
|* hed=hood-head ::
|
|
|= paw=hood-part ::
|
|
?- hed ::
|
|
%drum ?>(?=(%drum -.paw) `drum-part`paw) ::
|
|
%helm ?>(?=(%helm -.paw) `helm-part`paw) ::
|
|
%kiln ?>(?=(%kiln -.paw) `kiln-part`paw) ::
|
|
== ::
|
|
++ hood-head ,_-:*hood-part ::
|
|
++ hood-make ::
|
|
|* [our=@p hed=hood-head] ::
|
|
?- hed ::
|
|
%drum (drum-port our) ::
|
|
%helm *helm-part ::
|
|
%kiln *kiln-part ::
|
|
== ::
|
|
++ hood-part ::
|
|
$% [%drum %0 drum-pith] ::
|
|
[%helm %0 helm-pith] ::
|
|
[%kiln %0 kiln-pith] ::
|
|
== ::
|
|
-- ::
|
|
:: :: ::
|
|
:::: :: ::
|
|
:: :: ::
|
|
|_ $: hid=bowl :: system state
|
|
hood-0 :: server state
|
|
== ::
|
|
++ able :: find/make part
|
|
|* hed=hood-head
|
|
=+ rep=(~(get by lac) hed)
|
|
=+ par=?^(rep u.rep `hood-part`(hood-make our.hid hed))
|
|
((hood-good hed) par)
|
|
::
|
|
++ ably :: save part
|
|
|* [moz=(list) rep=hood-part]
|
|
[(flop moz) %_(+> lac (~(put by lac) -.rep rep))]
|
|
:: :: ::
|
|
:::: :: ::
|
|
:: :: ::
|
|
++ coup-kiln-fancy (wrap take-coup-fancy):from-kiln
|
|
++ coup-kiln-spam ::
|
|
|= [way=wire saw=(unit tang)]
|
|
~? ?=(^ saw) [%kiln-spam-lame u.saw]
|
|
[~ +>]
|
|
::
|
|
++ coup-drum (wrap take-coup):from-drum
|
|
++ diff-sole-effect-drum (wrap diff-sole-effect):from-drum
|
|
++ from-helm
|
|
=- [wrap=- *helm-work]
|
|
|* fun=_=>(*helm-work |=(* abet))
|
|
|= _+<.fun
|
|
=. +>.fun (helm-work hid (able %helm))
|
|
(ably (fun +<))
|
|
::
|
|
++ from-drum
|
|
=- [wrap=- *drum-work]
|
|
|* fun=_=>(*drum-work |=(* se-abet))
|
|
|= _+<.fun
|
|
=. +>.fun (drum-work hid (able %drum))
|
|
(ably (fun +<))
|
|
::
|
|
++ from-kiln
|
|
=- [wrap=- *kiln-work]
|
|
|* fun=_=>(*kiln-work |=(* abet))
|
|
|= _+<.fun
|
|
=. +>.fun (kiln-work hid (able %kiln))
|
|
(ably (fun +<))
|
|
::
|
|
++ poke-dill-belt (wrap poke-dill-belt):from-drum
|
|
++ poke-helm-init (wrap poke-init):from-helm
|
|
++ poke-hood-mass (wrap poke-mass):from-helm
|
|
++ poke-hood-sync (wrap poke-sync):from-kiln
|
|
++ poke-hood-unix (wrap poke-unix):from-kiln
|
|
++ poke-hood-verb (wrap poke-verb):from-helm
|
|
++ poke-hood-begin (wrap poke-begin):from-helm
|
|
++ poke-hood-merge (wrap poke-merge):from-kiln
|
|
++ poke-hood-reload (wrap poke-reload):from-helm
|
|
++ poke-hood-reset (wrap poke-reset):from-helm
|
|
++ poke-hood-start (wrap poke-start):from-drum
|
|
++ poke-hood-reload-desk (wrap poke-reload-desk):from-helm
|
|
++ poke-kiln-cp (wrap poke-cp):from-kiln
|
|
++ poke-kiln-rm (wrap poke-rm):from-kiln
|
|
++ poke-kiln-mv (wrap poke-mv):from-kiln
|
|
++ poke-will (wrap poke-will):from-helm
|
|
++ mere-kiln (wrap take-mere):from-kiln
|
|
++ mere-kiln-sync (wrap take-mere-sync):from-kiln
|
|
::++ mere-kiln-sync
|
|
:: |= [then (each (set path) (pair term tang))]
|
|
:: (ably (take-mere-sync:(kiln-work [hid ost src] (able %kiln)) way +<+))
|
|
++ made-kiln (wrap take-made):from-kiln
|
|
++ init-helm |=([way=wire *] [~ +>])
|
|
++ note-helm (wrap take-note):from-helm
|
|
++ reap-drum (wrap reap):from-drum
|
|
++ onto-drum (wrap take-onto):from-drum
|
|
++ peer-drum (wrap peer):from-drum
|
|
++ quit-drum (wrap quit):from-drum
|
|
++ went-helm (wrap take-went):from-helm
|
|
++ writ-kiln-sync (wrap take-writ):from-kiln
|
|
::++ writ-kiln-sync
|
|
:: |= [then riot]
|
|
:: (ably (take-writ:(kiln-work [hid ost src] (able %kiln)) way +<+))
|
|
--
|