chat: Move eval logic out of /lib/chat-json

This allows us to always include the bowl when evaluating a code letter.
This commit is contained in:
Fang 2019-10-08 22:44:20 +02:00
parent 0da8e1efb3
commit e567de9c18
No known key found for this signature in database
GPG Key ID: EB035760C1BBA972
2 changed files with 7 additions and 5 deletions

View File

@ -1,6 +1,6 @@
:: chat-store: data store that holds linear sequences of chat messages
::
/+ *chat-json
/+ *chat-json, *chat-eval
|%
+$ move [bone card]
::
@ -193,6 +193,10 @@
=/ mailbox=(unit mailbox) (~(get by inbox) path.act)
?~ mailbox
[~ this]
=* letter letter.envelope.act
=? letter &(?=(%code -.letter) ?=(~ output.letter))
=/ =hoon (ream expression.letter)
letter(output (eval bol hoon))
=: length.config.u.mailbox +(length.config.u.mailbox)
number.envelope.act length.config.u.mailbox
envelopes.u.mailbox (snoc envelopes.u.mailbox envelope.act)

View File

@ -37,10 +37,8 @@
?~ exp
[~ '' ~]
:+ ~ u.exp
=/ res ((ot output+(ar dank) ~) a)
?^ res
u.res
(eval:chat-eval *bowl:gall (ream u.exp))
::NOTE when sending, if output is an empty list, chat-store will evaluate
(fall ((ot output+(ar dank) ~) a) ~)
::
++ lett
|= =letter