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  /
TraceDepth

  • TraceDepth is an option for Trace and related functions which specifies the maximum nesting of evaluation chains that are to be included.
  • Setting TraceDepth -> n keeps only parts down to level n in nested lists generated by Trace.
  • By setting TraceDepth, you can make Trace and related functions skip over "inner" parts of a computation, making their operation more efficient.
  • See the Mathematica book: Section 2.5.10.
  • See also: TraceOff.

    Further Examples

    Here is the recursive definition of the Fibonacci numbers.

    In[1]:=

    Here are the end conditions for the recursion.

    In[2]:=

    Out[2]=

    This shows only steps that appear in lists nested at most three levels deep.

    In[3]:=

    Out[3]=