/** * Evaluate the expression and return the <code>Trace[expr]</code> (i.e. all (sub-)expressions needed to calculate * the result). * * @param expr * the expression which should be evaluated. * @param matcher * a filter which determines the expressions which should be traced, If the matcher is set to * <code>null</code>, all expressions are traced. * @param list * an IAST object which will be cloned for containing the traced expressions. Typically a * <code>F.List()</code> will be used. * @return */ public final IAST evalTrace(final IExpr expr, Predicate<IExpr> matcher, IAST list) { IAST traceList = F.List(); try { beginTrace(matcher, list); evaluate(expr); } finally { traceList = endTrace(); } return traceList; }
/** * Evaluate the expression and return the <code>Trace[expr]</code> (i.e. all * (sub-)expressions needed to calculate the result). * * @param expr * the expression which should be evaluated. * @param matcher * a filter which determines the expressions which should be traced, * If the matcher is set to <code>null</code>, all expressions are * traced. * @param list * an IAST object which will be cloned for containing the traced * expressions. Typically a <code>F.List()</code> will be used. * @return */ public final IAST evalTrace(final IExpr expr, Predicate<IExpr> matcher, IAST list) { IAST traceList = F.List(); try { beginTrace(matcher, list); evaluate(expr); } finally { traceList = endTrace(); } return traceList; }