Would you be willing to implement a shell option such as forlocal which, when turned off, would disable the creation of a function-local variable by executing a for loop?
yash is the only shell that makes for loop iteration variables local, so it's a considerable incompatibility with scripts written for other shells. I'd like to be able to disable this behaviour without enabling the full posixlycorrect mode, which limits yash in many ways.
Please consider the attached patch, which implements and tests a forlocal option, and documents it in the English versions of the documentation files. I apologise that I'm not able to patch the Japanese language documentation.
Would you be willing to implement a shell option such as forlocal which, when turned off, would disable the creation of a function-local variable by executing a for loop?
yash is the only shell that makes for loop iteration variables local, so it's a considerable incompatibility with scripts written for other shells. I'd like to be able to disable this behaviour without enabling the full posixlycorrect mode, which limits yash in many ways.
Please consider the attached patch, which implements and tests a forlocal option, and documents it in the English versions of the documentation files. I apologise that I'm not able to patch the Japanese language documentation.