hoon: add converters between un/typed paths

This commit is contained in:
fang 2022-07-08 14:01:17 +02:00
parent c977486f71
commit 83d7b53b58
No known key found for this signature in database
GPG Key ID: EB035760C1BBA972

View File

@ -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