On Sun, Feb 18, 2024 at 11:35 AM Bart Schaefer wrote: > > How about this? It skips PM_RO_BY_DESIGN for any parameter not > declared in the same scope where "typeset -p" is being run. This > means that in addition to displaying parameters declared private, > it'll show cases where "local +h" has been used to shadow a special. The more I think through this, the more I think it's the right thing to do. A couple of related observations: 1) It isn't necessary to use +h unless removing the -h attribute, the default is to retain specialness even when local. I usually include it just for clarity, so in case we want to add it later I've left a comment in the patch. 2) On the other hand, it is necessary to use -h for hiding, and typeset -p did not preserve that flag on output before. Consequently I've revised the patch to add the -h option for parameters that have it. This is also consistent with the output of ${(t)var} which shows the substring "hide". The side-effect of this is that private parameters are shown as having the -h property, which is a bit closer to correct. > [...] we should probably mention > somewhere that "typeset -p" no longer displays values for the special > parameters $!, $#, $-, $*, $@, $$, $?, $ARGC, etc. Doc change added for this. Also disabled "private -p" (it had already been removed from the documentation) and update the doc to reflect this. > This is actually a change in 5.9 vs. 5.8 that was not > included in the NEWS file. I did not edit NEWS, yet. This replaces workers/52557.