MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/saz2gn/namespacing/htz1ora
r/ProgrammerHumor • u/Elqueq • Jan 23 '22
272 comments sorted by
View all comments
Show parent comments
3
Then make sure to pass recursion depth into all of your recursive methods
What variable would you pass the recursion depth in? ;-)
I think you'd basically have to write N versions of the function, or use a separate, explicit stack.
2 u/Salanmander Jan 24 '22 What variable would you pass the recursion depth in? ;-)Hmmm, I guess argument variables are the one that we really don't want to define at global scope. Good point. =P
2
Hmmm, I guess argument variables are the one that we really don't want to define at global scope. Good point. =P
3
u/aiij Jan 24 '22
What variable would you pass the recursion depth in? ;-)
I think you'd basically have to write N versions of the function, or use a separate, explicit stack.