({{, (RefLink[Stack, paclet:ref/Stack])[]
shows the current evaluation stack, giving a list of the tags associated with evaluations that are currently being done. }, {, (RefLink[Stack, paclet:ref/Stack])[pattern]
gives a list of expressions currently being evaluated which match the pattern. }})

OpenersNotesSection(Spacer1)Details

(RefLink[Stack, paclet:ref/Stack])[_] shows all expressions currently being evaluated.

You can call (RefLink[Stack, paclet:ref/Stack]) from inside a dialog to see how the dialog was reached.

In the list returned by (RefLink[Stack, paclet:ref/Stack])[pattern], each expression is wrapped with (RefLink[HoldForm, paclet:ref/HoldForm]).

The maximum length of (RefLink[Stack, paclet:ref/Stack])[] is limited by (RefLink[$RecursionLimit, paclet:ref/$RecursionLimit]).

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

OpenersPrimaryExamplesSection(Spacer1)Examples  (3)

OpenersExampleSection0(Spacer1)Basic Examples  (2)

Print the stack where the (RefLink[Stack, paclet:ref/Stack]) command is being evaluated:

f[g[1,Print[Stack[]];2]]

Print the detailed stack contents including function arguments:

f[g[1,Print[Stack[_]];2]]

OpenersExampleSection1(Spacer1)Scope  (1)

Use (RefLink[Stack, paclet:ref/Stack]) inside of (RefLink[Dialog, paclet:ref/Dialog]) to see how it was reached:

1 + 2*Dialog[] + 3*Dialog[]^2

(RefLink[Stack, paclet:ref/Stack]) shows that the dialog from 2*(RefLink[Dialog, paclet:ref/Dialog])[] is entered first:

Stack[_]

Return[x+1]

Upon return from the first dialog, the other is entered:

Stack[_]

Return[x-1]

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

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

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Symbolic Execution History, paclet:guide/SymbolicExecutionHistory])}, {▪(RefLinkPlain[Low-Level System Spelunking, paclet:guide/LowLevelSystemSpelunking])}, {▪(RefLinkPlain[Tuning & Debugging, paclet:guide/TuningAndDebugging])}})}})