-
Notifications
You must be signed in to change notification settings - Fork 128
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Recursions not causing StackOverflow #95
Comments
I think biwascheme implement a tranpoline. |
BiwaScheme stack is a JavaScript Array and dynamically extended while recursion goes deeper. |
Oh. Nice! Is it required by Scheme standard to prevent stack overflow in deep recursions? |
The answer is yes, if the function is "tail-recursive". The requirement is called TCO(tail-call optimization). A Scheme implementation must not grow stack frame for tail calls. However your |
I was positively surprised to discover that this code was not causing a stack overflow
How could it be?
The text was updated successfully, but these errors were encountered: