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 OptionsDetails 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.

ExamplesExamplesopen allclose all

Basic Examples (2)Basic Examples (2)

Print all expressions used in evaluation of an expression:

Click for copyable input

A recursive definition for finding Fibonacci numbers:

Click for copyable input

Show all additions of positive integers:

Click for copyable input
New in 2
New to Mathematica? Find your learning path »
Have a question? Ask support »