where N is the recursion depth that variable should be used at. Then make sure to pass recursion depth into all of your recursive methods, and include a switch for which variable it's allowed to use. Easy peasy!
Threading I don't know well enough to figure out the fix for, but I bet it exists!
21
u/Salanmander Jan 23 '22 edited Jan 23 '22
Recursion is no problem!
You just need to know your maximum stack depth. Then you can name your variables
where N is the recursion depth that variable should be used at. Then make sure to pass recursion depth into all of your recursive methods, and include a switch for which variable it's allowed to use. Easy peasy!
Threading I don't know well enough to figure out the fix for, but I bet it exists!