Use withStack to ensure a stack is pushed on before f is evaluated, and popped when f finishes.
withStack
f