/** * Evaluate an object without resetting the numeric mode after the evaluation * step. If evaluation is not possible return the input object, * * @param expr * the object which should be evaluated * @return the evaluated object * */ public final IExpr evalWithoutNumericReset(final IExpr expr) { IExpr temp = evalLoop(expr); return temp == null ? expr : temp; }
/** * * Evaluate an object and reset the numeric mode to the value before the evaluation step. If evaluation is not * possible return <code>F.NIL</code>. * * @param expr * the object which should be evaluated * @return the evaluated object or <code>F.NIL</code> if no evaluation was possible */ public final IExpr evaluateNull(final IExpr expr) { boolean numericMode = fNumericMode; try { return evalLoop(expr); } finally { fNumericMode = numericMode; } }
/** * * Evaluate an object and reset the numeric mode to the value before the * evaluation step. If evaluation is not possible return <code>null</code>. * * @param expr * the object which should be evaluated * @return the evaluated object of <code>null</code> if no evaluation was * possible */ public final IExpr evaluateNull(final IExpr expr) { boolean numericMode = fNumericMode; try { return evalLoop(expr); } finally { fNumericMode = numericMode; } }
/** * Evaluate an object without resetting the numeric mode after the evaluation step. If evaluation is not possible * return the input object, * * @param expr * the object which should be evaluated * @return the evaluated object * */ public final IExpr evalWithoutNumericReset(final IExpr expr) { return evalLoop(expr).orElse(expr); }
default IExpr evaluateHead(IAST ast, EvalEngine engine) { IExpr result = engine.evalLoop(this); if (result.isPresent()) { // set the new evaluated header ! return ast.apply(result); } return F.NIL; }
if ((result = evalLoop(ast.head())) != null) {
IExpr temp = evalLoop(arg); if (temp.isPresent()) { if (!result0[0].isPresent()) {
IExpr result = evalLoop(ast.head()); if (result != null) { IAST resultList = ast.clone();
IAST f = resultList.isPresent() ? resultList : ast; if (f.isNumericFunction()) { IExpr temp = evalLoop(f); if (temp.isPresent()) { return temp;