eyre: use slam and statically typed conversion

This commit is contained in:
Logan Allen 2021-05-20 18:03:04 +00:00
parent 306dbbaead
commit 5e2eb1b783

View File

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