Yes, you can do it that way. But then you'll need a "context pointer" to pass references to the locals it'll need, and the function will need to be located "someplace else", meaning it is not encapsulated.
I've done that for years with C and C++. Nested functions are so much nicer and clearer.
I've done that for years with C and C++. Nested functions are so much nicer and clearer.