static O nlLogic_evalExp(final NLLogicChecker_v2 c, Exp e, NLLogicChecker_v2.Matching m) { // prepare context final SS vars = m.matches; temp tempSetThreadLocal(ai_context_tl(), new O { LS getList(S var) { int i = 1; S s; new LS l; while ((s = vars.get(var + i++)) != null) l.add(s); ret l; } IfThen getRule(S id) { ret findByField(c.rules, globalID := id); } }); S code = nlLogic_text(e); print("Eval'ing: " + code); temp tempAdd(hotwire_copyOver_after, voidfunc(Class c) { copyFields(mc(), c, 'telegram_msg_tl, 'telegram_recentHistory_tl, 'ai_context_tl) }); O result; pcall { result = evalWithDollarVars_assertAllVarsSet(code, m.matches); } print("Result: " + shorten(str(result), 100)); ret result; }