urbit/pkg/arvo/gen/hood/merge.hoon

49 lines
1.3 KiB
Plaintext
Raw Normal View History

2016-10-22 02:44:39 +03:00
:: Kiln: Merge local desk from (optionally-)foreign one
::
2015-09-12 00:15:25 +03:00
:::: /hoon/merge/hood/gen
::
/? 310
/* help-text %txt /gen/hood/merge/help/txt
=, clay
2016-11-17 04:42:58 +03:00
::
|%
+$ beaky [knot knot knot ~]
+$ sorc ?([bek=beaky ~] [her=@p sud=@tas ~])
--
::
::::
2016-11-17 04:42:58 +03:00
::
:- %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
~ ((slog (turn `wain`help-text |=(=@t leaf+(trip t)))) ~)
[@ @ ~]
=+(arg [sud ?.(=(our her) her (sein:title p.bek now her)) sud (opt-case da+now) gem])
2016-02-11 22:20:50 +03:00
::
[^ ~]
2016-02-11 22:20:50 +03:00
=+ (pars bek.arg)
[dez ?.(=(our who) who (sein:title p.bek now who)) dez (opt-case caz) gem]
2016-02-11 22:20:50 +03:00
::
[* @ @ ~]
2016-02-11 22:20:50 +03:00
:- (pars-src syd.arg)
=+(arg [her sud (opt-case da+now) gem])
::
[* ^ ~]
2016-02-11 22:20:50 +03:00
:- (pars-src syd.arg)
2016-02-17 00:43:28 +03:00
=+((pars bek.arg) [who dez (opt-case caz) gem])
==
++ opt-case |=(a=case ?:(=(*case cas) a cas)) :: override
2020-12-06 12:03:12 +03:00
++ pars |=(a=beaky `[[who=ship dez=desk caz=case] *]`(need (de-beam a)))
++ pars-src
|= syd=$@(desk beaky)
?@ syd syd
=+ (pars syd)
~| [%into-foreign who `path`syd]
?>(=(our who) dez)
--