chat: Move eval logic into lib

This commit is contained in:
Fang 2019-10-08 20:54:02 +02:00
parent c7fbad61ee
commit 9532857ef5
No known key found for this signature in database
GPG Key ID: EB035760C1BBA972
3 changed files with 20 additions and 13 deletions

View File

@ -12,8 +12,7 @@
/- *chat-store, *chat-view, *chat-hook,
*permission-store, *group-store,
sole-sur=sole
/+ sole-lib=sole
/= seed /~ !>(.)
/+ sole-lib=sole, chat-eval
::
|%
+$ state
@ -681,16 +680,7 @@
::
++ eval
|= [txt=cord exe=hoon]
=; tan=(list tank)
(say %code txt tan)
;; (list tank)
=< +>
%+ mong
:- mute
=- |.([(sell (slap (slop !>(-) seed) exe))]~)
^- [our=@p now=@da eny=@uvI]
[our-self now.bowl (shas %eny eny.bowl)]
|=(^ ~)
(say %code txt (eval:chat-eval bowl exe))
:: +lookup-glyph: print glyph info for all, glyph or target
::
++ lookup-glyph

View File

@ -1,4 +1,5 @@
/- *chat-store, *chat-view
/+ chat-eval
|%
::
++ slan |=(mod/@tas |=(txt/@ta (need (slaw mod txt))))
@ -39,7 +40,7 @@
=/ res ((ot output+(ar dank) ~) a)
?^ res
u.res
p:(mule |.([(sell (slap !>(..^zuse) (ream u.exp)))]~)) ::TODO oldz
(eval:chat-eval *bowl:gall (ream u.exp))
::
++ lett
|= =letter

View File

@ -0,0 +1,16 @@
|%
++ eval
|= [=bowl:gall =hoon]
^- (list tank)
=/ subj=[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))]~)
|=(^ ~)
--