On Wed, Sep 1, 2021 at 10:35 AM Bart Schaefer wrote: > > Something else has changed since the implementation of private, I > think, because this is not what I expected: > > top () { private foo=top; mid } > mid () { typeset -g foo=middle; bot } > bot () { print $foo } > functions -t top The attached patch addresses this, producing the output I expected: +top:0> private foo=top +top:0> mid +mid:0> typeset -g foo=middle +mid:0> bot +bot:0> print middle middle It also improves the error message in the event that a typeset attempts to change the scope or properties of a private parameter. > Even > without private, "typeset -g" only reaches as far upwards as the most > recent local declaration of the name. A documentation patch to better explain this is included. As a bonus, there's also an explanation of why some parameters do not appear in "typeset -p" output.