From 83d7b53b58db4c4aac268d54e4061c17448ff689 Mon Sep 17 00:00:00 2001 From: fang Date: Fri, 8 Jul 2022 14:01:17 +0200 Subject: [PATCH] hoon: add converters between un/typed paths --- pkg/arvo/sys/hoon.hoon | 41 +++++++++++++++++++++++++++++------------ 1 file changed, 29 insertions(+), 12 deletions(-) diff --git a/pkg/arvo/sys/hoon.hoon b/pkg/arvo/sys/hoon.hoon index 6e7c29942..0be473c7f 100644 --- a/pkg/arvo/sys/hoon.hoon +++ b/pkg/arvo/sys/hoon.hoon @@ -5987,21 +5987,38 @@ ;~(pfix fas (most fas urs:ab)) :: ++ stip :: typed path parser - =- ;~(pfix fas (more fas -)) - |^ %- stew - ^. stet ^. limo - :~ :- 'a'^'z' (slot (stag %tas sym)) - :- '$' (cold [%tas %$] buc) - :- '0'^'9' (slot bisk:so) - :- '-' (slot tash:so) - :- '.' zust:so - :- '~' (slot ;~(pfix sig ;~(pose crub:so (easy [%n ~])))) - :- '\'' (stag %t qut) - == + =< swot + |% + ++ swot |=(n=nail (;~(pfix fas (more fas spot)) n)) :: - ++ slot |*(r=rule (sear (soft iota) r)) + ++ spot + %+ sear (soft iota) + %- stew + ^. stet ^. limo + :~ :- 'a'^'z' (stag %tas sym) + :- '$' (cold [%tas %$] buc) + :- '0'^'9' bisk:so + :- '-' tash:so + :- '.' zust:so + :- '~' ;~(pfix sig ;~(pose crub:so (easy [%n ~]))) + :- '\'' (stag %t qut) + == -- :: +++ pout + |= =pith + ^- path + %+ turn pith + |= i=iota + ?@(i i (scot i)) +:: +++ pave + |= =path + ^- pith + %+ turn path + |= i=@ta + (fall (rush i spot:stip) [%ta i]) +:: :::: 4n: virtualization :: :: +mack: untyped, scry-less, unitary virtualization