This is documentation for Mathematica 3, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.2)
 Documentation / Mathematica / Built-in Functions / Programming / Debugging  /
TraceOriginal

  • TraceOriginal is an option for Trace and related functions which specifies whether to test the form of each expression before its head and arguments are evaluated.
  • With the default TraceOriginal -> False, the forms of expressions generated during an evaluation are tested only after their head and arguments have been evaluated. In addition, evaluation chains for expressions which do not change under evaluation are not included.
  • With TraceOriginal -> True, the forms before evaluation of the head and arguments are also tested, and evaluation chains for expressions which do not change under evaluation are included.
  • See the Mathematica book: Section 2.5.10.

    Further Examples

    Here is a recursive definition of a factorial function.

    In[1]:=

    This includes expressions which match fac[_] both before and after argument evaluation.

    In[2]:=

    Out[2]=

    In this case, Trace includes absolutely all expressions, even those with trivial evaluation chains.

    In[3]:=

    Out[3]=