Stephane Chazelas via austin-group-l at The Open Group wrote in <6xx5zpm4ctkj72lhzudnkf52hbpjbh6vmmfjfvuhx42ibr3phv@itb6s5kt5aqi>: |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.
okokok, that is another language of course. But names that i think could be easily understood. |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. I see however people jumping of joy they are enabled to write "local --inherit" or "local --scope" or "local --reallylocal" or so. Or even the self-describing "local -i" because long options are not POSIX, and "local inherit" it cannot be either. --steffen | |Der Kragenbaer, The moon bear, |der holt sich munter he cheerfully and one by one |einen nach dem anderen runter wa.ks himself off |(By Robert Gernhardt) | |And in Fall, feel "The Dropbear Bard"s ball(s). | |The banded bear |without a care, |Banged on himself fore'er and e'er | |Farewell, dear collar bear
