mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-12-22 22:31:30 +03:00
eyre: use slam and statically typed conversion
This commit is contained in:
parent
306dbbaead
commit
5e2eb1b783
@ -1642,17 +1642,14 @@
|
|||||||
::
|
::
|
||||||
=* have=mark p.cage.sign
|
=* have=mark p.cage.sign
|
||||||
=* desc=tape "from {(trip have)} to json"
|
=* desc=tape "from {(trip have)} to json"
|
||||||
=/ convert=(unit $-(* json))
|
=/ convert=(unit vase)
|
||||||
=/ cag=(unit (unit cage))
|
=/ cag=(unit (unit cage))
|
||||||
(rof ~ %cf [our %home da+now] /[have]/json)
|
(rof ~ %cf [our %home da+now] /[have]/json)
|
||||||
?. ?=([~ ~ *] cag) ~
|
?. ?=([~ ~ *] cag) ~
|
||||||
`!<($-(* json) q.u.u.cag)
|
`q.u.u.cag
|
||||||
?~ convert
|
?~ convert
|
||||||
((slog leaf+"eyre: no convert {desc}" ~) [~ ~])
|
((slog leaf+"eyre: no convert {desc}" ~) [~ ~])
|
||||||
=/ res (mule |.((u.convert q.cage.sign)))
|
[`have `[%fact %json (slam u.convert q.cage.sign)]]
|
||||||
?: ?=(%& -.res)
|
|
||||||
[`have `[%fact %json !>(p.res)]]
|
|
||||||
((slog leaf+"eyre: failed tube {desc}" ~) [~ ~])
|
|
||||||
::
|
::
|
||||||
?~ q.jsyn ~
|
?~ q.jsyn ~
|
||||||
%- some
|
%- some
|
||||||
@ -1680,7 +1677,7 @@
|
|||||||
:- 'json'
|
:- 'json'
|
||||||
~| [%unexpected-fact-mark p.cage.sign]
|
~| [%unexpected-fact-mark p.cage.sign]
|
||||||
?> =(%json p.cage.sign)
|
?> =(%json p.cage.sign)
|
||||||
;;(json q.q.cage.sign)
|
!<(json q.cage.sign)
|
||||||
==
|
==
|
||||||
::
|
::
|
||||||
%kick
|
%kick
|
||||||
|
Loading…
Reference in New Issue
Block a user