My man! It is definitely useful in while writing a deeply complex recursive code.
The procedure is kind of a walking two sub trees in parallel and making changes to existing subtrees while walking. But, if the recursive procedure fails we should revert the tree. And the code is recursive methods calling other recursive methods.
I once used such thing along with command pattern for remembering the code to be executed if the recursive procedure succeeds. And while doing that, if anything fails, we can just throw away the list of commands collected and execute it later if the whole recursive procedure succeeds.
The procedure is kind of a walking two sub trees in parallel and making changes to existing subtrees while walking. But, if the recursive procedure fails we should revert the tree. And the code is recursive methods calling other recursive methods.
I once used such thing along with command pattern for remembering the code to be executed if the recursive procedure succeeds. And while doing that, if anything fails, we can just throw away the list of commands collected and execute it later if the whole recursive procedure succeeds.
The control flow was exactly this.