As with any assume-global function, if you want a variable to be local, all you need to do is declare it as such (
local err on its own line).
@ntepa Probably best not to rely on this as it contradicts the current documentation, and there was never any intention for declarations to be positional.
@swagfag Force-local would prevent the inner function from referring to outer variables. It was removed because functions, even built-in functions, now follow the same rules as variables and would therefore need to be individually declared before they could be called. There is no "revert to assume-local" statement because it wouldn't make sense for a nested function to be implicitly allowed to refer to local variables of an outer function but not global variables that the outer function itself could refer to.
Brujah4 wrote:Also, I don't want to have to init every variable with its own global.
In a way, the design penalizes the use of global variables. If you make your code more modular or self-contained, there will be fewer global variables to declare or not declare, and less need for (or benefit to) assume-global.
On the other hand, does your function
assign to these global variables? If not, you did not need to declare them in the first place.