!7 set flag DynModule. sclass TelegramFactsBot > AbstractTelegramThinkBot { S evalExp(Exp e) { S code = nlLogic_text(e); print("Eval'ing: " + code); temp tempAdd(hotwire_copyOver_after, voidfunc(Class c) { copyFields(mc(), c, 'telegram_msg_tl) }); S result = str(javaEval(code)); print("Result: " + shorten(result, 100)); ret result; } void thinkAbout(S s) { NLLogicChecker_v2 c = new NLLogicChecker_v2 { bool checkExpression(Exp e, Matching m) { if (e cast Func) { if (eq(e.name, "verbPhraseFromThirdPerson")) ret nlLogic_stringFunction(f ai_verbPhraseFromThirdPerson, e, m.matches); else if (eq(e.name, "singular")) ret nlLogic_stringFunction(f singular, e, m.matches); else if (eq(e.name, 'eval)) ret eq("true", evalExp(e.arg)); } if (e cast Eq) { Exp r = e.right; S var = nlLogic_text(e.left); if (r cast Func) pcall { if (eq(r.name, 'eval)) ret new NLStringMatcher_singleDollarVar().match(var, evalExp(r.arg), m.matches); } } ret super.checkExpression(e, m); } }; c.matcher = new NLStringMatcher_dollarVars_underscores; c.input = s; c.facts = mL_facts(); applyNLLogicFacts_v2(c, voidfunc(S s) { postMessage(s) }, ai_mL_parsedLogicExamples()); } }