mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-12-15 10:02:47 +03:00
ford-fusion: +validate-path, +cast-path
This commit is contained in:
parent
dcf2c0ec51
commit
6e12f71789
@ -2900,17 +2900,32 @@
|
||||
++ validate-path
|
||||
|= [=path =page]
|
||||
^- [cage state]
|
||||
?. =((head (flop path)) p.page)
|
||||
!! :: TODO cast
|
||||
=/ mak=mark (head (flop path))
|
||||
?: =(mak p.page)
|
||||
(page-to-cage page)
|
||||
=^ [mark vax=vase] nub (page-to-cage page)
|
||||
=^ =tube nub (get-cast p.page mak)
|
||||
:_(nub [mak (tube vax)])
|
||||
::
|
||||
++ page-to-cage
|
||||
|= =page
|
||||
^- [cage state]
|
||||
?: =(%hoon p.page)
|
||||
:_(nub [%hoon -:!>(*@t) q.page])
|
||||
=^ =dais nub (get-mark p.page)
|
||||
:_(nub [p.page (vale:dais q.page)])
|
||||
::
|
||||
++ cast-path
|
||||
|= [=path =mark]
|
||||
|= [=path mak=mark]
|
||||
^- [cage state]
|
||||
!!
|
||||
=^ cag=(unit cage) nub (get-value path)
|
||||
?~ cag ~|(cannot-resolve-path+path !!)
|
||||
=/ mok (head (flop path))
|
||||
?: =(mok mak)
|
||||
[u.cag nub]
|
||||
=^ =tube nub (get-cast mak mok)
|
||||
:_(nub [mak (tube q.u.cag)])
|
||||
::
|
||||
++ run-pact
|
||||
|= [old=page diff=page]
|
||||
^- [cage state]
|
||||
|
Loading…
Reference in New Issue
Block a user