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
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.
Details
- 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.
Examples
Basic Examples (1)
A recursive definition for finding Fibonacci numbers:
fib[0] = fib[1] = 1;fib[n_] := fib[n - 1] + fib[n - 2];Show only what evaluations of fib are encountered:
Trace[fib[3], _fib]Show only the evaluations of fib and the results:
Trace[fib[3], _fib, TraceForward -> True]Show all intermediate evaluations between calls of fib and the result:
Trace[fib[3], _fib, TraceForward -> All]See Also
Tech Notes
History
Introduced in 1991 (2.0)
Text
Wolfram Research (1991), TraceForward, Wolfram Language function, https://reference.wolfram.com/language/ref/TraceForward.html.
CMS
Wolfram Language. 1991. "TraceForward." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/TraceForward.html.
APA
Wolfram Language. (1991). TraceForward. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/TraceForward.html
BibTeX
@misc{reference.wolfram_2026_traceforward, author="Wolfram Research", title="{TraceForward}", year="1991", howpublished="\url{https://reference.wolfram.com/language/ref/TraceForward.html}", note=[Accessed: 15-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_traceforward, organization={Wolfram Research}, title={TraceForward}, year={1991}, url={https://reference.wolfram.com/language/ref/TraceForward.html}, note=[Accessed: 15-June-2026]}