From 606bd7bb8a0aff397ffdb1bbc399cd1eb4c12cf8 Mon Sep 17 00:00:00 2001 From: Joe Bryan Date: Thu, 6 Jun 2024 17:44:47 -0400 Subject: [PATCH] ska: minor refactor of +rel:qui and +cut:qui --- hoon/codegen/lib/skan.hoon | 30 ++++++++++-------------------- 1 file changed, 10 insertions(+), 20 deletions(-) diff --git a/hoon/codegen/lib/skan.hoon b/hoon/codegen/lib/skan.hoon index 4027bee..04a7a62 100644 --- a/hoon/codegen/lib/skan.hoon +++ b/hoon/codegen/lib/skan.hoon @@ -744,20 +744,11 @@ ++ cut |= [sire=(set @hail) =cape] ^- prot - ?~ prog ~ - ?: =(| cape) ~ - ?^ cape - =/ n (murn n.prog |=([s=@hail a=@] ?:((~(has in sire) s) `[s a] ~))) - =/ l $(prog l.prog, cape -.cape) - =/ r $(prog l.prog, cape +.cape) - ?: ?&(?=(~ n) ?=(~ l) ?=(~ r)) ~ - [n l r] - =/ prop `prot`prog - |- ^- prot - ?~ prop ~ - =/ n (murn n.prop |=([s=@hail a=@] ?:((~(has in sire) s) `[s a] ~))) - =/ l $(prop l.prop) - =/ r $(prop r.prop) + ?: |(?=(%| cape) ?=(~ prog)) ~ + =/ n (skim n.prog |=([s=@hail @] (~(has in sire) s))) + =+ [p q]=?@(cape [& &] cape) + =/ l $(prog l.prog, cape p) + =/ r $(prog l.prog, cape q) ?: ?&(?=(~ n) ?=(~ l) ?=(~ r)) ~ [n l r] :: @@ -819,13 +810,12 @@ ++ rel |= [site=@hail =cape] ^- plop - ?~ prog ~ - ?: =(| cape) ~ + ?: |(?=(%| cape) ?=(~ prog)) ~ =/ n (murn n.prog |=(p=peon ?:(=(site site.p) `axe.p ~))) - =/ r ~(rip ca cape) - =/ l $(prog l.prog, cape -.r) - =/ r $(prog r.prog, cape +.r) - ?: ?&(?=(~ l) ?=(~ r) ?=(~ n)) ~ + =+ [p q]=?@(cape [& &] cape) + =/ l $(prog l.prog, cape p) + =/ r $(prog r.prog, cape q) + ?: &(?=(~ l) ?=(~ r) ?=(~ n)) ~ [n l r] :: :: relocate cached provenance