What should the intended behaviour of the following program be?
Symbols x;
Local F1 = x+1;
.sort
PushHide;
Local F2 = x+2;
.sort
PushHide;
Local F3 = x+3;
.sort
Hide;
.sort
PopHide;
Print;
.end
At the moment, this results in
F1 =
1 + x;
F2 =
2 + x;
F3 =
3 + x;
so all three expressions become active again.
The manual states the following about PopHide:
Undoes the action of the most recent pushhide statement (see 7.121). If there is no matching pushhide statement an error will result.
Based on this description, I would expect the final PopHide; to reactivate only F2.
Internally, the push/pop mechanism is implemented through the hidelevel assigned to each expression. However, the Hide; statement resets the hidelevel of all hidden expressions so far to the highest current level. As a result, all hidden expressions are reactivated by the first PopHide;.
Interestingly, if Hide; is replaced by Hide F3; in the example above, then after PopHide; only F2 and F3 become active again.
@vermaseren, what was the intended behavior when PushHide, PopHide, and Hide are mixed in this way?
What should the intended behaviour of the following program be?
At the moment, this results in
so all three expressions become active again.
The manual states the following about
PopHide:Undoes the action of the most recent pushhide statement (see 7.121). If there is no matching pushhide statement an error will result.
Based on this description, I would expect the final
PopHide;to reactivate onlyF2.Internally, the push/pop mechanism is implemented through the
hidelevelassigned to each expression. However, theHide;statement resets thehidelevelof all hidden expressions so far to the highest current level. As a result, all hidden expressions are reactivated by the firstPopHide;.Interestingly, if
Hide;is replaced byHide F3;in the example above, then afterPopHide;onlyF2andF3become active again.@vermaseren, what was the intended behavior when
PushHide,PopHide, andHideare mixed in this way?