more flexible merge arguments

This commit is contained in:
Anton Dyudin 2015-07-30 15:32:06 -07:00
parent fba6d51505
commit 96eba00fd8

View File

@ -2,11 +2,32 @@
:::: /hoon/merge/hood/cat
::
/? 314
!:
|%
++ beaky ,[span span span ~]
++ sorc ?([bek=beaky ~] [her=@p sud=@tas ~])
--
::
::::
!:
|= $: [now=@da eny=@uvI bec=beak]
[[syd=@tas her=@p sud=@tas gem=?([?(%auto germ) ~] ~)] ~]
|= $: [now=@da eny=@uvI bek=beak]
[arg=[?(sorc [syd=$|(desk beaky) sorc])] opt=(map ,%gem germ)]
==
:- %kiln-merge
[syd her sud ?~(gem %auto -.gem)]
=* our p.bek
|^ :- %kiln-merge
^- [syd=desk her=ship sud=desk gem=?(germ %auto)]
=+ gem=(fall (~(get by opt) %gem) %auto)
?- arg
[@ @ ~] =+(arg [sud ?.(=(our her) her (sein her)) sud gem])
[^ ~] =+((pars bek.arg) [dez ?.(=(our who) who (sein who)) dez gem])
[* @ @ ~] [(pars-src syd.arg) =+(arg [her sud gem])]
[* ^ ~] [(pars-src syd.arg) =+((pars bek.arg) [who dez gem])]
==
++ pars |=(a=beaky =+((need (tome a)) `[who=ship dez=desk]`[p q]))
++ pars-src
|= syd=$|(desk beaky)
?@ syd syd
=+ (pars syd)
~| [%into-foreign who `path`syd]
?>(=(our who) dez)
--