From e621744169ca1372c6e1808224807ea37dd57321 Mon Sep 17 00:00:00 2001 From: Liam Fitzgerald Date: Tue, 8 Mar 2022 14:49:47 -0600 Subject: [PATCH] zuse: add +balk core for remote scry path format +balk defines a datastructure for a parsed remote scry path format in addition to conversion gates to and from paths. The new scry path format is /~ship/rift/life/vane/care/spur. Note that desk no longer appears in the scry path format and should instead be encoded as the first item of the spur. --- pkg/arvo/sys/zuse.hoon | 53 +++++++++++++++++++++++++++++++ pkg/arvo/tests/sys/zuse/balk.hoon | 17 ++++++++++ 2 files changed, 70 insertions(+) create mode 100644 pkg/arvo/tests/sys/zuse/balk.hoon diff --git a/pkg/arvo/sys/zuse.hoon b/pkg/arvo/sys/zuse.hoon index bea070310..d60780fc2 100644 --- a/pkg/arvo/sys/zuse.hoon +++ b/pkg/arvo/sys/zuse.hoon @@ -5515,4 +5515,57 @@ ?. ?=(%soft -.wrapped) wrapped ;;(task +.wrapped) +:: +:: +++ balk + =< bulk + |% + +$ bulk + $: [her=ship rif=rift lyf=life] + [van=@ta car=@ta cas=case] + spr=spur + == + :: + ++ de-path-soft + |= [=rift =life =path] + ^- (unit bulk) + :: [care ship desk case path] + ?. ?=([@ @ @ @ *] path) + ~ + =/ van=@ta (end 3 i.path) + =/ car=@ta (rsh 3 i.path) + ?~ her=(slaw %p i.t.path) + ~ + ?~ cas=(de-case i.t.t.t.path) + ~ + :- ~ + :* [u.her rift life] + [van car u.cas] + [i.t.t.path t.t.t.t.path] + == + :: + ++ de-path + |= [=rift =life =path] + ^- bulk + (need (de-path-soft +<)) + :: + ++ en-path + |= =bulk + ^- path + ?> ?=([@ *] spr.bulk) + :* (cat 3 van.bulk car.bulk) + (scot %p her.bulk) + i.spr.bulk + (scot cas.bulk) + t.spr.bulk + == + :: + ++ en-roof + |= =bulk + ^- (unit [vis=view bem=beam]) + ?. ?=(^ spr.bulk) ~ + =/ bem=beam [[her i.spr cas] t.spr]:bulk + =+ vis=(cat 3 van.bulk car.bulk) + `[vis bem] + -- -- diff --git a/pkg/arvo/tests/sys/zuse/balk.hoon b/pkg/arvo/tests/sys/zuse/balk.hoon new file mode 100644 index 000000000..7942b81db --- /dev/null +++ b/pkg/arvo/tests/sys/zuse/balk.hoon @@ -0,0 +1,17 @@ +/+ *test +|% +++ hastuc-dibtux [~hastuc-dibtux 15 22] +++ clay-x [%c %x %ud 3] +++ test-en-path + %+ expect-eq + !>(`path`/cx/~hastuc-dibtux/base/3/sys/hoon/hoon) + !> %- en-path:balk + [hastuc-dibtux clay-x /base/sys/hoon/hoon] +++ test-de-path + =/ bal=balk + (de-path:balk 15 22 /cx/~hastuc-dibtux/base/3/sys/hoon/hoon) + %+ expect-eq !>(bal) + !> ^- balk + [hastuc-dibtux clay-x /base/sys/hoon/hoon] + +--