Feb-24-2021, 07:43 AM
You have a few things going on that are unusual.
menu calls outer, outer calls inner, and inner calls menu. That's a recipe for an infinite recursion. I don't think it's needed. Perhaps if you had more specifics about what the functions should do, we could have some suggestions. Right now it seems to be a control flow example, but the control flow looks odd.
Also, there's no reason to have the inner function defined inside the outer. It doesn't reference any variables in the outer function, so better would be to have them independent. That doesn't prevent them from calling each other.
menu calls outer, outer calls inner, and inner calls menu. That's a recipe for an infinite recursion. I don't think it's needed. Perhaps if you had more specifics about what the functions should do, we could have some suggestions. Right now it seems to be a control flow example, but the control flow looks odd.
Also, there's no reason to have the inner function defined inside the outer. It doesn't reference any variables in the outer function, so better would be to have them independent. That doesn't prevent them from calling each other.