3 ms·
Actually the "current approach" gives you no bound on the stack size. You guess, hope, and test (or do this analysis manually). While your general objection is
by mindslight 10y ago
Actually the "current approach" gives you no bound on the stack size. You guess, hope, and test (or do this analysis manually).
While your general objection is good to always keep in mind, it is a tradeoff. There is no perfect solution when you're up against the halting problem (unless you're proposing to change the language to only bounded recursion).
What I'm arguing for here is for more than the single problem the OP is solving, so it's not a case of choosing one or the other and calling it a day.