D
David Mathog
Lately I have been trying to modify a section of code (not mine) which
uses indirect recursion. By indirect recursion I mean:
func A -> func B -> func C -> func A etc.
Which got me wondering, what limits, if any, does C place on this sort
of call structure? Near as I can tell the standard is "anything goes",
allowing any number of different functions in the call stack, nested as
deep as whatever the physical limit of the machine is.
On a separate note, is it just me, or is indirect recursion
intrinsically horribly difficult to debug? In order to get anywhere on
this code static "depth" counters had to be added to all of the
functions. (It also didn't help that the functions were relatively
long, with some having multiple return points and others multiple lines
that called the next function.)
Thanks,
David Mathog
uses indirect recursion. By indirect recursion I mean:
func A -> func B -> func C -> func A etc.
Which got me wondering, what limits, if any, does C place on this sort
of call structure? Near as I can tell the standard is "anything goes",
allowing any number of different functions in the call stack, nested as
deep as whatever the physical limit of the machine is.
On a separate note, is it just me, or is indirect recursion
intrinsically horribly difficult to debug? In order to get anywhere on
this code static "depth" counters had to be added to all of the
functions. (It also didn't help that the functions were relatively
long, with some having multiple return points and others multiple lines
that called the next function.)
Thanks,
David Mathog