From 1d347ede31fb72e162e13955d8c25c148f75402c Mon Sep 17 00:00:00 2001 From: Steve Dee Date: Tue, 15 Apr 2014 16:47:57 -0700 Subject: [PATCH] Tree edit --- arvo/hoon.hoon | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/arvo/hoon.hoon b/arvo/hoon.hoon index bd5dcafa5..fa4dd8b42 100644 --- a/arvo/hoon.hoon +++ b/arvo/hoon.hoon @@ -3753,7 +3753,9 @@ |= [old=* new=*] ^- udon :- pum ?+ pum ~|(%unsupported !!) - %a [%a old new] + %a [%d (nude old new)] + %b =+ [hel=(cue ((hard ,@) old)) hev=(cue ((hard ,@) new))] + [%d (nude hel hev)] %c =+ [hel=(lore ((hard ,@) old)) hev=(lore ((hard ,@) new))] [%c (lusk hel hev (loss hel hev))] == @@ -3959,6 +3961,37 @@ $(hel t.hel, rag (done %| [i.hel ~] ~)) $(hel t.hel, hev t.hev, rag (done %| [i.hel ~] [i.hev ~])) -- +++ nude :: tree change + |= [a=* b=*] + ^- [p=upas q=upas] + =< [p=(tred a b) q=(tred b a)] + |% + ++ axes :: locs of nouns + |= [a=@ b=*] ^- (map ,* axis) + =+ c=*(map ,* axis) + |- ^- (map ,* axis) + => .(c (~(put by c) b a)) + ?@ b + c + %- ~(uni by c) + %- ~(uni by $(a (mul 2 a), b -.b)) + $(a +((mul 2 a)), b +.b) + ++ tred :: diff a->b + |= [a=* b=*] ^- upas + =| c=(unit ,*) + =+ d=(axes 1 a) + |- ^- upas + => .(c (~(get by d) b)) + ?~ c + ?@ b + [%1 b] + =+ e=^-(upas [$(b -.b) $(b +.b)]) + ?- e + [[%1 *] [%1 *]] [%1 [p.p.e p.q.e]] + * e + == + [%0 u.c] + -- :::::::::::::::::::::::::::::::::::::::::::::::::::::::::: :: section 2eY, SHA-256 (move me) :: ::