in reply to Re^3: memory leak when using tail recursion?
in thread memory leak when using tail recursion?

Cabrion,
No worries. In languages that have tail recursion optimizations built in, there is no need for goto at all (just have the sub call itself). This is mostly the case for functional languages like Haskell. In perl, trying to achieve this yourself isn't much of a gain. It does avoid the deep recursion warning though.

This type of optimization falls into the category of unrolling loops. If your language doesn't do it for you, trying to do it yourself can be prone to error. If you are interested in computer science, reading the links I sent may be of use.

Cheers - L~R

  • Comment on Re^4: memory leak when using tail recursion?