Correct.
This function is only known to its parent function.
The only potential reason to do such a suicide attempt to "opt code" is cases where you want a sub function to use the same variable as the main function.
The reason for this thing most likely is that goto / gosub do not exist anymore which allowed this kind of stuff without nested functions.
But even then: its a very bad programming style to use this kind of functionality as the program flow becomes less clear and potentially even corrupted if you ever try to visualize it in some kind of usage case or the like to explain to someone else what it does.
So my above suggestion with mainfunction_subfunction would allow a far clearer structuring (and potential reuse)
The only place I know this feature was ever used was the brl.gl module where it was used in the calctexsize to get the nearest power of 2 value.
This function is only known to its parent function.
The only potential reason to do such a suicide attempt to "opt code" is cases where you want a sub function to use the same variable as the main function.
The reason for this thing most likely is that goto / gosub do not exist anymore which allowed this kind of stuff without nested functions.
But even then: its a very bad programming style to use this kind of functionality as the program flow becomes less clear and potentially even corrupted if you ever try to visualize it in some kind of usage case or the like to explain to someone else what it does.
So my above suggestion with mainfunction_subfunction would allow a far clearer structuring (and potential reuse)
The only place I know this feature was ever used was the brl.gl module where it was used in the calctexsize to get the nearest power of 2 value.