Tail recursion optimized? Topic is solved

Get help with using AutoHotkey (v2 or newer) and its commands and hotkeys
sirksel
Posts: 222
Joined: 12 Nov 2013, 23:48

Tail recursion optimized?

20 Sep 2021, 12:06

Does anyone know if tail recursive calls are optimized in v2? In other words, if a recursive call is the last statement in a function, does the interpreter free the stack space of the penultimate call? I think the answer is no, based on a quick test I did with deep recursion. As I'm refactoring for beta1, I didn't want to waste time changing non-tail to tail recursion if the interpreter is indifferent between them. Thanks so much.

Return to “Ask for Help (v2)”

Who is online

Users browsing this forum: manbat42, mikeyww, ntepa, teadrinker and 25 guests