chat: improve eval implementation
Previous implementation was doing double virtualization, which gave issues
around scries. By reimplementing with mint and mock, we get to catch all
possible failure cases and produce an appropriate output for each.
++ eval
|= [=bowl:gall =hoon]
^- (list tank)
- =/ subj=[our=@p now=@da eny=@uvJ]
+ =/ fowl=[our=@p now=@da eny=@uvJ]
:+ our.bowl
now.bowl
(shaz (cat 3 (mix [now eny]:bowl) %eny))
::
- ;; (list tank)
- =< +>
- %+ mong
- :- mute
- |.([(sell (slap (slop !>(subj) !>(..zuse)) hoon))]~)
- |=(^ ~)
+ =/ subject [fowl ..zuse]
+ =/ minted=(each [=type =nock] (list tank))
+ %- mule |.
+ (~(mint ut -:!>(subject)) %noun hoon)
+ ?: ?=(%| -.minted) p.minted
+ =/ =toon
+ (mock [subject nock.p.minted] |=(^ ~))
+ ?- -.toon
+ %0 [(sell type.p.minted p.toon) ~]
+ %1 [leaf+"scries unsupported in chat eval" ~]
+ %2 [leaf+"crash!" p.toon]
+ ==
--
