TracePrint

TracePrint[expr]

prints all expressions used in the evaluation of expr.

TracePrint[expr,form]

includes only those expressions which match form.

TracePrint[expr,s]

includes all evaluations which use transformation rules associated with the symbol s.

Details and Options

  • TracePrint indents its output in correspondence with the nesting levels for lists generated by Trace.
  • The indentation is done using the print form defined for the object Indent[d].
  • TracePrint prints the forms of expressions before any of their elements are evaluated.
  • TracePrint does not support the TraceBackward option of Trace.
  • TracePrint yields only the forward part of the output specified by the option setting TraceAbove->All.
  • TracePrint[expr] returns the result of evaluating expr.

Examples

Basic Examples  (2)

Print all expressions used in evaluation of an expression:

A recursive definition for finding Fibonacci numbers:

Show all additions of positive integers:

Wolfram Research (1991), TracePrint, Wolfram Language function, https://reference.wolfram.com/language/ref/TracePrint.html.

Text

Wolfram Research (1991), TracePrint, Wolfram Language function, https://reference.wolfram.com/language/ref/TracePrint.html.

CMS

Wolfram Language. 1991. "TracePrint." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/TracePrint.html.

APA

Wolfram Language. (1991). TracePrint. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/TracePrint.html

BibTeX

@misc{reference.wolfram_2024_traceprint, author="Wolfram Research", title="{TracePrint}", year="1991", howpublished="\url{https://reference.wolfram.com/language/ref/TracePrint.html}", note=[Accessed: 17-November-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_traceprint, organization={Wolfram Research}, title={TracePrint}, year={1991}, url={https://reference.wolfram.com/language/ref/TracePrint.html}, note=[Accessed: 17-November-2024 ]}