in reply to Continuations in Perl - Returning to an arbitrary level up the call stack
I have a need to return from a deeply nested function, not to the caller, but to a higher point up the call stack.
Every time I've found my code needing something as crazy as that, I've thrown the code away, got drunk/sober/laid/slept, whatever it took me to forget the idea and then come back and started over.
What you are suggesting sound likes bypassing the stairs by jumping from one landing to the next; and whilst Parkour makes for some great movie chases and youtube clips; designing a building that relied on it for emergency exits just isn't on.
But that exactly what you are doing by designing your code to rely upon such shortcuts.
I bet if you were to describe your application in sufficient detail that you'd get a raft of better solutions that don't require the equivalent of leaping from one tall building to the next as part of your daily commute.
|
|---|