static S ai_ifThenSay(S rule, S input) { new Matches m; ai_opCheck(rule, "if * then say *", m); S condition = roundBrackets($1); S sf = ai_text(condition, "matches to predicate", "$X"); if (sf == null) fail("no matching predicate found for " + condition); if (!isTrue(ai_callSafeSFOnInput(sf, input))) null; ret $2; }