({{, (RefLink[StackBegin, paclet:ref/StackBegin])[expr]
evaluates expr, starting a fresh evaluation stack. }})

OpenersNotesSection(Spacer1)Details

You can use (RefLink[StackBegin, paclet:ref/StackBegin]) to prevent "outer" evaluations from appearing in the evaluation stack when you call (RefLink[Stack, paclet:ref/Stack]).

(RefLink[StackBegin, paclet:ref/StackBegin]) has attribute (RefLink[HoldFirst, paclet:ref/HoldFirst]).

A (RefLink[StackBegin, paclet:ref/StackBegin]) is automatically done when the evaluation of each input line begins in an interactive Wolfram System session.

OpenersPrimaryExamplesSection(Spacer1)Examples  (2)

OpenersExampleSection0(Spacer1)Basic Examples  (2)

Show only the evaluations being done inside of f:

1+x+f[StackBegin[2+x*g[Print[Stack[]];2]]]

Get the detailed stack contents:

1+x+f[StackBegin[2+x*g[Print[Stack[_]];2]]]

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[Stack, paclet:ref/Stack])  ▪  (RefLink[StackInhibit, paclet:ref/StackInhibit])}})}})

({{DocumentationFooterIconsRelatedTutorial.png, ({{Tutorials}, {▪(RefLinkPlain[The Evaluation Stack, paclet:tutorial/TheEvaluationStack])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Symbolic Execution History, paclet:guide/SymbolicExecutionHistory])}})}})