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

  • TraceForward is an option for Trace and related functions which specifies whether to include later expressions on the evaluation chain that contains the pattern form sought.
  • TraceForward -> True includes the final expression on the evaluation chain that contains form.
  • TraceForward -> All includes all expressions after form on the evaluation chain that contains form.
  • TraceForward allows you to see the transformations performed on an expression generated during an evaluation.
  • See the Mathematica book: Section 2.5.10.

    Further Examples

    Here is the recursive definition of the Fibonacci numbers.

    In[1]:=

    Here are the end conditions for the recursion.

    In[2]:=

    This shows all expressions following fib[5] in the evaluation chain of fib[8].

    In[3]:=

    Out[3]=