urbit/pkg/arvo/gen/hood/merge.hoon
Jared Tobin b3901ab42f Add 'pkg/arvo/' from commit 'c20e2a185f131ff3f5d3961829bd7a3fe0f227f8'
git-subtree-dir: pkg/arvo
git-subtree-mainline: 9c8f40bf6c
git-subtree-split: c20e2a185f
2019-06-28 12:48:05 +08:00

47 lines
1.1 KiB
Plaintext

:: Kiln: Merge local desk from (optionally-)foreign one
::
:::: /hoon/merge/hood/gen
::
/? 310
=, clay
::
|%
++ beaky {knot knot knot ~}
++ sorc ?({bek/beaky ~} {her/@p sud/@tas ~})
--
::
::::
::
:- %say
|= $: {now/@da eny/@uvJ bek/beak}
{arg/{?(sorc {syd/$@(desk beaky) sorc})} cas/case gem/?(germ $auto)}
==
=* our p.bek
|^ :- %kiln-merge
^- {syd/desk her/ship sud/desk cas/case gem/?(germ $auto)}
?- arg
{@ @ ~}
=+(arg [sud ?.(=(our her) her (sein:title p.bek now her)) sud (opt-case da+now) gem])
::
{^ ~}
=+ (pars bek.arg)
[dez ?.(=(our who) who (sein:title p.bek now who)) dez (opt-case caz) gem]
::
{* @ @ ~}
:- (pars-src syd.arg)
=+(arg [her sud (opt-case da+now) gem])
::
{* ^ ~}
:- (pars-src syd.arg)
=+((pars bek.arg) [who dez (opt-case caz) gem])
==
++ opt-case |=(a/case ?:(=(*case cas) a cas)) :: override
++ pars |=(a/beaky `{{who/ship dez/desk caz/case} *}`(need (de-beam:format a)))
++ pars-src
|= syd/$@(desk beaky)
?@ syd syd
=+ (pars syd)
~| [%into-foreign who `path`syd]
?>(=(our who) dez)
--