Ticket #876 (closed RFC: fixed)
Deprecate pushaction, pushmark, popmark
Reported by: | whiteknight | Owned by: | coke |
---|---|---|---|
Priority: | normal | Milestone: | 2.4 |
Component: | none | Version: | 1.4.0 |
Severity: | medium | Keywords: | stack |
Cc: | Language: | ||
Patch status: | Platform: |
Description
I suggest we deprecate the three opcodes pushaction, pushmark, and popmark. These three opcodes are not used much that I am aware of, especially not in PCT. I am also having a lot of trouble personally coming up with compelling use-cases for them that couldn't be better resolved through other methods.
pushmark and popmark especially seem to be worthless considering how emaciated the stacks implementation has become. At the moment, there are almost no ways to use this feature.
The documentation for push action claims that pushed actions are fired when the dynamic environment is unwound due to a subroutine return or an exception being thrown. However, the dynamic_env stack is not unwound in either of these cases, and pushed actions will not be fired then. Because of this limitation, pushaction cannot be used as a general "atexit" mechanism for subroutines (although I can see some benefit in having such a mechanism, and suggest maybe we could create one). The only way apparently to trigger pushed actions is to use the pushmark/popmark combination.
Also, besides firing actions in this way, pushmark and popmark currently serve no other purpose that I can discern.
I suggest we deprecate all these opcodes now, so we can rip them out completely after 2.0.