shrub/base/ape/hood/core.hook
2015-05-28 12:28:12 -07:00

164 lines
6.4 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 ::
|= [way=wire saw=(unit tang)]
(ably (take-coup-fancy:(kiln-work hid (able %kiln)) way +<+))
::
++ coup-kiln-spam ::
|= [way=wire saw=(unit tang)]
~? ?=(^ saw) [%kiln-spam-lame u.saw]
[~ +>]
::
++ coup-drum ::
|= [way=wire saw=(unit tang)]
(ably (take-coup:(drum-work hid (able %drum)) way +<+))
::
++ diff-sole-effect-drum
|= [way=wire sole-effect]
(ably (diff-sole-effect:(drum-work hid (able %drum)) way +<+))
::
++ poke-hood-begin ::
|= hood-begin
(ably (poke-begin:(helm-work hid (able %helm)) +<))
::
++ poke-helm-init ::
|= hood-init
(ably (poke-init:(helm-work hid (able %helm)) +<))
::
++ poke-hood-mass ::
|= ~
(ably poke-mass:(helm-work hid (able %helm)))
::
++ poke-hood-merge ::
|= hood-merge
(ably (poke-merge:(kiln-work hid (able %kiln)) +<))
::
++ poke-hood-reload ::
|= hood-reload
(ably (poke-reload:(helm-work hid (able %helm)) +<))
::
++ poke-hood-reset ::
|= ~
(ably (poke-reset:(helm-work hid (able %helm)) +<))
::
++ poke-hood-sync ::
|= hood-sync
(ably (poke-sync:(kiln-work hid (able %kiln)) +<))
::
++ poke-hood-unix ::
|= hood-unix
(ably (poke-unix:(kiln-work hid (able %kiln)) +<))
::
++ poke-hood-verb ::
|= ~
(ably (poke-verb:(helm-work hid (able %helm)) +<))
::
++ poke-hood-start ::
|= drum-start
(ably (poke-start:(drum-work hid (able %drum)) +<))
::
++ poke-dill-belt
|= dill-belt
(ably (poke-dill-belt:(drum-work hid (able %drum)) +<))
::
++ from-kiln
=- [wrap=- *kiln-work]
|* fun=_=>(*kiln-work |=(* abet))
|= _+<.fun
=. +>.fun (kiln-work hid (able %kiln))
(ably (fun +<))
::
++ 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 ::
|= (unit will)
(ably (poke-will:(helm-work hid (able %helm)) +<))
::
++ mere-kiln ::
|= [way=wire are=(each (set path) (pair term tang))]
(ably (take-mere:(kiln-work hid (able %kiln)) way +<+))
::
++ made-kiln ::
|= [way=wire @uvH gage]
(ably (take-made:(kiln-work hid (able %kiln)) way +<+))
::
++ init-helm ::
|= [way=wire *]
[~ +>]
::
++ note-helm ::
|= [way=wire (pair ,@tD tank)]
(ably (take-note:(helm-work hid (able %helm)) way +<+))
::
++ reap-drum
|= [way=wire saw=(unit tang)]
(ably (reap:(drum-work hid (able %drum)) way +<+))
::
++ onto-drum ::
|= [way=wire saw=(each ,[term @tas @da] tang)]
(ably (take-onto:(drum-work hid (able %drum)) way +<+))
::
++ peer-drum
|= pax=path
(ably (peer:(drum-work hid (able %drum)) +<))
::
++ quit-drum
|= way=wire
(ably (quit:(drum-work hid (able %drum)) way))
::
++ went-helm ::
|= [way=wire her=ship kay=cape]
(ably (take-went:(helm-work hid (able %helm)) way +<+))
--