I noticed something in Go related to this, which is their defer
keyword:
"A defer statement pushes a function call onto a list. The list of saved calls is executed after the surrounding function returns. Defer is commonly used to simplify functions that perform various clean-up actions."
This is quite similar to my suggestion. Though we do not have the concept of a "currently running function", we do have a "currently running block", but that wouldn't be much use if you wrote something like:
some-code
if condition [
defer [...cleanup...]
]
Running at the end of that block would be no different than just calling normally. So that wouldn't work so well.
We might also be able to use things to identify frames; e.g. defer 'return [...whatever...] could get the binding out of the RETURN. Another alternative might say that a construct that wishes to use DEFER might make a definitional defer which encodes the frame...the way that RETURN does.