shell option for local 'for' loop iteration variable
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.
Thanks for the suggestion of the new option! Your patch will be included in the next release.
Patch applied in r3993 with follow-ups r3994, r3995, r3996 and r3997