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
|
||||
=* desc=tape "from {(trip have)} to json"
|
||||
=/ convert=(unit $-(* json))
|
||||
=/ convert=(unit vase)
|
||||
=/ cag=(unit (unit cage))
|
||||
(rof ~ %cf [our %home da+now] /[have]/json)
|
||||
?. ?=([~ ~ *] cag) ~
|
||||
`!<($-(* json) q.u.u.cag)
|
||||
`q.u.u.cag
|
||||
?~ convert
|
||||
((slog leaf+"eyre: no convert {desc}" ~) [~ ~])
|
||||
=/ res (mule |.((u.convert q.cage.sign)))
|
||||
?: ?=(%& -.res)
|
||||
[`have `[%fact %json !>(p.res)]]
|
||||
((slog leaf+"eyre: failed tube {desc}" ~) [~ ~])
|
||||
[`have `[%fact %json (slam u.convert q.cage.sign)]]
|
||||
::
|
||||
?~ q.jsyn ~
|
||||
%- some
|
||||
@ -1680,7 +1677,7 @@
|
||||
:- 'json'
|
||||
~| [%unexpected-fact-mark p.cage.sign]
|
||||
?> =(%json p.cage.sign)
|
||||
;;(json q.q.cage.sign)
|
||||
!<(json q.cage.sign)
|
||||
==
|
||||
::
|
||||
%kick
|
||||
|
Loading…
Reference in New Issue
Block a user