2024-11-03 00:13:21 +0100, Steffen Nurpmeso via austin-group-l at The Open Group: [...] > Quite some years ago i proposed perl's "my" on this list. > Later "our". And i think i said that new keywords avoid > ambiguities. (Shells could simply alias the one or the other.) > > As another context. > For the MUA i maintain i implemented "local" as "my", as well as > "our" as what eg bash has for "local". [...]
A new keyword would also work but Perl's "my" is not what we want here as it does static scoping (as the name also suggests) which no shell other than ksh93 does (well, zsh has "private" for something similar) and is generally at odd with the kind of scoping that subshells and environment variables implement. Perl's "our" is for global variables at package level (some shells have "package"-type features such as the namespace of ksh93, with a reduced version making its way into zsh), so is not really what we want here either. The Perl one we want is "local", but there are many discrepancies between shell implementations which is why we're looking for another word. Could be "locvar" or "localvar", which could later be extended to "locopt", "locfunc"... Could be options to "set" or "export"; nothing I can think of sound really appealing. -- Stephane
