You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've encountered a happy trouble when I'm writing step5 in GNU Guile.
I think most of the languages will crash when calling (sum-to 10000) in non-tail-call way. But in Guile-2.1+, it's not true. It's because Guile-2.1+ has auto-grow-stack feature. So if the stack is out, there'll be new allocated stack, depends on your physical memory.
So I can get 50005000 after calling (sum-to 10000), which means rest1 will be set to this number rather than keep nil.
Some implementation, like C could undertake (sum-to 10000), but crash on (sum-to 100000).
But in Guile-2.1+, even (sum-to 1000000) is fine.
Now, how should we fix this properly...?
The text was updated successfully, but these errors were encountered:
@NalaGinrut yeah, I need a better solution for that. But for now, once you've gotten all other parts of the test to pass, you can just exclude the test in the toplevel Makefile.
@kanaka It's OK now. Guile has a solution to specify the stack size of a closure, named call-with-stack-overflow-handler. I set stack to a very small size to ensure it crash finally. Now I don't have to exclude step5. ;-)
I've encountered a happy trouble when I'm writing step5 in GNU Guile.
I think most of the languages will crash when calling (sum-to 10000) in non-tail-call way. But in Guile-2.1+, it's not true. It's because Guile-2.1+ has auto-grow-stack feature. So if the stack is out, there'll be new allocated stack, depends on your physical memory.
So I can get 50005000 after calling (sum-to 10000), which means rest1 will be set to this number rather than keep nil.
Some implementation, like C could undertake (sum-to 10000), but crash on (sum-to 100000).
But in Guile-2.1+, even (sum-to 1000000) is fine.
Now, how should we fix this properly...?
The text was updated successfully, but these errors were encountered: